about summary refs log tree commit diff
path: root/src/nix/command.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-09-27T16·28+0200
committerEelco Dolstra <edolstra@gmail.com>2017-09-27T16·28+0200
commit5421ad243e261d35bf8cb1000aa389399cf7657f (patch)
treed7189b15f440e347a3c7fa936138be7a4547e495 /src/nix/command.cc
parentb8875213dcedd60f419089392cd5a9b3cfaf6057 (diff)
nix copy: make recursive by default
Diffstat (limited to 'src/nix/command.cc')
-rw-r--r--src/nix/command.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/nix/command.cc b/src/nix/command.cc
index f69c56896567..0f6bb294b38c 100644
--- a/src/nix/command.cc
+++ b/src/nix/command.cc
@@ -100,9 +100,21 @@ void StoreCommand::run()
     run(getStore());
 }
 
-StorePathsCommand::StorePathsCommand()
+StorePathsCommand::StorePathsCommand(bool recursive)
+    : recursive(recursive)
 {
-    mkFlag('r', "recursive", "apply operation to closure of the specified paths", &recursive);
+    if (recursive)
+        mkFlag()
+            .longName("no-recursive")
+            .description("apply operation to specified paths only")
+            .set(&this->recursive, false);
+    else
+        mkFlag()
+            .longName("recursive")
+            .shortName('r')
+            .description("apply operation to closure of the specified paths")
+            .set(&this->recursive, true);
+
     mkFlag(0, "all", "apply operation to the entire store", &all);
 }