aboutsummaryrefslogtreecommitdiff
path: root/src/nix/main.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-05-15 20:51:29 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-05-15 20:51:29 +0200
commit0f5032c5a4b41bceefac9f834baf288466fc20ae (patch)
tree81335b1714bca37821314e02b93ca357422dc049 /src/nix/main.cc
parent38b87dea62fa1295c3a8c019477dd8661542a0e0 (diff)
parent8f6c72faeec2dfd3ce6e48c9539bb5d7a161f37a (diff)
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/nix/main.cc')
-rw-r--r--src/nix/main.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc
index 3ec5f48d5..a1fcb892a 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); });
@@ -109,8 +116,7 @@ void mainWrapped(int argc, char * * argv)
Finally f([]() { stopProgressBar(); });
- if (isatty(STDERR_FILENO))
- startProgressBar();
+ startProgressBar(args.printBuildLogs);
args.command->prepare();
args.command->run();