Skip to content

Commit 087e050

Browse files
committed
Reduce string construction complexity
1 parent 96a5b4e commit 087e050

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

needs-update/custom-completions/auto-generate/parse-fish.nu

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,10 @@ def make-subcommands-completion [parents: list<string>] {
9696
| transpose name args # turn it into a table of name to arguments
9797
| each {|subcommand|
9898
[
99-
# (sub)command description
99+
# description
100100
(if ('d' in ($subcommand.args | columns)) and ($subcommand.args.d != "") { $"# ($subcommand.args.d.0)\n" })
101-
# extern command
102-
([
103-
"extern " $quote ($parents | str join " ")
104-
# sub command if present
105-
(if $subcommand.name != "" { [ " " $subcommand.name ] | str join })
106-
$quote
107-
] | str join)
101+
# extern name
102+
$'extern "($parents | append $subcommand.name | str join " " | str trim)"'
108103
# params
109104
" [\n"
110105
(

0 commit comments

Comments
 (0)