diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-09-27T16·28+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-09-27T16·28+0200 |
commit | 5421ad243e261d35bf8cb1000aa389399cf7657f (patch) | |
tree | d7189b15f440e347a3c7fa936138be7a4547e495 /src/nix/command.cc | |
parent | b8875213dcedd60f419089392cd5a9b3cfaf6057 (diff) |
nix copy: make recursive by default
Diffstat (limited to 'src/nix/command.cc')
-rw-r--r-- | src/nix/command.cc | 16 |
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); } |