diff options
author | Dan Nicholson <nicholson@endlessm.com> | 2019-08-13 10:10:50 -0600 |
---|---|---|
committer | Dan Nicholson <dbn@endlessos.org> | 2021-07-15 15:50:04 -0600 |
commit | 74fb0c5f7826e90efcc905ba75cf8a176d61f0a5 (patch) | |
tree | 44e9c64d6e7343669dca6376897c7786786b0e77 /bash/ostree | |
parent | a50f6d0b9fa1d3079ff5bf78e46da3a635a37611 (diff) | |
download | ostree-74fb0c5f7826e90efcc905ba75cf8a176d61f0a5.tar.gz |
bin/remote: Add list-gpg-keys subcommand
This provides a wrapper for the `ostree_repo_remote_get_gpg_keys`
function to show the GPG keys associated with a remote. This is
particularly useful for validating that GPG key updates have been
applied. Tests are added, which checks the
`ostree_repo_remote_get_gpg_keys` API by extension.
Diffstat (limited to 'bash/ostree')
-rw-r--r-- | bash/ostree | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/bash/ostree b/bash/ostree index d1de8530..32d5e317 100644 --- a/bash/ostree +++ b/bash/ostree @@ -1235,6 +1235,40 @@ _ostree_remote_list_cookies() { return 0 } +_ostree_remote_list_gpg_keys() { + local boolean_options=" + $main_boolean_options + " + + local options_with_args=" + --repo + " + + local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) + + case "$prev" in + --repo) + __ostree_compreply_dirs_only + return 0 + ;; + esac + + case "$cur" in + -*) + local all_options="$boolean_options $options_with_args" + __ostree_compreply_all_options + ;; + *) + local argpos=$( __ostree_pos_first_nonflag $( __ostree_to_alternatives "$options_with_args" ) ) + + if [ $cword -eq $argpos ]; then + __ostree_compreply_remotes + fi + esac + + return 0 +} + _ostree_remote_refs() { local boolean_options=" $main_boolean_options @@ -1349,6 +1383,7 @@ _ostree_remote() { gpg-import list list-cookies + list-gpg-keys refs show-url summary |