#compdef vcspull

# AUTOMATICALLY GENERATED by `shtab`


_shtab_vcspull_commands() {
  local _commands=(
    "add:Add a single repository to the configuration."
    "discover:Discover and add repositories from filesystem."
    "fmt:Format vcspull configuration files for consistency."
    "list:List configured repositories."
    "status:Check status of repositories."
    "sync:Synchronize VCS repositories."
  )
  _describe 'vcspull commands' _commands
}

_shtab_vcspull_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  "(- : *)"{--version,-V}"[show program\'s version number and exit]"
  "--log-level[log level (debug, info, warning, error, critical)]:log_level:"
)

_shtab_vcspull_add_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-f,--file}"[path to config file (default\: \~\/.vcspull.yaml or .\/.vcspull.yaml)]:config:"
  "--path[Local directory path where repo will be cloned (determines workspace root if not specified with --workspace)]:path:"
  {-w,--workspace,--workspace-root}"[Workspace root directory in config (e.g., \'\~\/projects\/\'). If not specified, will be inferred from --path or use current directory.]:workspace_root_path:"
  {--dry-run,-n}"[Preview changes without writing to config file]"
  ":Name for the repository in the config:"
  ":Repository URL (e.g., https\:\/\/github.com\/user\/repo.git):"
)

_shtab_vcspull_discover_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-f,--file}"[path to config file (default\: \~\/.vcspull.yaml or .\/.vcspull.yaml)]:config:"
  {-w,--workspace,--workspace-root}"[Workspace root directory in config (e.g., \'\~\/projects\/\'). If not specified, uses the scan directory. Applies the workspace root to all discovered repos.]:workspace_root_path:"
  {--recursive,-r}"[Scan directories recursively]"
  {--yes,-y}"[Skip confirmation prompt]"
  {--dry-run,-n}"[Preview changes without writing to config file]"
  ":Directory to scan for git repositories:"
)

_shtab_vcspull_fmt_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-f,--file}"[path to config file (default\: .vcspull.yaml or \~\/.vcspull.yaml)]:config:"
  {--write,-w}"[Write formatted configuration back to file]"
  "--all[Format all discovered config files (home, config dir, and current dir)]"
)

_shtab_vcspull_list_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-f,--file}"[path to config file (default\: \~\/.vcspull.yaml or .\/.vcspull.yaml)]:config:"
  {-w,--workspace,--workspace-root}"[filter by workspace root directory]:workspace_root:"
  "--tree[display repositories grouped by workspace root]"
  "--json[output as JSON]"
  "--ndjson[output as NDJSON (one JSON per line)]"
  "--color[when to use colors (default\: auto)]:color:(auto always never)"
  "(*)::filter repositories by name pattern (supports fnmatch):"
)

_shtab_vcspull_status_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-f,--file}"[path to config file (default\: \~\/.vcspull.yaml or .\/.vcspull.yaml)]:config:"
  {-w,--workspace,--workspace-root}"[filter by workspace root directory]:workspace_root:"
  {--detailed,-d}"[show detailed status information]"
  "--json[output as JSON]"
  "--ndjson[output as NDJSON (one JSON per line)]"
  "--color[when to use colors (default\: auto)]:color:(auto always never)"
  {--no-concurrent,--sequential}"[check repositories sequentially instead of concurrently]"
  "--max-concurrent[maximum concurrent status checks (default\: 32)]:max_concurrent:"
  "(*)::filter repositories by name pattern (supports fnmatch):"
)

_shtab_vcspull_sync_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-f,--file}"[path to config file (default\: \~\/.vcspull.yaml or .\/.vcspull.yaml)]:config:_files"
  {-w,--workspace,--workspace-root}"[filter by workspace root directory]:workspace_root:"
  {--dry-run,-n}"[preview what would be synced without making changes]"
  "--json[output as JSON]"
  "--ndjson[output as NDJSON (one JSON per line)]"
  "--color[when to use colors (default\: auto)]:color:(auto always never)"
  {--exit-on-error,-x}"[exit immediately encountering error (when syncing multiple repos)]"
  "--show-unchanged[include repositories that are already up to date]"
  "--summary-only[print only the plan summary line]"
  "--long[show extended details for each repository]"
  "--relative-paths[display repository paths relative to the workspace root]"
  "--fetch[refresh remote tracking information before planning]"
  "--offline[skip network access while planning (overrides --fetch)]"
  "*"{-v,--verbose}"[increase plan verbosity (-vv for maximum detail)]"
  "(*)::patterns \/ terms of repos, accepts globs \/ fnmatch(3):"
)


_shtab_vcspull() {
  local context state line curcontext="$curcontext" one_or_more='(-)*' remainder='(*)'

  if ((${_shtab_vcspull_options[(I)${(q)one_or_more}*]} + ${_shtab_vcspull_options[(I)${(q)remainder}*]} == 0)); then  # noqa: E501
    _shtab_vcspull_options+=(': :_shtab_vcspull_commands' '*::: :->vcspull')
  fi
  _arguments -C -s $_shtab_vcspull_options

  case $state in
    vcspull)
      words=($line[1] "${words[@]}")
      (( CURRENT += 1 ))
      curcontext="${curcontext%:*:*}:_shtab_vcspull-$line[1]:"
      case $line[1] in
        add) _arguments -C -s $_shtab_vcspull_add_options ;;
        discover) _arguments -C -s $_shtab_vcspull_discover_options ;;
        fmt) _arguments -C -s $_shtab_vcspull_fmt_options ;;
        list) _arguments -C -s $_shtab_vcspull_list_options ;;
        status) _arguments -C -s $_shtab_vcspull_status_options ;;
        sync) _arguments -C -s $_shtab_vcspull_sync_options ;;
      esac
  esac
}



typeset -A opt_args

if [[ $zsh_eval_context[-1] == eval ]]; then
  # eval/source/. command, register function for later
  compdef _shtab_vcspull -N vcspull
else
  # autoload from fpath, call function directly
  _shtab_vcspull "$@"
fi

