Skip to content

Commit

Permalink
Add bash completion to list backing store types for lxc-create -B
Browse files Browse the repository at this point in the history
- Backing Store types are hard-coded (Not sure how to get programmatically)
- Closes lxc#1236

Signed-off-by: Abbas Ally <abbasally5@yahoo.com>
  • Loading branch information
abbasally5 committed Dec 3, 2017
1 parent 6370793 commit caba109
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/bash/lxc.in
Expand Up @@ -11,6 +11,10 @@ _have lxc-start && {
COMPREPLY=( $( compgen -W "$(ls @LXCTEMPLATEDIR@/ | sed -e 's|^lxc-||' )" "$cur" ) )
}

_lxc_backing_stores() {
COMPREPLY=( $( compgen -W "dir lvm loop btrfs zfs rbd best" "$cur" ) )
}

_lxc_generic_n() {
local cur prev

Expand Down Expand Up @@ -59,6 +63,11 @@ _have lxc-start && {
_lxc_templates "$cur"
return 0
;;

-B)
_lxc_backing_stores "$cur"
return 0
;;
esac

return 1
Expand Down

0 comments on commit caba109

Please sign in to comment.