summaryrefslogtreecommitdiff
path: root/bash-completion/addons/bootadm
diff options
context:
space:
mode:
authorIgor Pashev <igor.pashev@nexenta.com>2013-04-05 17:24:11 +0400
committerIgor Pashev <igor.pashev@nexenta.com>2013-04-05 17:35:15 +0400
commita953cf98ab91bd09e233a2d749811b16c9465018 (patch)
tree1acf2dfa3e23937416390e886f6b51802d0a692e /bash-completion/addons/bootadm
parent721ff773924f4aa8b9af45c844371cb0e85f23ee (diff)
downloadcibs-pkgs-a953cf98ab91bd09e233a2d749811b16c9465018.tar.gz
Added bootadm, beadm, zfs, svcs, svcadm bash completions
Diffstat (limited to 'bash-completion/addons/bootadm')
-rw-r--r--bash-completion/addons/bootadm54
1 files changed, 54 insertions, 0 deletions
diff --git a/bash-completion/addons/bootadm b/bash-completion/addons/bootadm
new file mode 100644
index 0000000..89963af
--- /dev/null
+++ b/bash-completion/addons/bootadm
@@ -0,0 +1,54 @@
+_bootadm () {
+ local cur prev opts line
+ COMPREPLY=()
+
+ cur=${COMP_WORDS[COMP_CWORD]}
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ line="${COMP_LINE}"
+
+ if [[ ${COMP_CWORD} -eq 1 ]]; then
+ COMPREPLY=( $(compgen -W "update-archive list-archive set-menu list-menu" -- $cur) )
+ return
+ fi
+
+ case "$prev" in
+ -R)
+ _cd
+ return;;
+ -p)
+ COMPREPLY=( $(compgen -W "i86pc sun4v sun4u" -- $cur) )
+ return;;
+ list-menu)
+ COMPREPLY=( $(compgen -W "-R" -- $cur) )
+ return;;
+ esac
+
+ case "$line" in
+ *update-archive*-R*)
+ COMPREPLY=( $(compgen -W "-v -n -f -F -p" -- $cur) )
+ ;;
+ *update-archive*)
+ COMPREPLY=( $(compgen -W "-v -n -f -F -R" -- $cur) )
+ ;;
+ *list-archive*-R*)
+ COMPREPLY=( $(compgen -W "-p" -- $cur) )
+ ;;
+ *list-archive*)
+ COMPREPLY=( $(compgen -W "-R" -- $cur) )
+ ;;
+ *set-menu*-R*)
+ COMPREPLY=( $(compgen -W "default= timeout=" -- $cur) )
+ compopt -o nospace
+ ;;
+ *set-menu*)
+ COMPREPLY=( $(compgen -W "-R default= timeout=" -- $cur) )
+ if [[ ${#COMPREPLY[@]} == 1 && ${COMPREPLY[0]} != -R ]]; then
+ compopt -o nospace
+ fi
+ ;;
+ esac
+
+}
+
+complete -F _bootadm bootadm
+