File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Sources/ArgumentParser/Completions
Tests/ArgumentParserExampleTests Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ struct BashCompletionsGenerator {
149149 ?? arg. help. keys. first? . rawValue ?? " --- "
150150
151151 return """
152- $( \( commandName) ---completion \( subcommandNames) -- \( argumentName) " $COMP_WORDS " )
152+ $( \( commandName) ---completion \( subcommandNames) -- \( argumentName) " ${ COMP_WORDS[@]} " )
153153 """
154154 }
155155 }
@@ -207,7 +207,7 @@ extension ArgumentDefinition {
207207 case . custom:
208208 // Generate a call back into the command to retrieve a completions list
209209 let commandName = commands. first!. _commandName
210- return #"COMPREPLY=( $(compgen -W "$( \#( commandName) \#( customCompletionCall ( commands) ) "$COMP_WORDS")" -- "$cur") )"#
210+ return #"COMPREPLY=( $(compgen -W "$( \#( commandName) \#( customCompletionCall ( commands) ) "${ COMP_WORDS[@]} ")" -- "$cur") )"#
211211 }
212212 }
213213}
Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ _math_stats_stdev() {
325325_math_stats_quantiles() {
326326 opts= " --file --directory --shell --custom --version -h --help "
327327 opts= " $opts alphabet alligator branch braggart "
328- opts= " $opts $(math ---completion stats quantiles -- customArg " $COMP_WORDS " ) "
328+ opts= " $opts $(math ---completion stats quantiles -- customArg " ${ COMP_WORDS[@]} " ) "
329329 if [[ $COMP_CWORD == " $1 " ]]; then
330330 COMPREPLY=( $(compgen -W " $opts " -- " $cur " ) )
331331 return
@@ -344,7 +344,7 @@ _math_stats_quantiles() {
344344 return
345345 ;;
346346 --custom)
347- COMPREPLY=( $(compgen -W " $(math ---completion stats quantiles -- --custom " $COMP_WORDS " ) " -- " $cur " ) )
347+ COMPREPLY=( $(compgen -W " $(math ---completion stats quantiles -- --custom " ${ COMP_WORDS[@]} " ) " -- " $cur " ) )
348348 return
349349 ;;
350350 esac
You can’t perform that action at this time.
0 commit comments