Merge pull request #14928 from Zaczero/zaczero/nixmain
Remove regex from isNixCommand
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
#include "cli-config-private.hh"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <regex>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#ifndef _WIN32
|
||||
@@ -501,7 +500,7 @@ void mainWrapped(int argc, char ** argv)
|
||||
});
|
||||
|
||||
try {
|
||||
auto isNixCommand = std::regex_search(programName, std::regex("nix$"));
|
||||
auto isNixCommand = programName.ends_with("nix");
|
||||
auto allowShebang = isNixCommand && argc > 1;
|
||||
args.parseCmdline(argvToStrings(argc, argv), allowShebang);
|
||||
} catch (UsageError &) {
|
||||
|
||||
Reference in New Issue
Block a user