Skip to content

Commit ce14faa

Browse files
committed
Fix flag descriptions showing up as command descriptions
1 parent 40dda45 commit ce14faa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

+8-2
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,17 @@ def make-subcommands-completion [parents: list<string>] {
122122

123123
$fishes
124124
| group-by arguments # group by sub command (arguments flag)
125-
| transpose name args # turn it into a table of name to arguments
125+
| transpose name args # turn it into a table of name to arguments
126126
| each {|subcommand|
127127
[
128128
# description
129-
(if ('description' in ($subcommand.args | columns)) and ($subcommand.args.description != "") { $"# ($subcommand.args.description.0)\n" })
129+
(
130+
if (('description' in ($subcommand.args | columns))
131+
and ($subcommand.args.description != "")
132+
and ('condition' in ($subcommand.args | columns))
133+
and ($subcommand.args.condition == "__fish_use_subcommand")
134+
) { $"# ($subcommand.args.description)\n" }
135+
)
130136
# extern name
131137
$'extern "($parents | append $subcommand.name | str join " " | str trim)"'
132138
# params

0 commit comments

Comments
 (0)