You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f4e8ea6
Browse filesBrowse the repository at this point in the historyBrowse files
echo$' # Completing an option: offer everything (including options)'
22
+
echo$' echo "$words"'
23
+
echo$''
24
+
echo$' else'
25
+
echo$' # Completing a non-option: offer only non-options,'
26
+
echo$' # and don\'t re-offer ones already used earlier in the line.'
27
+
echo$' for word in $words; do'
26
28
echo$' [[ "${word:0:1}" == "-" ]] && continue'
27
29
echo$''
30
+
echo$' local seen=0'
28
31
echo$' for u in "${used[@]}"; do'
29
32
echo$' if [[ "$u" == "$word" ]]; then'
30
-
echo$' continue 2'
33
+
echo$' seen=1'
34
+
echo$' break'
31
35
echo$' fi'
32
36
echo$' done'
33
-
echo$' fi'
34
-
echo$''
35
-
echo$' # compgen -W expects shell-escaped words in one space-delimited string.'
36
-
echo$' printf -v word \'%q\' "$word"'
37
-
echo$' result+=("$word")'
38
-
echo$' done'
37
+
echo$' ((!seen)) && result+=("$word")'
38
+
echo$' done'
39
39
echo$''
40
-
echo$' echo "${result[*]}"'
40
+
echo$' echo "${result[*]}"'
41
+
echo$' fi'
41
42
echo$'}'
42
43
echo$''
43
44
echo$'_cli_completions() {'
@@ -52,51 +53,55 @@ send_completions() {
52
53
echo$''
53
54
echo$' case "$compline" in'
54
55
echo$'\'download\'*\'--handler\')'
55
-
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_cli_completions_filter "curl" "wget")" -- "$cur")'
56
+
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_cli_completions_filter "curlwget")" -- "$cur")'
56
57
echo$' ;;'
57
58
echo$''
58
59
echo$'\'upload\'*\'--user\')'
59
60
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A user -- "$cur")'
60
61
echo$' ;;'
61
62
echo$''
62
63
echo$'\'completions\'*)'
63
-
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_cli_completions_filter "--help" "-h")" -- "$cur")'
64
+
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_cli_completions_filter "--help-h")" -- "$cur")'
64
65
echo$' ;;'
65
66
echo$''
66
67
echo$'\'d\'*\'--handler\')'
67
-
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_cli_completions_filter "curl" "wget")" -- "$cur")'
68
+
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_cli_completions_filter "curlwget")" -- "$cur")'
68
69
echo$' ;;'
69
70
echo$''
70
71
echo$'\'upload\'*\'-u\')'
71
72
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A user -- "$cur")'
72
73
echo$' ;;'
73
74
echo$''
74
75
echo$'\'download\'*)'
75
-
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A file -W "$(_cli_completions_filter "--force" "--handler" "--help" "-f" "-h")" -- "$cur")'
76
+
echo$' compopt -o filenames 2>/dev/null'
77
+
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A file -W "$(_cli_completions_filter "--force --handler --help -f -h")" -- "$cur")'
76
78
echo$' ;;'
77
79
echo$''
78
80
echo$'\'u\'*\'--user\')'
79
81
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A user -- "$cur")'
80
82
echo$' ;;'
81
83
echo$''
82
84
echo$'\'upload\'*)'
83
-
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -A user -W "$(_cli_completions_filter "--help" "--password" "--user" "-h" "-p" "-u" "CHANGELOG.md" "README.md")" -- "$cur")'
85
+
echo$' compopt -o filenames 2>/dev/null'
86
+
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -A user -W "$(_cli_completions_filter "--help --password --user -h -p -u CHANGELOG.md README.md")" -- "$cur")'
84
87
echo$' ;;'
85
88
echo$''
86
89
echo$'\'u\'*\'-u\')'
87
90
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A user -- "$cur")'
88
91
echo$' ;;'
89
92
echo$''
90
93
echo$'\'d\'*)'
91
-
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A file -W "$(_cli_completions_filter "--force" "--handler" "--help" "-f" "-h")" -- "$cur")'
94
+
echo$' compopt -o filenames 2>/dev/null'
95
+
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A file -W "$(_cli_completions_filter "--force --handler --help -f -h")" -- "$cur")'
92
96
echo$' ;;'
93
97
echo$''
94
98
echo$'\'u\'*)'
95
-
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -A user -W "$(_cli_completions_filter "--help" "--password" "--user" "-h" "-p" "-u" "CHANGELOG.md" "README.md")" -- "$cur")'
99
+
echo$' compopt -o filenames 2>/dev/null'
100
+
echo$' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -A user -W "$(_cli_completions_filter "--help --password --user -h -p -u CHANGELOG.md README.md")" -- "$cur")'
0 commit comments