cmd_history: more fixes
[yap.git] / yap.zsh
blobb1a2fbed20c41ca486ac7792bd22f325ec5eea86
2 _yap-commands () {
3 local -a commands
5 commands=(
6 'add:add a new file to the repository'
7 'branch:list, create, or delete branches'
8 'cherry-pick:apply the changes in a given commit to the current branch'
9 'clone:make a local copy of an existing repository'
10 'commit:record changes to files as a new commit'
11 'diff:show staged, unstaged, or all uncommitted changes'
12 'history:alter history by dropping or amending commits'
13 'init:turn a directory into a repository'
14 'log:show the changelog for particular versions or files'
15 'point:move the current branch to a different revision'
16 'repo:list, add, or delete configured remote repositories'
17 'revert:remove uncommitted changes from a file (*)'
18 'rm:delete a file from the repository'
19 'show:show the changes introduced by a given commit'
20 'stage:stage changes in a file for commit'
21 'status:show files with staged and unstaged changes'
22 'switch:change the current working branch'
23 'uncommit:reverse the actions of the last commit'
24 'unstage:unstage changes in a file'
25 'version:report the current version of yap'
28 _describe -t commands 'zsh command' commands && ret=0
31 _yap-unstage () {
32 _arguments \
33 '*:file:_files' && ret=0
36 _yap-stage () {
37 _arguments \
38 '*:file:_files' && ret=0
41 _yap-add () {
42 _arguments \
43 '*:file:_files' && ret=0
46 _yap-rm () {
47 _arguments \
48 '*:file:_files' && ret=0
51 _yap-branch () {
52 _arguments \
53 '-d[delete a branch]:local branch' \
54 '*:branch' && ret=0
57 _yap () {
58 if (( CURRENT == 2 )); then
59 _yap-commands
60 else
61 shift words
62 (( CURRENT-- ))
63 curcontext="${curcontext%:*:*}:yap-$words[1]:"
64 _call_function ret _yap-$words[1]
68 compdef _yap yap