Skip to content

Instantly share code, notes, and snippets.

@jagajaga
Created July 2, 2015 22:42
Show Gist options
  • Save jagajaga/07d8da962f7f51b83155 to your computer and use it in GitHub Desktop.
Save jagajaga/07d8da962f7f51b83155 to your computer and use it in GitHub Desktop.
#compdef hello
_hello() {
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`
echo $revisions
            compadd "$@" $revisions
        ;;
*)
echo $words
_files
esac
esac
}
_hello "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment