about summary refs log tree commit diff
path: root/src/libutil/args.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-08-29T12·28+0200
committerEelco Dolstra <edolstra@gmail.com>2017-08-29T12·42+0200
commit5cc8609e30ab4f76053f3159c51ea78d9215bc8c (patch)
tree1a8d1d78f82389280f6c59954b8f82bdb2823f43 /src/libutil/args.hh
parent93a5ef0516881ec133fc5e54069add6dd64ffbdd (diff)
nix run: Allow passing a command to execute
E.g.

  nix run nixpkgs.hello -c hello --greeting Hallo

Note that unlike "nix-shell --command", no quoting of arguments is
necessary.

"-c" (short for "--command") cannot be combined with "--" because they
both consume all remaining arguments. But since installables shouldn't
start with a dash, this is unlikely to cause problems.
Diffstat (limited to 'src/libutil/args.hh')
-rw-r--r--src/libutil/args.hh2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libutil/args.hh b/src/libutil/args.hh
index fd910b965ccc..044ed209e3bf 100644
--- a/src/libutil/args.hh
+++ b/src/libutil/args.hh
@@ -26,6 +26,8 @@ public:
 
 protected:
 
+    static const size_t ArityAny = std::numeric_limits<size_t>::max();
+
     /* Flags. */
     struct Flag
     {