Permalink
Browse files

Added autocompletion for Bash.

  • Loading branch information...
1 parent b4196b9 commit 8f68589e28ecc786fce8a8ac41f6ff8cdcbe6104 Jordi Funollet committed Nov 7, 2012
Showing with 24 additions and 0 deletions.
  1. +24 −0 contrib/completion/sheet.bash
View
24 contrib/completion/sheet.bash
@@ -0,0 +1,24 @@
+# Bash completion for 'sheet' (http://oscardelben.com/sheet/).
+
+function _sheet_complete() {
+ _get_comp_words_by_ref cur prev
+ COMPREPLY=()
+
+ case "${prev}" in
+ list|new)
+ return 0
+ ;;
+ edit|copy)
+ COMPREPLY=( $(compgen -W "$(sheet list)" -- "${cur}") )
+ return 0
+ ;;
+ *)
+ ;;
+ esac
+
+ COMPREPLY=( $(compgen -W "list new edit copy $(sheet list)" -- ${cur}) )
+
+}
+
+complete -o nospace -F _sheet_complete sheet
+

0 comments on commit 8f68589

Please sign in to comment.