diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-12-09 19:21:48 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-12-21 13:32:28 +0100 |
commit | 2cc02bbe7675acb4754b928b5c57fa316600e877 (patch) | |
tree | cc5f5b2e9ad90b9aeb032e614c97bee0ba7b892c /src/nix/ls.cc | |
parent | a407d14339c2c480f0103a501bcd8a3373d935cb (diff) |
Add 'nix nar' manpages
Diffstat (limited to 'src/nix/ls.cc')
-rw-r--r-- | src/nix/ls.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/nix/ls.cc b/src/nix/ls.cc index 1f5ed6913..df67240f9 100644 --- a/src/nix/ls.cc +++ b/src/nix/ls.cc @@ -75,6 +75,8 @@ struct MixLs : virtual Args, MixJSON if (json) { JSONPlaceholder jsonRoot(std::cout); + if (showDirectory) + throw UsageError("'--directory' is useless with '--json'"); listNar(jsonRoot, accessor, path, recursive); } else listText(accessor); @@ -127,14 +129,11 @@ struct CmdLsNar : Command, MixLs expectArg("path", &path); } - Examples examples() override + std::string doc() override { - return { - Example{ - "To list a specific file in a NAR:", - "nix nar ls -l hello.nar /bin/hello" - }, - }; + return + #include "nar-ls.md" + ; } std::string description() override |