diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-04-27 19:06:58 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2021-04-27 19:06:58 +0000 |
commit | e023c985d58094041e74ff59a51757bc75687ca7 (patch) | |
tree | 8865872040ac8752c8349b73fa71b82e80dc2584 /src/libmain/common-args.hh | |
parent | d3cfc14e3a370116e5715d5de5f64ed34dd2f912 (diff) | |
parent | 906adadacd2d1c98346a2f42c0b42a32d2806d94 (diff) |
Merge remote-tracking branch 'upstream/master' into auto-uid-allocation
Diffstat (limited to 'src/libmain/common-args.hh')
-rw-r--r-- | src/libmain/common-args.hh | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/libmain/common-args.hh b/src/libmain/common-args.hh index a4de3dccf..31bdf527a 100644 --- a/src/libmain/common-args.hh +++ b/src/libmain/common-args.hh @@ -4,10 +4,17 @@ namespace nix { -struct MixCommonArgs : virtual Args +//static constexpr auto commonArgsCategory = "Miscellaneous common options"; +static constexpr auto loggingCategory = "Logging-related options"; + +class MixCommonArgs : public virtual Args { + void initialFlagsProcessed() override; +public: string programName; MixCommonArgs(const string & programName); +protected: + virtual void pluginsInited() {} }; struct MixDryRun : virtual Args @@ -16,7 +23,12 @@ struct MixDryRun : virtual Args MixDryRun() { - mkFlag(0, "dry-run", "show what this command would do without doing it", &dryRun); + addFlag({ + .longName = "dry-run", + .description = "Show what this command would do without doing it.", + //.category = commonArgsCategory, + .handler = {&dryRun, true}, + }); } }; @@ -26,7 +38,12 @@ struct MixJSON : virtual Args MixJSON() { - mkFlag(0, "json", "produce JSON output", &json); + addFlag({ + .longName = "json", + .description = "Produce output in JSON format, suitable for consumption by another program.", + //.category = commonArgsCategory, + .handler = {&json, true}, + }); } }; |