Adding bash completion for create and run

Signed-off-by: rajasec <rajasec79@gmail.com>
This commit is contained in:
rajasec 2016-09-08 12:14:42 +05:30
parent 99c683a84f
commit 04f1a4cc98
1 changed files with 62 additions and 1 deletions

View File

@ -430,13 +430,14 @@ _runc_spec() {
esac esac
} }
_runc_start() { _runc_run() {
local boolean_options=" local boolean_options="
--help --help
--detatch --detatch
-d -d
--no-subreaper --no-subreaper
--no-pivot --no-pivot
--no-new-keyring
" "
local options_with_args=" local options_with_args="
@ -534,6 +535,49 @@ _runc_checkpoint() {
;; ;;
esac esac
} }
_runc_create() {
local boolean_options="
--help
--no-pivot
--no-new-keyring
"
local options_with_args="
--bundle
-b
--console
--pid-file
"
case "$prev" in
--bundle|-b|--console|--pid-file)
case "$cur" in
'')
COMPREPLY=( $( compgen -W '/' -- "$cur" ) )
__runc_nospace
;;
/*)
_filedir
__runc_nospace
;;
esac
return
;;
$(__runc_to_extglob "$options_with_args"))
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "$boolean_options $options_with_args" -- "$cur" ) )
;;
*)
__runc_list_all
;;
esac
}
_runc_help() { _runc_help() {
local counter=$(__runc_pos_first_nonflag) local counter=$(__runc_pos_first_nonflag)
@ -635,6 +679,21 @@ _runc_state() {
;; ;;
esac esac
} }
_runc_start() {
local boolean_options="
--help
-h
"
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "$boolean_options $options_with_args" -- "$cur" ) )
;;
*)
__runc_list_all
;;
esac
}
_runc_update() { _runc_update() {
local boolean_options=" local boolean_options="
--help --help
@ -677,6 +736,7 @@ _runc() {
local commands=( local commands=(
checkpoint checkpoint
create
delete delete
events events
exec exec
@ -686,6 +746,7 @@ _runc() {
pause pause
restore restore
resume resume
run
spec spec
start start
state state