parent
cced73496b
commit
f33878b656
|
@ -61,6 +61,7 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs
|
||||||
bool printBuildLogs = false;
|
bool printBuildLogs = false;
|
||||||
bool useNet = true;
|
bool useNet = true;
|
||||||
bool refresh = false;
|
bool refresh = false;
|
||||||
|
bool showVersion = false;
|
||||||
|
|
||||||
NixArgs() : MultiCommand(RegisterCommand::getCommandsFor({})), MixCommonArgs("nix")
|
NixArgs() : MultiCommand(RegisterCommand::getCommandsFor({})), MixCommonArgs("nix")
|
||||||
{
|
{
|
||||||
|
@ -87,7 +88,7 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs
|
||||||
addFlag({
|
addFlag({
|
||||||
.longName = "version",
|
.longName = "version",
|
||||||
.description = "Show version information.",
|
.description = "Show version information.",
|
||||||
.handler = {[&]() { if (!completions) printVersion(programName); }},
|
.handler = {[&]() { showVersion = true; }},
|
||||||
});
|
});
|
||||||
|
|
||||||
addFlag({
|
addFlag({
|
||||||
|
@ -280,6 +281,11 @@ void mainWrapped(int argc, char * * argv)
|
||||||
|
|
||||||
initPlugins();
|
initPlugins();
|
||||||
|
|
||||||
|
if (args.showVersion) {
|
||||||
|
printVersion(programName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!args.command)
|
if (!args.command)
|
||||||
throw UsageError("no subcommand specified");
|
throw UsageError("no subcommand specified");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue