From: EdĂȘnis Freindorfer Azevedo Date: Fri, 3 Sep 2021 13:01:45 +0000 (-0300) Subject: Update `_lxc_usernsexec`. X-Git-Tag: lxc-5.0.0~91^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d36b3a3a9a5971da0cbfaba8feb6d83a43eb3644;p=thirdparty%2Flxc.git Update `_lxc_usernsexec`. Not really much can be done for this function, as `-m` requires an ID mapping that has to be manually input, since it will use `/etc/sub{g,u}id` if not specified. Signed-off-by: EdĂȘnis Freindorfer Azevedo --- diff --git a/config/bash/lxc.in b/config/bash/lxc.in index a4306b496..7254e7351 100644 --- a/config/bash/lxc.in +++ b/config/bash/lxc.in @@ -1124,6 +1124,14 @@ _lxc_update_config() { } && complete -F _lxc_update_config lxc-update-config +__lxc_id_mapping() { + local -r tmp="${cur//[^:]}" + if [[ "${#tmp}" -eq 0 ]]; then + COMPREPLY=( $( compgen -W "u: g: b:" -- "${cur}" ) ) + fi + compopt -o nospace +} + _lxc_usernsexec() { local cur prev words cword split COMPREPLY=() @@ -1139,7 +1147,8 @@ _lxc_usernsexec() { return ;; -m ) - # @TODO: ^[ugb]:[0-9]+:[0-9]+(:[0-9]+)?$ + # ^[ugb]:[0-9]+:[0-9]+(:[0-9]+)?$ + __lxc_id_mapping return ;; -s ) @@ -1152,7 +1161,6 @@ _lxc_usernsexec() { if [[ ${cur} == -* ]]; then COMPREPLY=( $( compgen -W '-h -m -s' -- "${cur}" ) ) [[ ${COMPREPLY-} == *= ]] && compopt -o nospace - return fi } && complete -F _lxc_usernsexec lxc-usernsexec