From ee1f6b23153fea4324b9bdf6de417863931b6aa1 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 26 Feb 2018 14:11:00 -0500 Subject: bash-completion: Remove `admin` completions The `admin` commandline should be considered a demo; I just added the `pin` command *mostly* so we could use it for unit tests, although I can imagine other people using it. But maintaining completions is a lot of overhead right now, let's not do it for `admin`. The other command line options that operate on repos we will definitely maintain since they're used in releng contexts. Closes: #1468 Approved by: jlebon --- bash/ostree | 497 ------------------------------------------------------------ 1 file changed, 497 deletions(-) (limited to 'bash/ostree') diff --git a/bash/ostree b/bash/ostree index edef6cff..218e4254 100644 --- a/bash/ostree +++ b/bash/ostree @@ -180,503 +180,6 @@ _ostree_ostree() { return 0 } -_ostree_admin_cleanup() { - local boolean_options=" - $main_boolean_options - " - - local options_with_args=" - --sysroot - " - - local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) - - case "$prev" in - --sysroot) - __ostree_compreply_dirs_only - return 0 - ;; - $options_with_args_glob ) - return 0 - ;; - esac - - case "$cur" in - -*) - local all_options="$boolean_options $options_with_args" - __ostree_compreply_all_options - ;; - esac - - return 0 -} - -_ostree_admin_config_diff() { - local boolean_options=" - $main_boolean_options - " - - local options_with_args=" - --os - --sysroot - " - - local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) - - case "$prev" in - --os) - __ostree_compreply_oses - return 0 - ;; - --sysroot) - __ostree_compreply_dirs_only - return 0 - ;; - $options_with_args_glob ) - return 0 - ;; - esac - - case "$cur" in - -*) - local all_options="$boolean_options $options_with_args" - __ostree_compreply_all_options - ;; - esac - - return 0 -} - -_ostree_admin_deploy() { - local boolean_options=" - $main_boolean_options - --retain - --retain-pending - --retain-rollback - --not-as-default - --karg-proc-cmdline - " - - local options_with_args=" - --karg - --karg-append - --origin-file - --os - --sysroot - " - - local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) - - case "$prev" in - --origin-file) - __ostree_compreply_all_files - return 0 - ;; - --os) - __ostree_compreply_oses - return 0 - ;; - --sysroot) - __ostree_compreply_dirs_only - return 0 - ;; - $options_with_args_glob ) - return 0 - ;; - esac - - case "$cur" in - -*) - local all_options="$boolean_options $options_with_args" - __ostree_compreply_all_options - ;; - esac - - return 0 -} - -_ostree_admin_init_fs() { - local boolean_options=" - $main_boolean_options - " - - local options_with_args=" - --sysroot - " - - local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) - - case "$prev" in - --sysroot) - __ostree_compreply_dirs_only - return 0 - ;; - $options_with_args_glob ) - return 0 - ;; - esac - - case "$cur" in - -*) - local all_options="$boolean_options $options_with_args" - __ostree_compreply_all_options - ;; - esac - - return 0 -} - -_ostree_admin_instutil() { - local boolean_options=" - $main_boolean_options - " - - local options_with_args=" - --sysroot - " - - local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) - - case "$prev" in - --sysroot) - __ostree_compreply_dirs_only - return 0 - ;; - $options_with_args_glob ) - 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 - local instutil_commands=" - grub2-generate - selinux-ensure-labeled - set-kargs - " - COMPREPLY=( $( compgen -W "$instutil_commands" -- "$cur" ) ) - fi - ;; - esac - - return 0 -} - -_ostree_admin_os_init() { - local boolean_options=" - $main_boolean_options - " - - local options_with_args=" - --sysroot - " - - local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) - - case "$prev" in - --sysroot) - __ostree_compreply_dirs_only - return 0 - ;; - $options_with_args_glob ) - return 0 - ;; - esac - - case "$cur" in - -*) - local all_options="$boolean_options $options_with_args" - __ostree_compreply_all_options - ;; - esac - - return 0 -} - -_ostree_admin_pin() { - local boolean_options=" - $main_boolean_options - " - - local options_with_args=" - --sysroot - " - - local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) - - case "$prev" in - --sysroot) - __ostree_compreply_dirs_only - return 0 - ;; - $options_with_args_glob ) - return 0 - ;; - esac - - case "$cur" in - -*) - local all_options="$boolean_options $options_with_args" - __ostree_compreply_all_options - ;; - esac - - return 0 -} - -_ostree_admin_set_origin() { - local boolean_options=" - $main_boolean_options - " - - local options_with_args=" - --index - --set -s - --sysroot - " - - local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) - - case "$prev" in - --sysroot) - __ostree_compreply_dirs_only - return 0 - ;; - $options_with_args_glob ) - 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_admin_status() { - local boolean_options=" - $main_boolean_options - " - - local options_with_args=" - --sysroot - " - - local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) - - case "$prev" in - --sysroot) - __ostree_compreply_dirs_only - return 0 - ;; - $options_with_args_glob ) - return 0 - ;; - esac - - case "$cur" in - -*) - local all_options="$boolean_options $options_with_args" - __ostree_compreply_all_options - ;; - esac - - return 0 -} - -_ostree_admin_switch() { - local boolean_options=" - $main_boolean_options - " - - local options_with_args=" - --os - --reboot -r - --sysroot - " - - local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) - - case "$prev" in - --os) - __ostree_compreply_oses - return 0 - ;; - --sysroot) - __ostree_compreply_dirs_only - return 0 - ;; - $options_with_args_glob ) - 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_refs - fi - esac - - return 0 -} - -_ostree_admin_undeploy() { - local boolean_options=" - $main_boolean_options - " - - local options_with_args=" - --sysroot - " - - local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) - - case "$prev" in - --sysroot) - __ostree_compreply_dirs_only - return 0 - ;; - $options_with_args_glob ) - return 0 - ;; - esac - - case "$cur" in - -*) - local all_options="$boolean_options $options_with_args" - __ostree_compreply_all_options - ;; - esac - - return 0 -} - -_ostree_admin_unlock() { - local boolean_options=" - $main_boolean_options - --hotfix - " - - local options_with_args=" - --sysroot - " - - local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) - - case "$prev" in - --sysroot) - __ostree_compreply_dirs_only - return 0 - ;; - $options_with_args_glob ) - return 0 - ;; - esac - - case "$cur" in - -*) - local all_options="$boolean_options $options_with_args" - __ostree_compreply_all_options - ;; - esac - - return 0 -} - -_ostree_admin_upgrade() { - local boolean_options=" - $main_boolean_options - --allow-downgrade - --deploy-only - --pull-only - --reboot -r - " - - local options_with_args=" - --os - --override-commit - --sysroot - " - - local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" ) - - case "$prev" in - --override-commit) - __ostree_compreply_commits - return 0 - ;; - --sysroot) - __ostree_compreply_dirs_only - return 0 - ;; - $options_with_args_glob ) - return 0 - ;; - esac - - case "$cur" in - -*) - local all_options="$boolean_options $options_with_args" - __ostree_compreply_all_options - ;; - esac - - return 0 -} - -_ostree_admin() { - local subcommands=" - cleanup - config-diff - deploy - init-fs - instutil - os-init - set-origin - status - switch - undeploy - unlock - upgrade - " - - __ostree_subcommands "$subcommands" && return 0 - - case "$cur" in - -*) - COMPREPLY=( $( compgen -W "$main_boolean_options" -- "$cur" ) ) - ;; - *) - COMPREPLY=( $( compgen -W "$subcommands" -- "$cur" ) ) - ;; - esac - - return 0 -} - _ostree_cat() { local boolean_options=" $main_boolean_options -- cgit v1.2.1