mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 08:12:29 +00:00
Account for total length of 80
This commit is contained in:
parent
f22cf1fd38
commit
930818bb1d
@ -1269,8 +1269,8 @@ struct CmdFlakeShow : FlakeCommand, MixJSON
|
|||||||
|
|
||||||
// If the string is too long then resize add ellipses
|
// If the string is too long then resize add ellipses
|
||||||
std::string desc;
|
std::string desc;
|
||||||
if (length > 80) {
|
if (length > 77) {
|
||||||
trimmed.resize(80);
|
trimmed.resize(77);
|
||||||
desc = trimmed.append("...");
|
desc = trimmed.append("...");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -110,5 +110,5 @@ nix flake show > ./show-output.txt
|
|||||||
test "$(awk -F '[:] ' '/aNoDescription/{print $NF}' ./show-output.txt)" = "package 'simple'"
|
test "$(awk -F '[:] ' '/aNoDescription/{print $NF}' ./show-output.txt)" = "package 'simple'"
|
||||||
test "$(awk -F '[:] ' '/bOneLineDescription/{print $NF}' ./show-output.txt)" = "package 'simple' - 'one line'"
|
test "$(awk -F '[:] ' '/bOneLineDescription/{print $NF}' ./show-output.txt)" = "package 'simple' - 'one line'"
|
||||||
test "$(awk -F '[:] ' '/cMultiLineDescription/{print $NF}' ./show-output.txt)" = "package 'simple' - 'line one'"
|
test "$(awk -F '[:] ' '/cMultiLineDescription/{print $NF}' ./show-output.txt)" = "package 'simple' - 'line one'"
|
||||||
test "$(awk -F '[:] ' '/dLongDescription/{print $NF}' ./show-output.txt)" = "package 'simple' - '01234567890123456789012345678901234567890123456789012345678901234567890123456789...'"
|
test "$(awk -F '[:] ' '/dLongDescription/{print $NF}' ./show-output.txt)" = "package 'simple' - '01234567890123456789012345678901234567890123456789012345678901234567890123456...'"
|
||||||
test "$(awk -F '[:] ' '/eEmptyDescription/{print $NF}' ./show-output.txt)" = "package 'simple'"
|
test "$(awk -F '[:] ' '/eEmptyDescription/{print $NF}' ./show-output.txt)" = "package 'simple'"
|
||||||
|
Loading…
Reference in New Issue
Block a user