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

dropEmptyInitThenConcatStringsSep -> concatStringSep: break nix help "" "" "" build

Garbage in, error out. Experimental CLI. Zero derivations given.
This commit is contained in:
Robert Hensing 2024-07-13 01:29:15 +02:00
parent 062672b022
commit d9043021df

View file

@ -240,7 +240,7 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs, virtual RootArgs
lowdown. */ lowdown. */
static void showHelp(std::vector<std::string> subcommand, NixArgs & toplevel) static void showHelp(std::vector<std::string> subcommand, NixArgs & toplevel)
{ {
auto mdName = subcommand.empty() ? "nix" : fmt("nix3-%s", dropEmptyInitThenConcatStringsSep("-", subcommand)); auto mdName = subcommand.empty() ? "nix" : fmt("nix3-%s", concatStringsSep("-", subcommand));
evalSettings.restrictEval = false; evalSettings.restrictEval = false;
evalSettings.pureEval = false; evalSettings.pureEval = false;
@ -275,7 +275,7 @@ static void showHelp(std::vector<std::string> subcommand, NixArgs & toplevel)
auto attr = vRes->attrs()->get(state.symbols.create(mdName + ".md")); auto attr = vRes->attrs()->get(state.symbols.create(mdName + ".md"));
if (!attr) if (!attr)
throw UsageError("Nix has no subcommand '%s'", dropEmptyInitThenConcatStringsSep("", subcommand)); throw UsageError("Nix has no subcommand '%s'", concatStringsSep("", subcommand));
auto markdown = state.forceString(*attr->value, noPos, "while evaluating the lowdown help text"); auto markdown = state.forceString(*attr->value, noPos, "while evaluating the lowdown help text");