diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-05-15 20:38:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-15 20:38:38 +0200 |
commit | 8f6c72faeec2dfd3ce6e48c9539bb5d7a161f37a (patch) | |
tree | e046e83291925cbfcad531e33a87eed8f6c066cf /src/nix/main.cc | |
parent | b6eb8a2d7e2ea8b083fdac15f537679ffe633183 (diff) | |
parent | 66b8a62101cb1dfe2e368346cf99efd32e9328ae (diff) |
Merge pull request #2810 from NixOS/print-build-logs
nix: Add --print-build-logs flag
Diffstat (limited to 'src/nix/main.cc')
-rw-r--r-- | src/nix/main.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc index 64c1dc357..4f87ad72b 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -20,6 +20,8 @@ std::string programPath; struct NixArgs : virtual MultiCommand, virtual MixCommonArgs { + bool printBuildLogs = false; + NixArgs() : MultiCommand(*RegisterCommand::commands), MixCommonArgs("nix") { mkFlag() @@ -42,6 +44,11 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs }); mkFlag() + .longName("print-build-logs") + .description("print full build logs on stderr") + .set(&printBuildLogs, true); + + mkFlag() .longName("version") .description("show version information") .handler([&]() { printVersion(programName); }); @@ -98,8 +105,7 @@ void mainWrapped(int argc, char * * argv) Finally f([]() { stopProgressBar(); }); - if (isatty(STDERR_FILENO)) - startProgressBar(); + startProgressBar(args.printBuildLogs); args.command->prepare(); args.command->run(); |