aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/args.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-09-13 14:41:28 +0200
committerEelco Dolstra <edolstra@gmail.com>2021-09-13 14:45:21 +0200
commit49a932fb18add471feefc469fb45fc44313bd5c6 (patch)
tree716a8abc8682f190b22d1b2fecb4ed45bb87ae55 /src/libutil/args.hh
parent14205debb244b925d685e3645c4deef937fa78ec (diff)
nix --help: Display help using lowdown instead of man
Fixes #4476. Fixes #5231.
Diffstat (limited to 'src/libutil/args.hh')
-rw-r--r--src/libutil/args.hh8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libutil/args.hh b/src/libutil/args.hh
index c08ba8abd..22c94b501 100644
--- a/src/libutil/args.hh
+++ b/src/libutil/args.hh
@@ -12,6 +12,8 @@ namespace nix {
enum HashType : char;
+class MultiCommand;
+
class Args
{
public:
@@ -169,11 +171,13 @@ public:
virtual nlohmann::json toJSON();
friend class MultiCommand;
+
+ MultiCommand * parent = nullptr;
};
/* A command is an argument parser that can be executed by calling its
run() method. */
-struct Command : virtual Args
+struct Command : virtual public Args
{
friend class MultiCommand;
@@ -193,7 +197,7 @@ typedef std::map<std::string, std::function<ref<Command>()>> Commands;
/* An argument parser that supports multiple subcommands,
i.e. ‘<command> <subcommand>’. */
-class MultiCommand : virtual Args
+class MultiCommand : virtual public Args
{
public:
Commands commands;