mirror of
https://github.com/ostreedev/ostree.git
synced 2024-12-21 13:34:34 +03:00
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
This commit is contained in:
parent
7f88fddcd4
commit
ee1f6b2315
497
bash/ostree
497
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
|
||||
|
@ -30,11 +30,6 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-cleanup.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ NULL }
|
||||
};
|
||||
|
@ -45,11 +45,6 @@ static char *opt_osname;
|
||||
static char *opt_origin_path;
|
||||
static gboolean opt_kernel_arg_none;
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-deploy.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "os", 0, 0, G_OPTION_ARG_STRING, &opt_osname, "Use a different operating system root than the current one", "OSNAME" },
|
||||
{ "origin-file", 0, 0, G_OPTION_ARG_FILENAME, &opt_origin_path, "Specify origin file", "FILENAME" },
|
||||
|
@ -32,11 +32,6 @@
|
||||
|
||||
static char *opt_osname;
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-config-diff.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "os", 0, 0, G_OPTION_ARG_STRING, &opt_osname, "Use a different operating system root than the current one", "OSNAME" },
|
||||
{ NULL }
|
||||
|
@ -30,11 +30,6 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-init-fs.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ NULL }
|
||||
};
|
||||
|
@ -30,11 +30,6 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-os-init.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ NULL }
|
||||
};
|
||||
|
@ -29,11 +29,6 @@
|
||||
#include "ostree.h"
|
||||
#include "otutil.h"
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-pin.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static gboolean opt_unpin;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
|
@ -35,11 +35,6 @@
|
||||
static int opt_index = -1;
|
||||
static char **opt_set;
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-set-origin.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "set", 's', 0, G_OPTION_ARG_STRING_ARRAY, &opt_set, "Set config option KEY=VALUE for remote", "KEY=VALUE" },
|
||||
{ "index", 0, 0, G_OPTION_ARG_INT, &opt_index, "Operate on the deployment INDEX, starting from zero", "INDEX" },
|
||||
|
@ -30,11 +30,6 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-status.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ NULL }
|
||||
};
|
||||
|
@ -34,11 +34,6 @@
|
||||
static gboolean opt_reboot;
|
||||
static char *opt_osname;
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-switch.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "reboot", 'r', 0, G_OPTION_ARG_NONE, &opt_reboot, "Reboot after switching trees", NULL },
|
||||
{ "os", 0, 0, G_OPTION_ARG_STRING, &opt_osname, "Use a different operating system root than the current one", "OSNAME" },
|
||||
|
@ -29,11 +29,6 @@
|
||||
#include "ostree.h"
|
||||
#include "otutil.h"
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-undeploy.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ NULL }
|
||||
};
|
||||
|
@ -34,11 +34,6 @@
|
||||
|
||||
static gboolean opt_hotfix;
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-unlock.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "hotfix", 0, 0, G_OPTION_ARG_NONE, &opt_hotfix, "Retain changes across reboots", NULL },
|
||||
{ NULL }
|
||||
|
@ -40,11 +40,6 @@ static gboolean opt_deploy_only;
|
||||
static char *opt_osname;
|
||||
static char *opt_override_commit;
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-upgrade.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "os", 0, 0, G_OPTION_ARG_STRING, &opt_osname, "Use a different operating system root than the current one", "OSNAME" },
|
||||
{ "reboot", 'r', 0, G_OPTION_ARG_NONE, &opt_reboot, "Reboot after a successful upgrade", NULL },
|
||||
|
@ -28,11 +28,6 @@
|
||||
|
||||
#include "otutil.h"
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-instutil.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ NULL }
|
||||
};
|
||||
|
@ -173,11 +173,6 @@ selinux_relabel_dir (OstreeSePolicy *sepolicy,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-instutil.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ NULL }
|
||||
};
|
||||
|
@ -34,11 +34,6 @@ static gboolean opt_merge;
|
||||
static char **opt_replace;
|
||||
static char **opt_append;
|
||||
|
||||
/* ATTENTION:
|
||||
* Please remember to update the bash-completion script (bash/ostree) and
|
||||
* man page (man/ostree-admin-instutil.xml) when changing the option list.
|
||||
*/
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "import-proc-cmdline", 0, 0, G_OPTION_ARG_NONE, &opt_proc_cmdline, "Import current /proc/cmdline", NULL },
|
||||
{ "merge", 0, 0, G_OPTION_ARG_NONE, &opt_merge, "Merge with previous command line", NULL },
|
||||
|
Loading…
Reference in New Issue
Block a user