mirror of
https://github.com/NixOS/nix.git
synced 2025-02-19 18:32:36 +00:00
nix flake show: Only print up to the first new line if it exists.
This commit is contained in:
parent
547e808a75
commit
07d0527c0c
@ -1262,7 +1262,11 @@ struct CmdFlakeShow : FlakeCommand, MixJSON
|
||||
attrPath.size() >= 1 && attrPathS[0] == "hydraJobs" ? "derivation" :
|
||||
"package";
|
||||
if (description) {
|
||||
logger->cout("%s: %s '%s' - '%s'", headerPrefix, type, name, *description);
|
||||
// Handle new lines in descriptions.
|
||||
auto index = description->find('\n');
|
||||
std::string_view sanitized_description(description->data(), index != std::string::npos ? index : description->size());
|
||||
|
||||
logger->cout("%s: %s '%s' - '%s'", headerPrefix, type, name, sanitized_description);
|
||||
}
|
||||
else {
|
||||
logger->cout("%s: %s '%s'", headerPrefix, type, name);
|
||||
|
Loading…
Reference in New Issue
Block a user