Skip to content

Commit 2ea812f

Browse files
committed
refactor: use _comp_compgen for COMPREPLY=($(IFS=... compgen ...))
1 parent 0189d09 commit 2ea812f

File tree

5 files changed

+5
-11
lines changed

5 files changed

+5
-11
lines changed

completions/carton

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ _comp_cmd_carton__commands()
44
{
55
local cmds=$("${1:-carton}" usage 2>&1 |
66
command sed -ne '/.*command.* is one of/{n;p;q;}')
7-
COMPREPLY+=($(IFS=$' \t\n,' compgen -W "$cmds" -- "$cur"))
7+
_comp_compgen -aF $' \t\n,' -- -W "$cmds"
88
}
99

1010
_comp_cmd_carton__command_help()

completions/dmypy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ _comp_cmd_dmypy()
4040
local cmds=$("$1" --help 2>&1 |
4141
command sed -ne '/positional arguments/{p;n;p;q;}' |
4242
command sed -ne 's/{\(.*\)}/\1/p')
43-
COMPREPLY=($(IFS="," compgen -W '$cmds' -- "$cur"))
43+
_comp_compgen -F , -- -W '$cmds'
4444
return
4545
fi
4646
} &&

completions/gssdp-discover

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ _comp_cmd_gssdp_discover()
1717
[[ $1 == *gssdp-discover ]] || return
1818
local types=$("$1" --help 2>&1 |
1919
command sed -ne 's/^.*--message-type=.*(\([^)]*\))$/\1/p')
20-
COMPREPLY=($(
21-
IFS=$' \t\n,'
22-
compgen -W "$types" -- "$cur"
23-
))
20+
_comp_compgen -F $' \t\n,' -- -W "$types"
2421
return
2522
;;
2623
esac

completions/influx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ _comp_cmd_influx()
1515
;;
1616
-format | -precision | -consistency)
1717
local args=$("$1" --help 2>&1 | awk "\$1 == \"$prev\" { print \$2 }")
18-
COMPREPLY=($(
19-
IFS=$' \t\n'"\"'|"
20-
compgen -W "$args" -- "$cur"
21-
))
18+
_comp_compgen -F $' \t\n'"\"'|" -- -W "$args"
2219
return
2320
;;
2421
-import | -path)

completions/valgrind

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ _comp_cmd_valgrind()
9090
# "yes", "yes|no", etc (but not "string", "STR",
9191
# "hint1,hint2,...")
9292
yes | +([-a-z0-9])\|+([-a-z0-9\|]))
93-
COMPREPLY=($(IFS='|' compgen -W '$value' -- "$cur"))
93+
_comp_compgen -F '|' -- -W '$value'
9494
return
9595
;;
9696
esac

0 commit comments

Comments
 (0)