git-worktree-cli 0.5.2

Enhanced git worktree management with real-time streaming output
Documentation
#compdef gwt

autoload -U is-at-least

_gwt() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_gwt_commands" \
"*::: :->gwt" \
&& ret=0
    case $state in
    (gwt)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:gwt-command-$line[1]:"
        case $line[1] in
            (init)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':repo_url -- The repository URL to clone:_default' \
&& ret=0
;;
(add)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':branch_name -- Branch name (can include slashes like feature/branch-name):_default' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'::branch_name -- Branch name to remove (current worktree if not specified):_default' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':shell -- Shell to generate completions for:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_gwt__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:gwt-help-command-$line[1]:"
        case $line[1] in
            (init)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(add)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_gwt_commands] )) ||
_gwt_commands() {
    local commands; commands=(
'init:Initialize a new worktree project from a repository URL' \
'add:Add a new worktree for a branch' \
'list:List all worktrees in the current project' \
'remove:Remove a worktree' \
'completions:Generate shell completions' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'gwt commands' commands "$@"
}
(( $+functions[_gwt__add_commands] )) ||
_gwt__add_commands() {
    local commands; commands=()
    _describe -t commands 'gwt add commands' commands "$@"
}
(( $+functions[_gwt__completions_commands] )) ||
_gwt__completions_commands() {
    local commands; commands=()
    _describe -t commands 'gwt completions commands' commands "$@"
}
(( $+functions[_gwt__help_commands] )) ||
_gwt__help_commands() {
    local commands; commands=(
'init:Initialize a new worktree project from a repository URL' \
'add:Add a new worktree for a branch' \
'list:List all worktrees in the current project' \
'remove:Remove a worktree' \
'completions:Generate shell completions' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'gwt help commands' commands "$@"
}
(( $+functions[_gwt__help__add_commands] )) ||
_gwt__help__add_commands() {
    local commands; commands=()
    _describe -t commands 'gwt help add commands' commands "$@"
}
(( $+functions[_gwt__help__completions_commands] )) ||
_gwt__help__completions_commands() {
    local commands; commands=()
    _describe -t commands 'gwt help completions commands' commands "$@"
}
(( $+functions[_gwt__help__help_commands] )) ||
_gwt__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'gwt help help commands' commands "$@"
}
(( $+functions[_gwt__help__init_commands] )) ||
_gwt__help__init_commands() {
    local commands; commands=()
    _describe -t commands 'gwt help init commands' commands "$@"
}
(( $+functions[_gwt__help__list_commands] )) ||
_gwt__help__list_commands() {
    local commands; commands=()
    _describe -t commands 'gwt help list commands' commands "$@"
}
(( $+functions[_gwt__help__remove_commands] )) ||
_gwt__help__remove_commands() {
    local commands; commands=()
    _describe -t commands 'gwt help remove commands' commands "$@"
}
(( $+functions[_gwt__init_commands] )) ||
_gwt__init_commands() {
    local commands; commands=()
    _describe -t commands 'gwt init commands' commands "$@"
}
(( $+functions[_gwt__list_commands] )) ||
_gwt__list_commands() {
    local commands; commands=()
    _describe -t commands 'gwt list commands' commands "$@"
}
(( $+functions[_gwt__remove_commands] )) ||
_gwt__remove_commands() {
    local commands; commands=()
    _describe -t commands 'gwt remove commands' commands "$@"
}

if [ "$funcstack[1]" = "_gwt" ]; then
    _gwt "$@"
else
    compdef _gwt gwt
fi