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 <edenisfa@gmail.com>
} &&
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=()
return
;;
-m )
- # @TODO: ^[ugb]:[0-9]+:[0-9]+(:[0-9]+)?$
+ # ^[ugb]:[0-9]+:[0-9]+(:[0-9]+)?$
+ __lxc_id_mapping
return
;;
-s )
if [[ ${cur} == -* ]]; then
COMPREPLY=( $( compgen -W '-h -m -s' -- "${cur}" ) )
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
- return
fi
} &&
complete -F _lxc_usernsexec lxc-usernsexec