mirror of
https://github.com/NixOS/nix
synced 2025-06-28 13:41:15 +02:00
Fix nix shebang interaction with #8131 overhaul completions
This commit is contained in:
parent
e91fd837ee
commit
ffd414eb75
4 changed files with 25 additions and 29 deletions
|
@ -80,12 +80,6 @@ std::optional<std::string> RootArgs::needsCompletion(std::string_view s)
|
|||
return {};
|
||||
}
|
||||
|
||||
void RootArgs::parseCmdline(const Strings & _cmdline)
|
||||
{
|
||||
// Default via 5.1.2.2.1 in C standard
|
||||
Args::parseCmdline(_cmdline, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Basically this is `typedef std::optional<Parser> Parser(std::string_view s, Strings & r);`
|
||||
*
|
||||
|
@ -227,7 +221,7 @@ static Strings parseShebangContent(std::string_view s) {
|
|||
return result;
|
||||
}
|
||||
|
||||
void Args::parseCmdline(const Strings & _cmdline, bool allowShebang)
|
||||
void RootArgs::parseCmdline(const Strings & _cmdline, bool allowShebang)
|
||||
{
|
||||
Strings pendingArgs;
|
||||
bool dashDash = false;
|
||||
|
@ -339,10 +333,13 @@ void Args::parseCmdline(const Strings & _cmdline, bool allowShebang)
|
|||
|
||||
Path Args::getCommandBaseDir() const
|
||||
{
|
||||
if (parent)
|
||||
return parent->getCommandBaseDir();
|
||||
else
|
||||
return commandBaseDir;
|
||||
assert(parent);
|
||||
return parent->getCommandBaseDir();
|
||||
}
|
||||
|
||||
Path RootArgs::getCommandBaseDir() const
|
||||
{
|
||||
return commandBaseDir;
|
||||
}
|
||||
|
||||
bool Args::processFlag(Strings::iterator & pos, Strings::iterator end)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue