Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ struct BashCompletionsGenerator {
?? arg.help.keys.first?.rawValue ?? "---"

return """
$(\(commandName) ---completion \(subcommandNames) -- \(argumentName) "$COMP_WORDS")
$(\(commandName) ---completion \(subcommandNames) -- \(argumentName) "${COMP_WORDS[@]}")
"""
}
}
Expand Down Expand Up @@ -207,7 +207,7 @@ extension ArgumentDefinition {
case .custom:
// Generate a call back into the command to retrieve a completions list
let commandName = commands.first!._commandName
return #"COMPREPLY=( $(compgen -W "$(\#(commandName) \#(customCompletionCall(commands)) "$COMP_WORDS")" -- "$cur") )"#
return #"COMPREPLY=( $(compgen -W "$(\#(commandName) \#(customCompletionCall(commands)) "${COMP_WORDS[@]}")" -- "$cur") )"#
}
}
}
4 changes: 2 additions & 2 deletions Tests/ArgumentParserExampleTests/MathExampleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ _math_stats_stdev() {
_math_stats_quantiles() {
opts="--file --directory --shell --custom --version -h --help"
opts="$opts alphabet alligator branch braggart"
opts="$opts $(math ---completion stats quantiles -- customArg "$COMP_WORDS")"
opts="$opts $(math ---completion stats quantiles -- customArg "${COMP_WORDS[@]}")"
if [[ $COMP_CWORD == "$1" ]]; then
COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
return
Expand All @@ -344,7 +344,7 @@ _math_stats_quantiles() {
return
;;
--custom)
COMPREPLY=( $(compgen -W "$(math ---completion stats quantiles -- --custom "$COMP_WORDS")" -- "$cur") )
COMPREPLY=( $(compgen -W "$(math ---completion stats quantiles -- --custom "${COMP_WORDS[@]}")" -- "$cur") )
return
;;
esac
Expand Down