summaryrefslogtreecommitdiffstats
path: root/shell-completion/last
diff options
context:
space:
mode:
authorSami Kerola2013-03-23 17:49:52 +0100
committerSami Kerola2013-04-01 18:16:53 +0200
commit41e5a92cf1cd8950df8b02fdd2ea8be571dbab02 (patch)
treeb63263b7d4d5b026f36557eb4bdfdce2dd6ca18e /shell-completion/last
parentbash-completion: fdisks (diff)
downloadkernel-qcow2-util-linux-41e5a92cf1cd8950df8b02fdd2ea8be571dbab02.tar.gz
kernel-qcow2-util-linux-41e5a92cf1cd8950df8b02fdd2ea8be571dbab02.tar.xz
kernel-qcow2-util-linux-41e5a92cf1cd8950df8b02fdd2ea8be571dbab02.zip
bash-completion: login-utils
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'shell-completion/last')
-rw-r--r--shell-completion/last38
1 files changed, 38 insertions, 0 deletions
diff --git a/shell-completion/last b/shell-completion/last
new file mode 100644
index 000000000..493051e64
--- /dev/null
+++ b/shell-completion/last
@@ -0,0 +1,38 @@
+_last_module()
+{
+ local cur prev OPTS
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ case $prev in
+ '-f')
+ compopt -o filenames
+ COMPREPLY=( $(compgen -f -- $cur) )
+ return 0
+ ;;
+ '-h')
+ COMPREPLY=( $(compgen -A hostname -- $cur) )
+ return 0
+ ;;
+ '-i')
+ COMPREPLY=( $(compgen -W "ipaddr" -- $cur) )
+ return 0
+ ;;
+ '-t')
+ local TTYS
+ TTYS=$(cd /sys/devices/virtual/tty && echo *)
+ COMPREPLY=( $(compgen -W "$TTYS" -- $cur) )
+ return 0
+ ;;
+ esac
+ case $cur in
+ -*)
+ OPTS="-f -h -i -l -t -y"
+ COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+ return 0
+ ;;
+ esac
+ COMPREPLY=( $(compgen -u -- $cur) )
+ return 0
+}
+complete -F _last_module last