Created
July 2, 2015 21:59
-
-
Save jagajaga/dc44275a0c8df275a8f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef gshell | |
_gshell() { | |
local curcontext="$curcontext" state line | |
typeset -A opt_args | |
_arguments \ | |
'1: :->action'\ | |
'*: :->folder' | |
case $state in | |
action) | |
_arguments '1:action:(init enter on off checkout enterRev log rollback graph push pull clear)' | |
;; | |
*) | |
case $words[2] in | |
checkout) | |
local -a revisions | |
revisions=`gshell log` | |
compadd "$@" $revisions | |
;; | |
*) | |
_files | |
;; | |
esac | |
esac | |
} | |
_gshell "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment