Permalink
Browse files

Bash autocompletion

  • Loading branch information...
1 parent 4d0c167 commit 219d7ccd35cfe3d1138c77e058802e786e83c6fa @l0b0 committed Jun 18, 2012
Showing with 15 additions and 0 deletions.
  1. +1 −0 Makefile
  2. +14 −0 etc/bash_completion.d/vcard
View
1 Makefile
@@ -40,6 +40,7 @@ clean: distclean
.PHONY: install
install:
$(SETUP) install $(INSTALL_OPTIONS)
+ install --mode 644 etc/bash_completion.d/$(notdir $(CURDIR)) /etc/bash_completion.d/
.PHONY: register
register:
View
14 etc/bash_completion.d/vcard
@@ -0,0 +1,14 @@
+# Autocomplete for filterous command
+_vcard()
+{
+ local cur prev opts base
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+ # Basic options
+ opts="-v --verbose"
+
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+}
+complete -o filenames -o default -F _vcard vcard

0 comments on commit 219d7cc

Please sign in to comment.