File: _git-subrepo

package info (click to toggle)
git-subrepo 0.4.9-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,552 kB
  • sloc: sh: 7,074; makefile: 273; perl: 226
file content (76 lines) | stat: -rw-r--r-- 2,574 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#compdef git-subrepo -P git\ ##subrepo
#description perform git-subrepo operations

# DO NOT EDIT. This file generated by pkg/bin/generate-completion.pl.

_git-subrepo() {
    typeset -A opt_args
    local curcontext="$curcontext" state line context

    _arguments -s \
        '1: :->subcmd' \
        '*: :->args' \
        '-h[Show the command summary]' \
        '--help[Help overview]' \
        '--version[Print the git-subrepo version number]' \
        '(-a --all)'{-a,--all}'[Perform command on all current subrepos]' \
        '(-A --ALL)'{-A,--ALL}'[Perform command on all subrepos and subsubrepos]' \
        '(-b --branch)'{-b,--branch}'[Specify the upstream branch to push/pull/fetch]:b' \
        '(-e --edit)'{-e,--edit}'[Edit commit message]' \
        '(-f --force)'{-f,--force}'[Force certain operations]' \
        '(-F --fetch)'{-F,--fetch}'[Fetch the upstream content first]' \
        '(-M --method)'{-M,--method}'[Join method: '"'"'merge'"'"' (default) or '"'"'rebase'"'"']:M' \
        '(-m --message)'{-m,--message}'[Specify a commit message]:m' \
        '--file[Specify a commit message file]:file' \
        '(-r --remote)'{-r,--remote}'[Specify the upstream remote to push/pull/fetch]:r' \
        '(-s --squash)'{-s,--squash}'[Squash commits on push]' \
        '(-u --update)'{-u,--update}'[Add the --branch and/or --remote overrides to .gitrepo]' \
        '(-q --quiet)'{-q,--quiet}'[Show minimal output]' \
        '(-v --verbose)'{-v,--verbose}'[Show verbose output]' \
        '(-d --debug)'{-d,--debug}'[Show the actual commands used]' \
        '(-x --DEBUG)'{-x,--DEBUG}'[Turn on -x Bash debugging]' \
 && ret=0

    case $state in
    subcmd)
        compadd branch clean clone commit config fetch help init pull push status upgrade version
    ;;

    args)
        case $line[1] in

        clone)
            _arguments -C \
                '1: :->subcmd' \
                '2: :->repo' \
                '*: :->subdir' \
                    && ret=0
                case $state in
                subdir|repo)
                    _files
                ;;
                esac
        ;;

        branch|clean|commit|config|fetch|pull|push|status)
            _compadd_subdirs
        ;;

        init)
            _files
        ;;

        help)
            compadd branch clean clone commit config fetch help init pull push status upgrade version
        ;;
        esac
    ;;
    esac

}

_compadd_subdirs() {
    local subrepos
    IFS=$'\n' set -A subrepos `git subrepo status -q`
    compadd -X "subrepos: " $subrepos
}