about summary refs log tree commit diff
path: root/src/libutil/args.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-21T12·34+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-21T12·34+0200
commit1b0088ebb226ab80c91b54c201cc70204b976310 (patch)
tree52f851fa6e91512a6e4351f104c4cfa7673957c6 /src/libutil/args.hh
parentddea253ff8312bf1d2559999c4dd8d9cc3e5b240 (diff)
nix --help: Show short flags
Diffstat (limited to 'src/libutil/args.hh')
-rw-r--r--src/libutil/args.hh3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libutil/args.hh b/src/libutil/args.hh
index 4469a046d28a..6aa08aacac9e 100644
--- a/src/libutil/args.hh
+++ b/src/libutil/args.hh
@@ -29,6 +29,7 @@ protected:
     /* Flags. */
     struct Flag
     {
+        char shortName;
         std::string description;
         Strings labels;
         size_t arity;
@@ -63,7 +64,7 @@ public:
         const Strings & labels, const std::string & description,
         size_t arity, std::function<void(Strings)> handler)
     {
-        auto flag = Flag{description, labels, arity, handler};
+        auto flag = Flag{shortName, description, labels, arity, handler};
         if (shortName) shortFlags[shortName] = flag;
         longFlags[longName] = flag;
     }