mirror of
https://github.com/NixOS/nix
synced 2025-06-29 02:11:15 +02:00
nix --help: Display help using lowdown instead of man
Fixes #4476. Fixes #5231.
This commit is contained in:
parent
14205debb2
commit
49a932fb18
8 changed files with 89 additions and 25 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue