mirror of
https://github.com/NixOS/nix.git
synced 2025-11-10 04:26:01 +01:00
dropEmptyInitThenConcatStringsSep -> concatStringSep: diagnostics and docs
These are non-critical, so their behavior is ok to change. Dropping empty items is not needed and usually not expected.
This commit is contained in:
parent
a681d354e7
commit
ea966a70fc
9 changed files with 28 additions and 16 deletions
|
|
@ -1,3 +1,5 @@
|
|||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "command.hh"
|
||||
#include "markdown.hh"
|
||||
#include "store-api.hh"
|
||||
|
|
@ -6,8 +8,7 @@
|
|||
#include "nixexpr.hh"
|
||||
#include "profiles.hh"
|
||||
#include "repl.hh"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "strings.hh"
|
||||
|
||||
extern char * * environ __attribute__((weak));
|
||||
|
||||
|
|
@ -42,7 +43,7 @@ void NixMultiCommand::run()
|
|||
for (auto & [name, _] : commands)
|
||||
subCommandTextLines.insert(fmt("- `%s`", name));
|
||||
std::string markdownError = fmt("`nix %s` requires a sub-command. Available sub-commands:\n\n%s\n",
|
||||
commandName, dropEmptyInitThenConcatStringsSep("\n", subCommandTextLines));
|
||||
commandName, concatStringsSep("\n", subCommandTextLines));
|
||||
throw UsageError(renderMarkdownToTerminal(markdownError));
|
||||
}
|
||||
command->second->run();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue