1
0
mirror of https://github.com/projectatomic/atomic.git synced 2026-02-05 18:45:01 +01:00

Fix up atomic trust completions

Closes: #627
Approved by: rhatdan
This commit is contained in:
Dan Walsh
2016-09-17 05:44:25 -04:00
committed by Atomic Bot
parent b1bf836943
commit 9350770c33
2 changed files with 86 additions and 27 deletions

View File

@@ -30,10 +30,10 @@ def cli(subparser):
"File(s) must exist before using this command. "
"Default directory is %s" % pubkeys_dir))
commonp.add_argument("--sigstoretype", dest="sigstoretype", default="web",
choices=['local', 'web', 'atomic'],
choices=['atomic', 'local', 'web'],
help=sigstore_help)
commonp.add_argument("-t", "--type", dest="trust_type", default="signedBy",
choices=['signedBy', 'insecureAcceptAnything', 'reject'],
choices=['insecureAcceptAnything', 'reject', 'signedBy'],
help="Trust type (default: signedBy)")
commonp.add_argument("--keytype", dest="keytype", default="GPGKeys",
help="Public key type (default: GPGKeys)")
@@ -57,7 +57,7 @@ def cli(subparser):
deletep.add_argument("registry",
help=registry_help)
deletep.add_argument("--sigstoretype", dest="sigstoretype", default="web",
choices=['local', 'web', 'atomic'],
choices=['atomic', 'local', 'web'],
help=sigstore_help)
deletep.set_defaults(_class=Trust, func="delete")

View File

@@ -397,14 +397,14 @@ _atomic_containers_list() {
_atomic_containers_trim() {
local all_options="
--help
"
--help
"
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "$all_options" -- "$cur" ) )
;;
esac
-*)
COMPREPLY=( $( compgen -W "$all_options" -- "$cur" ) )
;;
esac
}
_atomic_update() {
@@ -674,29 +674,88 @@ _atomic_trust() {
return 0
}
_atomic_trust_default() {
local subcommands="
accept
reject
"
local all_options="$options_with_args
--help -h
"
local options_with_args_glob=$(__atomic_to_extglob "$options_with_args")
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "$all_options" -- "$cur" ) )
;;
*)
COMPREPLY=( $( compgen -W "$subcommands" -- "$cur" ) )
;;
esac
}
_atomic_trust_add() {
local options_with_args="
--pubkeys -k
--sigstoretype
--type -t
--keytype
--sigstore -s
--pubkeys -k
--sigstoretype
--type -t
--keytype
--sigstore -s
"
local all_options="$options_with_args
--help -h
"
local all_options="$options_with_args
--help -h
"
local options_with_args_glob=$(__atomic_to_extglob "$options_with_args")
local options_with_args_glob=$(__atomic_to_extglob "$options_with_args")
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "$all_options" -- "$cur" ) )
;;
*)
local counter=$( __atomic_pos_first_nonflag $( __atomic_to_alternatives "$options_with_args" ) )
;;
case "$prev" in
--keytype)
COMPREPLY=( $( compgen -W "GPGKeys" -- "$cur" ) )
;;
--sigstoretype)
COMPREPLY=( $( compgen -W "atomic local web" -- "$cur" ) )
;;
--type|-t)
COMPREPLY=( $( compgen -W "signedBy insecureAcceptAnything reject" -- "$cur" ) )
;;
esac
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "$all_options" -- "$cur" ) )
;;
*)
local counter=$( __atomic_pos_first_nonflag $( __atomic_to_alternatives "$options_with_args" ) )
;;
esac
}
_atomic_trust_delete() {
local options_with_args="
--sigstoretype
"
local all_options="$options_with_args
--help -h
"
local options_with_args_glob=$(__atomic_to_extglob "$options_with_args")
case "$prev" in
--sigstoretype)
COMPREPLY=( $( compgen -W "atomic local web" -- "$cur" ) )
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "$all_options" -- "$cur" ) )
;;
*)
local counter=$( __atomic_pos_first_nonflag $( __atomic_to_alternatives "$options_with_args" ) )
;;
esac
}
_atomic_mount() {
@@ -1151,7 +1210,7 @@ _atomic() {
sign
stop
top
trust
trust
verify
version
uninstall