summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-12-10 18:40:16 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-12-21 13:32:29 +0100
commitdaf365b0b731bb3ac86128a965394dcff8d6f5b5 (patch)
treedd3c8cccc77a36eb3bebc89a5018bbb012323063 /src
parente6bea9c9b10ded0e65981edf84cedd00ec86883a (diff)
Add 'nix help' manpage
Diffstat (limited to 'src')
-rw-r--r--src/nix/help.md17
-rw-r--r--src/nix/main.cc17
2 files changed, 22 insertions, 12 deletions
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