also updates setup.py
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
install/lnst-pool-wizard.bash | 36 ++++++++++++++++++++++++++++++++++++
setup.py | 3 ++-
2 files changed, 38 insertions(+), 1 deletion(-)
create mode 100644 install/lnst-pool-wizard.bash
diff --git a/install/lnst-pool-wizard.bash b/install/lnst-pool-wizard.bash
new file mode 100644
index 0000000..599b6fa
--- /dev/null
+++ b/install/lnst-pool-wizard.bash
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# Bash completion script for lnst-pool-wizard command
+# Author: Jiri Prochazka <jprochaz(a)redhat.com>
+
+_lnst_pool_wizard()
+{
+ local SHORT_OPTS="-h -i -n -v"
+ local LONG_OPTS="--help --interactive --noninteractive --virtual"
+ local REQUIRE_ARG="-p --pool_dir"
+
+ local cur=${COMP_WORDS[COMP_CWORD]}
+ local prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ case "$prev" in
+ -p|--pool_dir)
+ _filedir
+ return 0
+ ;;
+ esac
+
+ # Complete long and shor options
+ if [[ "$cur" == --* ]]; then
+ COMPREPLY=( $(compgen -W "$LONG_OPTS" -- $cur) )
+ [ ${#COMPREPLY[@]} = 1 ] && COMPREPLY=$(printf %q%s
"$COMPREPLY" " ")
+ return 0
+ elif [[ "$cur" == -* ]]; then
+ COMPREPLY=( $(compgen -W "$SHORT_OPTS" -- $cur) )
+ [ ${#COMPREPLY[@]} = 1 ] && COMPREPLY=$(printf %q%s
"$COMPREPLY" " ")
+ return 0
+ fi
+
+ return 0
+}
+
+complete -o nospace -F _lnst_pool_wizard lnst-pool-wizard
diff --git a/setup.py b/setup.py
index 628ac1f..9eac0c9 100755
--- a/setup.py
+++ b/setup.py
@@ -165,7 +165,8 @@ MAN_PAGES = [(MAN_DIR, ["install/lnst-ctl.1.gz",
"install/lnst-slave.1.gz"])]
CONFIG = [(CONF_DIR, ["install/lnst-ctl.conf",
"install/lnst-slave.conf"])]
BASH_COMP = [(BASH_COMP_DIR, ["install/lnst-ctl.bash",
- "install/lnst-slave.bash"])]
+ "install/lnst-slave.bash",
+ "install/lnst-pool-wizard.bash"])]
SCHEMAS = [(CTL_RESOURCE_DIR, ["schema-recipe.rng",
"schema-sm.rng"])]
--
2.4.3