README: Add a "features" section
[yap.git] / yap.zsh
blob3070d55986e14160df095b97d1361b8929575a78
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 'resolved:mark files with conflicts as resolved'
19 'rm:delete a file from the repository'
20 'show:show the changes introduced by a given commit'
21 'stage:stage changes in a file for commit'
22 'status:show files with staged and unstaged changes'
23 'switch:change the current working branch'
24 'track:query and configure remote branch tracking'
25 'uncommit:reverse the actions of the last commit'
26 'unstage:unstage changes in a file'
27 'update:update the current branch relative to its tracking branch'
28 'version:report the current version of yap'
31 _describe -t commands 'zsh command' commands && ret=0
34 _yap-unstage () {
35 _arguments \
36 '*:file:_files' && ret=0
39 _yap-stage () {
40 _arguments \
41 '*:file:_files' && ret=0
44 _yap-add () {
45 _arguments \
46 '*:file:_files' && ret=0
49 _yap-rm () {
50 _arguments \
51 '*:file:_files' && ret=0
54 _yap-log () {
55 _arguments \
56 '*:file:_files' && ret=0
59 _yap-resolved () {
60 _arguments \
61 '*:file:_files' && ret=0
64 _yap-switch () {
65 _arguments \
66 '*:branch:__git_heads' && ret=0
69 _yap-branch () {
70 _arguments \
71 '-d[delete a branch]:local branch' \
72 '*:branch:__git_heads' && ret=0
75 _yap () {
76 if (( CURRENT == 2 )); then
77 _yap-commands
78 else
79 shift words
80 (( CURRENT-- ))
81 curcontext="${curcontext%:*:*}:yap-$words[1]:"
82 _call_function ret _yap-$words[1]
86 compdef _yap yap