fix(tvix): globally reintroduce --quiet and --verbose flags.
The --quiet and -v/--verbose flags were removed during the glog conversion ind0c44425e1
, which has previously broken programs like e.g. home-manager, which passes --quiet to nix-build. A nix-build-specific workaround was added in24f9354d5b
, which manipulates the FLAGS_stderrthreshold global variable from glog. This commit moves the --quiet logic back into the argument handling code in libmain, and adds corresponding handling for -v/--verbose. Change-Id: I13d860ebbb78541d9f1236691a1efe8bd2163c67 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2170 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
This commit is contained in:
parent
5c3d58bb60
commit
c885bd0274
2 changed files with 14 additions and 2 deletions
14
third_party/nix/src/libmain/common-args.cc
vendored
14
third_party/nix/src/libmain/common-args.cc
vendored
|
@ -8,6 +8,20 @@ namespace nix {
|
|||
|
||||
MixCommonArgs::MixCommonArgs(const std::string& programName)
|
||||
: programName(programName) {
|
||||
mkFlag()
|
||||
.longName("verbose")
|
||||
.shortName('v')
|
||||
.description("increase verbosity level")
|
||||
.handler([]() {
|
||||
FLAGS_stderrthreshold = google::GLOG_INFO;
|
||||
FLAGS_v += 1;
|
||||
});
|
||||
|
||||
mkFlag()
|
||||
.longName("quiet")
|
||||
.description("silence all log output")
|
||||
.handler([]() { FLAGS_stderrthreshold = google::GLOG_FATAL; });
|
||||
|
||||
mkFlag()
|
||||
.longName("option")
|
||||
.labels({"name", "value"})
|
||||
|
|
2
third_party/nix/src/nix-build/nix-build.cc
vendored
2
third_party/nix/src/nix-build/nix-build.cc
vendored
|
@ -242,8 +242,6 @@ static void _main(int argc, char** argv) {
|
|||
else if (*arg == "--keep") {
|
||||
keepVars.insert(getArg(*arg, arg, end));
|
||||
|
||||
} else if (*arg == "--quiet") {
|
||||
FLAGS_stderrthreshold = google::GLOG_FATAL;
|
||||
} else if (*arg == "-") {
|
||||
readStdin = true;
|
||||
|
||||
|
|
Loading…
Reference in a new issue