Skip to content

Commit

Permalink
Merge pull request opencontainers#2075 from KentaTada/fix-bash-comple…
Browse files Browse the repository at this point in the history
…tion

Update bash completion for v1.0.0 release
  • Loading branch information
crosbymichael committed Jun 26, 2019
2 parents f4982d8 + 371d13c commit 6cccc17
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions contrib/completions/bash/runc
Expand Up @@ -159,15 +159,17 @@ _runc_exec() {
"

local options_with_args="
--console
--console-socket
--cwd
--env, -e
--user, -u
--additional-gids, -g
--process, -p
--pid-file
--process-label
--apparmor
--cap, -c
--preserve-fds
"

local all_options="$options_with_args $boolean_options"
Expand All @@ -178,7 +180,7 @@ _runc_exec() {
return
;;

--console | --cwd | --process | --apparmor)
--console-socket | --cwd | --process | --apparmor)
case "$cur" in
*:*) ;; # TODO somehow do _filedir for stuff inside the image, if it's already specified (which is also somewhat difficult to determine)
'')
Expand Down Expand Up @@ -225,6 +227,7 @@ _runc_runc() {
--log-format
--root
--criu
--rootless
"

case "$prev" in
Expand Down Expand Up @@ -287,6 +290,9 @@ _runc_ps() {
--help
-h
"
local options_with_args="
--format, -f
"

case "$cur" in
-*)
Expand All @@ -302,6 +308,7 @@ _runc_delete() {
local boolean_options="
--help
-h
--format, -f
"

case "$cur" in
Expand Down Expand Up @@ -404,6 +411,7 @@ _runc_list() {
_runc_spec() {
local boolean_options="
--help
--rootless
"

local options_with_args="
Expand Down Expand Up @@ -454,12 +462,13 @@ _runc_run() {
local options_with_args="
--bundle
-b
--console
--console-socket
--pid-file
--preserve-fds
"

case "$prev" in
--bundle | -b | --console | --pid-file)
--bundle | -b | --console-socket | --pid-file)
case "$cur" in
'')
COMPREPLY=($(compgen -W '/' -- "$cur"))
Expand Down Expand Up @@ -496,14 +505,20 @@ _runc_checkpoint() {
--tcp-established
--ext-unix-sk
--shell-job
--lazy-pages
--file-locks
--pre-dump
--auto-dedup
"

local options_with_args="
--image-path
--work-path
--parent-path
--status-fd
--page-server
--manage-cgroups-mode
--empty-ns
"

case "$prev" in
Expand All @@ -514,7 +529,7 @@ _runc_checkpoint() {
return
;;

--image-path | --work-path)
--image-path | --work-path | --parent-path)
case "$cur" in
*:*) ;; # TODO somehow do _filedir for stuff inside the image, if it's already specified (which is also somewhat difficult to determine)
'')
Expand Down Expand Up @@ -553,11 +568,12 @@ _runc_create() {
local options_with_args="
--bundle
-b
--console
--console-socket
--pid-file
--preserve-fds
"
case "$prev" in
--bundle | -b | --console | --pid-file)
--bundle | -b | --console-socket | --pid-file)
case "$cur" in
'')
COMPREPLY=($(compgen -W '/' -- "$cur"))
Expand Down Expand Up @@ -605,6 +621,8 @@ _runc_restore() {
-d
--no-subreaper
--no-pivot
--auto-dedup
--lazy-pages
"

local options_with_args="
Expand All @@ -614,6 +632,7 @@ _runc_restore() {
--work-path
--manage-cgroups-mode
--pid-file
--empty-ns
"

local all_options="$options_with_args $boolean_options"
Expand Down Expand Up @@ -719,7 +738,9 @@ _runc_update() {
--memory
--memory-reservation
--memory-swap
--pids-limit
--l3-cache-schema
--mem-bw-schema
"

case "$prev" in
Expand Down

0 comments on commit 6cccc17

Please sign in to comment.