diff options
author | John Ericson <git@JohnEricson.me> | 2020-03-29 01:04:55 -0400 |
---|---|---|
committer | John Ericson <git@JohnEricson.me> | 2020-03-29 15:16:20 -0400 |
commit | 225e62a56a7cebb030bebffb8d2bd7afe21cc64a (patch) | |
tree | 4cd7999dab685a09aea40236d631a9c2a43e2a40 /src/nix/command.cc | |
parent | eb1911e277bfcc1b161cb996205ae1696f496099 (diff) |
Replace some `bool recursive` with a new `FileIngestionMethod` enum
Diffstat (limited to 'src/nix/command.cc')
-rw-r--r-- | src/nix/command.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nix/command.cc b/src/nix/command.cc index 442bc6c53..fce6c391c 100644 --- a/src/nix/command.cc +++ b/src/nix/command.cc @@ -28,20 +28,20 @@ void StoreCommand::run() run(getStore()); } -StorePathsCommand::StorePathsCommand(bool recursive) +StorePathsCommand::StorePathsCommand(FileIngestionMethod recursive) : recursive(recursive) { - if (recursive) + if (recursive == FileIngestionMethod::Recursive) mkFlag() .longName("no-recursive") .description("apply operation to specified paths only") - .set(&this->recursive, false); + .set(&this->recursive, FileIngestionMethod::Flat); else mkFlag() .longName("recursive") .shortName('r') .description("apply operation to closure of the specified paths") - .set(&this->recursive, true); + .set(&this->recursive, FileIngestionMethod::Recursive); mkFlag(0, "all", "apply operation to the entire store", &all); } @@ -61,7 +61,7 @@ void StorePathsCommand::run(ref<Store> store) for (auto & p : toStorePaths(store, realiseMode, installables)) storePaths.push_back(p.clone()); - if (recursive) { + if (recursive == FileIngestionMethod::Recursive) { StorePathSet closure; store->computeFSClosure(storePathsToSet(storePaths), closure, false, false); storePaths.clear(); |