From daf365b0b731bb3ac86128a965394dcff8d6f5b5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 10 Dec 2020 18:40:16 +0100 Subject: [PATCH] Add 'nix help' manpage --- src/nix/help.md | 17 +++++++++++++++++ src/nix/main.cc | 17 +++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 src/nix/help.md diff --git a/src/nix/help.md b/src/nix/help.md new file mode 100644 index 000000000..734f35028 --- /dev/null +++ b/src/nix/help.md @@ -0,0 +1,17 @@ +R""( + +# Examples + +* Show help about `nix` in general: + + ```console + # nix help + ``` + +* Show help about a particular subcommand: + + ```console + # nix help flake info + ``` + +)"" diff --git a/src/nix/main.cc b/src/nix/main.cc index e7a15dec9..afe7cb8d7 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -205,21 +205,14 @@ struct CmdHelp : Command std::string description() override { - return "show help about 'nix' or a particular subcommand"; + return "show help about `nix` or a particular subcommand"; } - Examples examples() override + std::string doc() override { - return { - Example{ - "To show help about 'nix' in general:", - "nix help" - }, - Example{ - "To show help about a particular subcommand:", - "nix help run" - }, - }; + return + #include "help.md" + ; } void run() override