Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #17 from funollet/master

Added autocompletion for Bash
  • Loading branch information...
commit 43e4e8047318bc6df71746b9c3eb511bf5734326 2 parents b4196b9 + 8f68589
@oscardelben authored
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
+
Please sign in to comment.
Something went wrong with that request. Please try again.