#
#  Completion for gofed:
#
#  gofed help
#  gofed scratch-build
#  gofed build
#  gofed push
#  gofed update
#  gofed ggi
#  gofed github2spec
#  gofed googlecode2spec
#  gofed review
#  gofed pull
#  gofed inspect
#  gofed bump
#  gofed check-commit
#  gofed check-deps
#  gofed scan-imports
#  gofed scan-packages
#  gofed bbo
#  gofed scan-deps
#  gofed scan-symbols
#  gofed gcpmaster
#  gofed bitbucket2spec
#  gofed wizard
#  gofed apidiff
#  gofed tools
#  gofed version
#  gofed repo2spec
#  gofed lint

_gofed()
{
    local cur prev opts
    _init_completion -s || return
    COMPREPLY=()
    opts="help scratch-build build push update ggi github2spec googlecode2spec review pull inspect bump check-commit check-deps scan-imports scan-packages bbo scan-deps scan-symbols gcpmaster bitbucket2spec wizard apidiff tools version repo2spec lint"
    case ${words[1]} in
        help)
            return 0
            ;;
        scratch-build)
            COMPREPLY=( $(compgen -W '--branches --dry --ebranches --help --verbose -h' -- ${cur}) )
            return 0
            ;;
        build)
            COMPREPLY=( $(compgen -W '--branches --dry --ebranches --help --verbose -h' -- ${cur}) )
            return 0
            ;;
        push)
            COMPREPLY=( $(compgen -W '--branches --dry --ebranches --help --verbose -h' -- ${cur}) )
            return 0
            ;;
        update)
            return 0
            ;;
        ggi)
            COMPREPLY=( $(compgen -W '--all --classes --help --importpath --pkgdb --requires --scan-all-dirs --short --skip-dirs --skip-errors --spec --verbose -a -c -d -h -r -s -v' -- ${cur}) )
            return 0
            ;;
        github2spec)
            COMPREPLY=( $(compgen -W '--commit --force --format --help --project --repo --scan-all-dirs --skip-dirs -c -f -h -p -r' -- ${cur}) )
            return 0
            ;;
        googlecode2spec)
            COMPREPLY=( $(compgen -W '--force --format --help --repo --rev --scan-all-dirs --skip-dirs -c -f -h -r' -- ${cur}) )
            return 0
            ;;
        review)
            return 0
            ;;
        pull)
            COMPREPLY=( $(compgen -W '--branches --dry --ebranches --help --verbose -h' -- ${cur}) )
            return 0
            ;;
        inspect)
            COMPREPLY=( $(compgen -W '--dirs --help --prefix --provides --scan-all-dirs --skip-dirs --spec --test -d -h -p -s -t' -- ${cur}) )
            return 0
            ;;
        bump)
            COMPREPLY=( $(compgen -W '--commit --help --skip-master -c -h -s' -- ${cur}) )
            return 0
            ;;
        check-commit)
            COMPREPLY=( $(compgen -W '--help --import_path -h -i' -- ${cur}) )
            return 0
            ;;
        check-deps)
            COMPREPLY=( $(compgen -W '--dontpull --help --verbose -h -l -v' -- ${cur}) )
            return 0
            ;;
        scan-imports)
            COMPREPLY=( $(compgen -W '--create --full --help --imported --minimal --prefix --provided --verbose -c -f -h -i -m -p -s -v' -- ${cur}) )
            return 0
            ;;
        scan-packages)
            COMPREPLY=( $(compgen -W '--help --list --new --removed --update -h -l -n -r -u' -- ${cur}) )
            return 0
            ;;
        bbo)
            COMPREPLY=( $(compgen -W '--branches --dry --ebranches --help --verbose -h' -- ${cur}) )
            return 0
            ;;
        scan-deps)
            COMPREPLY=( $(compgen -W '--cyclic --graphviz --help --leaves --outfile --roots --verbose -c -g -h -l -o -r -v' -- ${cur}) )
            return 0
            ;;
        scan-symbols)
            COMPREPLY=( $(compgen -W '--all --help --list --prefix --provides --stats --usedip --xml -a -h -l -p -s -u -x' -- ${cur}) )
            return 0
            ;;
        gcpmaster)
            COMPREPLY=( $(compgen -W '--branches --dry --ebranches --help --verbose -h' -- ${cur}) )
            return 0
            ;;
        bitbucket2spec)
            COMPREPLY=( $(compgen -W '--commit --force --format --help --project --repo --scan-all-dirs --skip-dirs -c -f -h -p -r' -- ${cur}) )
            return 0
            ;;
        wizard)
            COMPREPLY=( $(compgen -W '--branches --build --dry --ebranches --help --push --scratch --update --verbose -h' -- ${cur}) )
            return 0
            ;;
        apidiff)
            COMPREPLY=( $(compgen -W '--all --color --error --help --prefix --verbose -a -c -e -h -v' -- ${cur}) )
            return 0
            ;;
        tools)
            COMPREPLY=( $(compgen -W '--bbo --branches --build --dry --ebranches --from --gcp --git-reset --help --pull --push --scratch --update --verbose --wait --waitbbo -h' -- ${cur}) )
            return 0
            ;;
        version)
            return 0
            ;;
        repo2spec)
            COMPREPLY=( $(compgen -W '--bitbucket --commit --detect --force --format --github --googlecode --help --project --repo --scan-all-dirs --skip-dirs --skip-errors -c -f -h -p -r' -- ${cur}) )
            return 0
            ;;
        lint)
            COMPREPLY=( $(compgen -W '--archive --detect --help --info --scan-all-dirs --skip-dirs --sources --spec --verbose -a -d -h -i -s -v' -- ${cur}) )
            return 0
            ;;
        *)
        ;;
    esac

    COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
}
complete -F _gofed gofed
