mirror of
https://github.com/containers/skopeo.git
synced 2025-06-27 07:07:31 +00:00
bash completion: support --opt arg completion
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
parent
a02e57dde8
commit
b31f0da5c6
@ -159,10 +159,9 @@ _skopeo_skopeo() {
|
|||||||
--version -v
|
--version -v
|
||||||
--help -h
|
--help -h
|
||||||
"
|
"
|
||||||
commands=$( "${COMP_WORDS[@]:0:$COMP_CWORD}" --generate-bash-completion )
|
|
||||||
|
|
||||||
case "$prev" in
|
case "$prev" in
|
||||||
$main_options_with_args_glob )
|
--policy|--registries.d|--override-arch|--override-os|--command-timeout)
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -172,6 +171,7 @@ _skopeo_skopeo() {
|
|||||||
COMPREPLY=( $( compgen -W "$boolean_options $options_with_args" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$boolean_options $options_with_args" -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
commands=$( "${COMP_WORDS[@]:0:$COMP_CWORD}" --generate-bash-completion )
|
||||||
COMPREPLY=( $( compgen -W "${commands[*]} help" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "${commands[*]} help" -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -189,12 +189,9 @@ _cli_bash_autocomplete() {
|
|||||||
|
|
||||||
local command=${PROG} cpos=0
|
local command=${PROG} cpos=0
|
||||||
local counter=1
|
local counter=1
|
||||||
counter=1
|
|
||||||
while [ $counter -lt "$cword" ]; do
|
while [ $counter -lt "$cword" ]; do
|
||||||
case "${words[$counter]}" in
|
case "${words[$counter]}" in
|
||||||
-*)
|
skopeo|copy|inspect|delete|manifest-digest|standalone-sign|standalone-verify|help|h)
|
||||||
;;
|
|
||||||
*)
|
|
||||||
command="${words[$counter]//-/_}"
|
command="${words[$counter]//-/_}"
|
||||||
cpos=$counter
|
cpos=$counter
|
||||||
(( cpos++ ))
|
(( cpos++ ))
|
||||||
|
Loading…
Reference in New Issue
Block a user