File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -169,11 +169,14 @@ def command-doc [command] {
169169
170170 let flags = if $no_flags { ' ' } else {
171171 ($command.signatures | get $columns.0 | each { |param |
172- if $param.parameter_type == " switch" {
173- $" - `--($param.parameter_name ), -($param.short_flag )`: ($param.description )"
174- } else if $param.parameter_type == " named" {
175- $" - `--($param.parameter_name ), -($param.short_flag ) {($param.syntax_shape )}`: ($param.description )"
176- }
172+ let start = $' - `--($param.parameter_name )'
173+ let end = $' `: ($param.description )'
174+ let short_flag = (if ($param.short_flag | is-empty ) {' ' } else {$' , -($param.short_flag )' })
175+ if $param.parameter_type == ' switch' {
176+ $' ($start )($short_flag )($end )'
177+ } else if $param.parameter_type == ' named' {
178+ $' ($start )($short_flag ) {($param.syntax_shape )}($end )'
179+ }
177180 } | str join (char newline ))
178181 }
179182
You can’t perform that action at this time.
0 commit comments