Skip to content

Commit 04f1a4c

Browse files
committed
Adding bash completion for create and run
Signed-off-by: rajasec <[email protected]>
1 parent 99c683a commit 04f1a4c

File tree

1 file changed

+62
-1
lines changed
  • contrib/completions/bash

1 file changed

+62
-1
lines changed

contrib/completions/bash/runc

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,14 @@ _runc_spec() {
430430
esac
431431
}
432432

433-
_runc_start() {
433+
_runc_run() {
434434
local boolean_options="
435435
--help
436436
--detatch
437437
-d
438438
--no-subreaper
439439
--no-pivot
440+
--no-new-keyring
440441
"
441442

442443
local options_with_args="
@@ -534,6 +535,49 @@ _runc_checkpoint() {
534535
;;
535536
esac
536537
}
538+
_runc_create() {
539+
local boolean_options="
540+
--help
541+
--no-pivot
542+
--no-new-keyring
543+
"
544+
545+
local options_with_args="
546+
--bundle
547+
-b
548+
--console
549+
--pid-file
550+
"
551+
case "$prev" in
552+
--bundle|-b|--console|--pid-file)
553+
case "$cur" in
554+
'')
555+
COMPREPLY=( $( compgen -W '/' -- "$cur" ) )
556+
__runc_nospace
557+
;;
558+
/*)
559+
_filedir
560+
__runc_nospace
561+
;;
562+
esac
563+
return
564+
;;
565+
566+
$(__runc_to_extglob "$options_with_args"))
567+
return
568+
;;
569+
esac
570+
571+
case "$cur" in
572+
-*)
573+
COMPREPLY=( $( compgen -W "$boolean_options $options_with_args" -- "$cur" ) )
574+
;;
575+
*)
576+
__runc_list_all
577+
;;
578+
esac
579+
580+
}
537581

538582
_runc_help() {
539583
local counter=$(__runc_pos_first_nonflag)
@@ -635,6 +679,21 @@ _runc_state() {
635679
;;
636680
esac
637681
}
682+
_runc_start() {
683+
local boolean_options="
684+
--help
685+
-h
686+
"
687+
688+
case "$cur" in
689+
-*)
690+
COMPREPLY=( $( compgen -W "$boolean_options $options_with_args" -- "$cur" ) )
691+
;;
692+
*)
693+
__runc_list_all
694+
;;
695+
esac
696+
}
638697
_runc_update() {
639698
local boolean_options="
640699
--help
@@ -677,6 +736,7 @@ _runc() {
677736

678737
local commands=(
679738
checkpoint
739+
create
680740
delete
681741
events
682742
exec
@@ -686,6 +746,7 @@ _runc() {
686746
pause
687747
restore
688748
resume
749+
run
689750
spec
690751
start
691752
state

0 commit comments

Comments
 (0)