diff --git a/mi-lxc.py b/mi-lxc.py index 9dd0ff1..bef6853 100755 --- a/mi-lxc.py +++ b/mi-lxc.py @@ -568,7 +568,7 @@ def printgraph(): def usage(): print( - "No argument given, usage with create, renet, destroy, destroymaster, updatemaster, start, stop, attach [user@] [command], display [user@], print.\nNames are ", end='') + "No argument given, usage with: create, renet, destroy, destroymaster, updatemaster, start, stop, attach [user@] [command], display [user@], print.\nNames are: ", end='') print(listContainers()) def listContainers(): diff --git a/milxc-completion.bash b/milxc-completion.bash index d31cb1f..7902900 100644 --- a/milxc-completion.bash +++ b/milxc-completion.bash @@ -3,13 +3,13 @@ _milxc_completions() { if [ "${#COMP_WORDS[@]}" == "2" ]; then - COMPREPLY=($(compgen -W "$(./mi-lxc.py | grep usage | cut -d' ' -f 6- | sed 's/[,.]/ /g' | sed 's/\[[a-z@]*\]//g' | sed 's/<[a-z]*>//g')" "${COMP_WORDS[1]}")) + COMPREPLY=($(compgen -W "$(./mi-lxc.py | grep usage | cut -d':' -f 2 | sed 's/[,.]/ /g' | sed 's/\[[a-z@]*\]//g' | sed 's/<[a-z]*>//g')" "${COMP_WORDS[1]}")) # COMPREPLY=($(compgen -W "create renet destroy destroymaster updatemaster start stop attach display print" "${COMP_WORDS[1]}")) # ./mi-lxc.py | grep usage | cut -d' ' -f 6- | sed 's/, / /g' | sed 's/\[[a-z@]*\]//g' | sed 's/<[a-z]*>//g' fi if [ "${#COMP_WORDS[@]}" == "3" ]; then - COMPREPLY=($(compgen -W "$(./mi-lxc.py | grep Names | cut -d' ' -f 3- | sed 's/, / /g')" "${COMP_WORDS[2]}")) + COMPREPLY=($(compgen -W "$(./mi-lxc.py | grep Names | cut -d':' -f 2 | sed 's/, / /g')" "${COMP_WORDS[2]}")) fi