mirror of
https://github.com/NixOS/nix
synced 2025-07-03 02:01:48 +02:00
Group common options
This commit is contained in:
parent
807d963ee8
commit
36c4d6f592
11 changed files with 80 additions and 26 deletions
|
@ -11,18 +11,21 @@ MixCommonArgs::MixCommonArgs(const string & programName)
|
|||
.longName = "verbose",
|
||||
.shortName = 'v',
|
||||
.description = "Increase the logging verbosity level.",
|
||||
.category = loggingCategory,
|
||||
.handler = {[]() { verbosity = (Verbosity) (verbosity + 1); }},
|
||||
});
|
||||
|
||||
addFlag({
|
||||
.longName = "quiet",
|
||||
.description = "Decrease the logging verbosity level.",
|
||||
.category = loggingCategory,
|
||||
.handler = {[]() { verbosity = verbosity > lvlError ? (Verbosity) (verbosity - 1) : lvlError; }},
|
||||
});
|
||||
|
||||
addFlag({
|
||||
.longName = "debug",
|
||||
.description = "Set the logging verbosity level to 'debug'.",
|
||||
.category = loggingCategory,
|
||||
.handler = {[]() { verbosity = lvlDebug; }},
|
||||
});
|
||||
|
||||
|
@ -52,6 +55,7 @@ MixCommonArgs::MixCommonArgs(const string & programName)
|
|||
addFlag({
|
||||
.longName = "log-format",
|
||||
.description = "Set the format of log output; one of `raw`, `internal-json`, `bar` or `bar-with-logs`.",
|
||||
.category = loggingCategory,
|
||||
.labels = {"format"},
|
||||
.handler = {[](std::string format) { setLogFormat(format); }},
|
||||
});
|
||||
|
@ -66,7 +70,7 @@ MixCommonArgs::MixCommonArgs(const string & programName)
|
|||
}}
|
||||
});
|
||||
|
||||
std::string cat = "config";
|
||||
std::string cat = "Options to override configuration settings";
|
||||
globalConfig.convertToArgs(*this, cat);
|
||||
|
||||
// Backward compatibility hack: nix-env already had a --system flag.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue