1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-03 02:01:48 +02:00

Replace some bool recursive with a new FileIngestionMethod enum

This commit is contained in:
John Ericson 2020-03-29 01:04:55 -04:00
parent eb1911e277
commit 225e62a56a
27 changed files with 105 additions and 87 deletions

View file

@ -174,10 +174,10 @@ static void opAdd(Strings opFlags, Strings opArgs)
store. */
static void opAddFixed(Strings opFlags, Strings opArgs)
{
bool recursive = false;
FileIngestionMethod recursive = FileIngestionMethod::Flat;
for (auto & i : opFlags)
if (i == "--recursive") recursive = true;
if (i == "--recursive") recursive = FileIngestionMethod::Recursive;
else throw UsageError(format("unknown flag '%1%'") % i);
if (opArgs.empty())
@ -194,10 +194,10 @@ static void opAddFixed(Strings opFlags, Strings opArgs)
/* Hack to support caching in `nix-prefetch-url'. */
static void opPrintFixedPath(Strings opFlags, Strings opArgs)
{
bool recursive = false;
FileIngestionMethod recursive = FileIngestionMethod::Flat;
for (auto i : opFlags)
if (i == "--recursive") recursive = true;
if (i == "--recursive") recursive = FileIngestionMethod::Recursive;
else throw UsageError(format("unknown flag '%1%'") % i);
if (opArgs.size() != 3)