Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cced73496b83
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f33878b6562c
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Feb 17, 2021

  1. Make 'nix --version -vv' work

    Fixes #3743.
    edolstra committed Feb 17, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    sxzz Kevin Deng 三咲智子
    Copy the full SHA
    f33878b View commit details
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/nix/main.cc
8 changes: 7 additions & 1 deletion src/nix/main.cc
Original file line number Diff line number Diff line change
@@ -61,6 +61,7 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs
bool printBuildLogs = false;
bool useNet = true;
bool refresh = false;
bool showVersion = false;

NixArgs() : MultiCommand(RegisterCommand::getCommandsFor({})), MixCommonArgs("nix")
{
@@ -87,7 +88,7 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs
addFlag({
.longName = "version",
.description = "Show version information.",
.handler = {[&]() { if (!completions) printVersion(programName); }},
.handler = {[&]() { showVersion = true; }},
});

addFlag({
@@ -280,6 +281,11 @@ void mainWrapped(int argc, char * * argv)

initPlugins();

if (args.showVersion) {
printVersion(programName);
return;
}

if (!args.command)
throw UsageError("no subcommand specified");