Skip to content

Commit

Permalink
Fix usage example
Browse files Browse the repository at this point in the history
 - Actually parse the values into a COMPREPLY array
  • Loading branch information
jsotuyod authored and remkop committed Oct 31, 2022
1 parent 176de2c commit 99d87dc
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/picocli/AutoComplete.java
Expand Up @@ -432,7 +432,7 @@ private static class CommandDescriptor {
+ "# Example usage:\n"
+ "# local options=(\"foo\", \"bar\", \"baz\")\n"
+ "# local IFS=$'\\n'\n"
+ "# COMPREPLY=$(compReplyArray \"${options[@]}\")\n" +
+ "# COMPREPLY=($(compReplyArray \"${options[@]}\"))\n" +
"function compReplyArray() {\n" +
" declare -a options\n" +
" options=(\"$@\")\n" +
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/picocli/AutoCompleteTest.java
Expand Up @@ -765,7 +765,7 @@ private String expectedCompletionScriptForAutoCompleteApp() {
"# Example usage:\n" +
"# local options=(\"foo\", \"bar\", \"baz\")\n" +
"# local IFS=$'\\n'\n" +
"# COMPREPLY=$(compReplyArray \"${options[@]}\")\n" +
"# COMPREPLY=($(compReplyArray \"${options[@]}\"))\n" +
"function compReplyArray() {\n" +
" declare -a options\n" +
" options=(\"$@\")\n" +
Expand Down Expand Up @@ -1018,7 +1018,7 @@ private String expectedCompletionScriptForNonDefault() {
"# Example usage:\n" +
"# local options=(\"foo\", \"bar\", \"baz\")\n" +
"# local IFS=$'\\n'\n" +
"# COMPREPLY=$(compReplyArray \"${options[@]}\")\n" +
"# COMPREPLY=($(compReplyArray \"${options[@]}\"))\n" +
"function compReplyArray() {\n" +
" declare -a options\n" +
" options=(\"$@\")\n" +
Expand Down Expand Up @@ -1619,7 +1619,7 @@ private String getCompletionScriptText(String cmdName) {
"# Example usage:\n" +
"# local options=(\"foo\", \"bar\", \"baz\")\n" +
"# local IFS=$'\\n'\n" +
"# COMPREPLY=$(compReplyArray \"${options[@]}\")\n" +
"# COMPREPLY=($(compReplyArray \"${options[@]}\"))\n" +
"function compReplyArray() {\n" +
" declare -a options\n" +
" options=(\"$@\")\n" +
Expand Down Expand Up @@ -1866,7 +1866,7 @@ private String getCompletionScriptTextWithHidden(String commandName) {
"# Example usage:\n" +
"# local options=(\"foo\", \"bar\", \"baz\")\n" +
"# local IFS=$'\\n'\n" +
"# COMPREPLY=$(compReplyArray \"${options[@]}\")\n" +
"# COMPREPLY=($(compReplyArray \"${options[@]}\"))\n" +
"function compReplyArray() {\n" +
" declare -a options\n" +
" options=(\"$@\")\n" +
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/bashify_completion.bash
Expand Up @@ -122,7 +122,7 @@ function currentPositionalIndex() {
# Example usage:
# local options=("foo", "bar", "baz")
# local IFS=$'\n'
# COMPREPLY=$(compReplyArray "${options[@]}")
# COMPREPLY=($(compReplyArray "${options[@]}"))
function compReplyArray() {
declare -a options
options=("$@")
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/basic.bash
Expand Up @@ -122,7 +122,7 @@ function currentPositionalIndex() {
# Example usage:
# local options=("foo", "bar", "baz")
# local IFS=$'\n'
# COMPREPLY=$(compReplyArray "${options[@]}")
# COMPREPLY=($(compReplyArray "${options[@]}"))
function compReplyArray() {
declare -a options
options=("$@")
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/hyphenated_completion.bash
Expand Up @@ -122,7 +122,7 @@ function currentPositionalIndex() {
# Example usage:
# local options=("foo", "bar", "baz")
# local IFS=$'\n'
# COMPREPLY=$(compReplyArray "${options[@]}")
# COMPREPLY=($(compReplyArray "${options[@]}"))
function compReplyArray() {
declare -a options
options=("$@")
Expand Down
Expand Up @@ -122,7 +122,7 @@ function currentPositionalIndex() {
# Example usage:
# local options=("foo", "bar", "baz")
# local IFS=$'\n'
# COMPREPLY=$(compReplyArray "${options[@]}")
# COMPREPLY=($(compReplyArray "${options[@]}"))
function compReplyArray() {
declare -a options
options=("$@")
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/picocompletion-demo_completion.bash
Expand Up @@ -122,7 +122,7 @@ function currentPositionalIndex() {
# Example usage:
# local options=("foo", "bar", "baz")
# local IFS=$'\n'
# COMPREPLY=$(compReplyArray "${options[@]}")
# COMPREPLY=($(compReplyArray "${options[@]}"))
function compReplyArray() {
declare -a options
options=("$@")
Expand Down

0 comments on commit 99d87dc

Please sign in to comment.