All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
3 function __vcsh_repositories () {
4 #TODO list only one repo and stop
7 repos=( ${(f)"$(command vcsh list)"} )
8 _describe -t repos 'repositories' repos
11 function __vcsh_not_implemented_yet () {
12 _message "Subcommand completion '${1#*-}': not implemented yet"
15 function _vcsh-clone () {
16 __vcsh_not_implemented_yet "$0" #TODO
19 function _vcsh-delete () {
23 function _vcsh-enter () {
27 function _vcsh-help () {
31 function _vcsh-init () {
35 function _vcsh-list () {
39 function _vcsh-list-tracked () {
43 function _vcsh-list-tracked-by () {
47 function _vcsh-rename () {
49 #TODO tell the user to write new stuff
52 function _vcsh-run () {
58 function _vcsh-setup () {
62 function _vcsh-version () {
65 function _vcsh-which () {
66 __vcsh_not_implemented_yet "$0" #TODO
69 function _vcsh-write-gitignore () {
74 local curcontext="${curcontext}"
75 local state vcshcommand
76 local -a args subcommands
79 "clone:clone an existing repository"
80 "delete:delete an existing repository"
81 "enter:enter repository; spawn new <\$SHELL>"
83 "init:initialize an empty repository"
84 "list:list all local vcsh repositories"
85 "list-tracked:list all files tracked by vcsh"
86 "list-tracked-by:list files tracked by a repository"
87 "rename:rename a repository"
88 "run:run command with <\$GIT_DIR> and <\$GIT_WORK_TREE> set"
89 "setup:set up repository with recommended settings"
90 "version:print version information"
91 "which:find <substring> in name of any tracked file"
92 "write-gitignore:write .gitignore.d/<repo> via git ls-files"
96 '-c[source <file> prior to other configuration files]:config files:_path_files'
97 '-d[enable debug mode]'
98 '-v[enable verbose mode]'
99 '*:: :->subcommand_or_options_or_repo'
102 _arguments -C ${args} && return
104 if [[ ${state} == "subcommand_or_options_or_repo" ]]; then
105 if (( CURRENT == 1 )); then
106 _describe -t subcommands 'vcsh sub-commands' subcommands
109 vcshcommand="${words[1]}"
110 if ! (( ${+functions[_vcsh-$vcshcommand]} )); then
111 # There is no handler function, so this is probably the name
112 # of a repository. Act accordingly.
113 _message "git sub-command"
114 #TODO and now we need to complete on git subcommands
116 curcontext="${curcontext%:*:*}:vcsh-${vcshcommand}:"
117 _call_function ret _vcsh-${vcshcommand}