mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-15 10:46:15 +02:00
nix flake show: Only print up to the first new line if it exists.
This commit is contained in:
parent
547e808a75
commit
07d0527c0c
1 changed files with 5 additions and 1 deletions
|
@ -1262,7 +1262,11 @@ struct CmdFlakeShow : FlakeCommand, MixJSON
|
||||||
attrPath.size() >= 1 && attrPathS[0] == "hydraJobs" ? "derivation" :
|
attrPath.size() >= 1 && attrPathS[0] == "hydraJobs" ? "derivation" :
|
||||||
"package";
|
"package";
|
||||||
if (description) {
|
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 {
|
else {
|
||||||
logger->cout("%s: %s '%s'", headerPrefix, type, name);
|
logger->cout("%s: %s '%s'", headerPrefix, type, name);
|
||||||
|
|
Loading…
Reference in a new issue