Skip to content

Commit 17149ac

Browse files
author
David Arnold
authored
Improve style and formatting (#40)
1 parent aa79350 commit 17149ac

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mkDevShell/options.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ let
2121
esc = "";
2222
ansiOrange = "${esc}[38;5;202m";
2323
ansiReset = "${esc}[0m";
24+
ansiBold = "${esc}[1m";
2425

2526
commandsToMenu = commands:
2627
let
@@ -57,13 +58,13 @@ let
5758
len = maxCommandLength - (builtins.stringLength name);
5859
in
5960
if help == null || help == "" then
60-
name
61+
" ${name}"
6162
else
62-
"${pad name len} - ${help}";
63+
" ${pad name len} - ${help}";
6364
in
64-
"\n[${name}]\n" + builtins.concatStringsSep "\n" (map opCmd value);
65+
"\n${ansiBold}[${name}]${ansiReset}\n\n" + builtins.concatStringsSep "\n" (map opCmd value);
6566
in
66-
builtins.concatStringsSep "\n" (map opCat commandByCategoriesSorted)
67+
builtins.concatStringsSep "\n" (map opCat commandByCategoriesSorted) + "\n"
6768
;
6869

6970
# Because we want to be able to push pure JSON-like data into the
@@ -222,9 +223,8 @@ in
222223
help = "prints this menu";
223224
name = "menu";
224225
command = ''
225-
cat <<'DEVSHELL_MENU'
226-
${commandsToMenu config.commands}
227-
DEVSHELL_MENU
226+
menu="${commandsToMenu config.commands}"
227+
echo -e "$menu"
228228
'';
229229
}
230230
];

0 commit comments

Comments
 (0)