#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."
    "import:Import repositories from remote services."
    "list:List configured repositories."
    "search:Search configured repositories."
    "status:Check status of repositories."
    "sync:Synchronize VCS repositories."
    "worktree:Manage git worktrees for repositories."
  )
  _describe 'vcspull commands' _commands
}

_shtab_vcspull_import_commands() {
  local _commands=(
    "aws:Import repositories from AWS CodeCommit."
    "cb:Import repositories from Codeberg."
    "cc:Import repositories from AWS CodeCommit."
    "codeberg:Import repositories from Codeberg."
    "codecommit:Import repositories from AWS CodeCommit."
    "forgejo:Import repositories from a Forgejo instance."
    "gh:Import repositories from GitHub (github.com or GitHub Enterprise)."
    "gitea:Import repositories from a Gitea instance."
    "github:Import repositories from GitHub (github.com or GitHub Enterprise)."
    "gitlab:Import repositories from GitLab (gitlab.com or self-hosted)."
    "gl:Import repositories from GitLab (gitlab.com or self-hosted)."
  )
  _describe 'vcspull import commands' _commands
}

_shtab_vcspull_worktree_commands() {
  local _commands=(
    "list:"
    "prune:"
    "sync:"
  )
  _describe 'vcspull worktree 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:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_defaults_added=0

_shtab_vcspull_add_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  "--name[Override detected repository name when importing from a path]:override_name:"
  "--url[Repository URL to record (overrides detected remotes)]:url:"
  {-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\/\'). Defaults to the parent directory of the repository path.]:workspace_root_path:"
  {--dry-run,-n}"[Preview changes without writing to config file]"
  "--no-merge[Skip merging duplicate workspace roots before writing]"
  {-y,--yes}"[Automatically confirm interactive prompts]"
  ":Filesystem path to an existing project. The parent directory becomes the workspace unless overridden with --workspace.:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_add_defaults_added=0

_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]"
  "--no-merge[Skip merging duplicate workspace roots before writing]"
  "--include-worktrees[include git worktrees in discovery (excluded by default)]"
  ":Directory to scan for git repositories:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_discover_defaults_added=0

_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)]"
  "--no-merge[Do not merge duplicate workspace roots when formatting]"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_fmt_defaults_added=0

_shtab_vcspull_import_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_import_defaults_added=0

_shtab_vcspull_import_aws_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-w,--workspace}"[Workspace root directory (REQUIRED)]:workspace:"
  {-l,--language}"[Filter by programming language]:language:"
  "--topics[Filter by topics (comma-separated)]:topics:"
  "--min-stars[Minimum stars (for search mode)]:min_stars:"
  "--archived[Include archived repositories]"
  "--forks[Include forked repositories]"
  "--limit[Maximum repositories to fetch (default\: 100, 0 \= no limit)]:limit:"
  {-f,--file}"[Config file to write to (default\: \~\/.vcspull.yaml)]:config:"
  {--dry-run,-n}"[Preview without writing to config file]"
  {--yes,-y}"[Skip confirmation prompt]"
  "--json[Output as JSON]"
  "--ndjson[Output as NDJSON (one JSON per line)]"
  "--https[Use HTTPS clone URLs instead of SSH (default\: SSH)]"
  "--color[When to use colors (default\: auto)]:color:(auto always never)"
  "--region[AWS region for CodeCommit]:region:"
  "--profile[AWS profile for CodeCommit]:profile:"
  ":Optional substring filter for repository names:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_import_aws_defaults_added=0

_shtab_vcspull_import_cb_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-w,--workspace}"[Workspace root directory (REQUIRED)]:workspace:"
  {-l,--language}"[Filter by programming language]:language:"
  "--topics[Filter by topics (comma-separated)]:topics:"
  "--min-stars[Minimum stars (for search mode)]:min_stars:"
  "--archived[Include archived repositories]"
  "--forks[Include forked repositories]"
  "--limit[Maximum repositories to fetch (default\: 100, 0 \= no limit)]:limit:"
  {-f,--file}"[Config file to write to (default\: \~\/.vcspull.yaml)]:config:"
  {--dry-run,-n}"[Preview without writing to config file]"
  {--yes,-y}"[Skip confirmation prompt]"
  "--json[Output as JSON]"
  "--ndjson[Output as NDJSON (one JSON per line)]"
  "--https[Use HTTPS clone URLs instead of SSH (default\: SSH)]"
  "--color[When to use colors (default\: auto)]:color:(auto always never)"
  "--token[API token (overrides env var\; prefer env var for security)]:token:"
  {-m,--mode}"[Import mode\: user (default), org, or search]:mode:(user org search)"
  ":User, org name, or search query. For GitLab, supports subgroups with slash notation (e.g., parent\/child).:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_import_cb_defaults_added=0

_shtab_vcspull_import_cc_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-w,--workspace}"[Workspace root directory (REQUIRED)]:workspace:"
  {-l,--language}"[Filter by programming language]:language:"
  "--topics[Filter by topics (comma-separated)]:topics:"
  "--min-stars[Minimum stars (for search mode)]:min_stars:"
  "--archived[Include archived repositories]"
  "--forks[Include forked repositories]"
  "--limit[Maximum repositories to fetch (default\: 100, 0 \= no limit)]:limit:"
  {-f,--file}"[Config file to write to (default\: \~\/.vcspull.yaml)]:config:"
  {--dry-run,-n}"[Preview without writing to config file]"
  {--yes,-y}"[Skip confirmation prompt]"
  "--json[Output as JSON]"
  "--ndjson[Output as NDJSON (one JSON per line)]"
  "--https[Use HTTPS clone URLs instead of SSH (default\: SSH)]"
  "--color[When to use colors (default\: auto)]:color:(auto always never)"
  "--region[AWS region for CodeCommit]:region:"
  "--profile[AWS profile for CodeCommit]:profile:"
  ":Optional substring filter for repository names:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_import_cc_defaults_added=0

_shtab_vcspull_import_codeberg_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-w,--workspace}"[Workspace root directory (REQUIRED)]:workspace:"
  {-l,--language}"[Filter by programming language]:language:"
  "--topics[Filter by topics (comma-separated)]:topics:"
  "--min-stars[Minimum stars (for search mode)]:min_stars:"
  "--archived[Include archived repositories]"
  "--forks[Include forked repositories]"
  "--limit[Maximum repositories to fetch (default\: 100, 0 \= no limit)]:limit:"
  {-f,--file}"[Config file to write to (default\: \~\/.vcspull.yaml)]:config:"
  {--dry-run,-n}"[Preview without writing to config file]"
  {--yes,-y}"[Skip confirmation prompt]"
  "--json[Output as JSON]"
  "--ndjson[Output as NDJSON (one JSON per line)]"
  "--https[Use HTTPS clone URLs instead of SSH (default\: SSH)]"
  "--color[When to use colors (default\: auto)]:color:(auto always never)"
  "--token[API token (overrides env var\; prefer env var for security)]:token:"
  {-m,--mode}"[Import mode\: user (default), org, or search]:mode:(user org search)"
  ":User, org name, or search query. For GitLab, supports subgroups with slash notation (e.g., parent\/child).:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_import_codeberg_defaults_added=0

_shtab_vcspull_import_codecommit_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-w,--workspace}"[Workspace root directory (REQUIRED)]:workspace:"
  {-l,--language}"[Filter by programming language]:language:"
  "--topics[Filter by topics (comma-separated)]:topics:"
  "--min-stars[Minimum stars (for search mode)]:min_stars:"
  "--archived[Include archived repositories]"
  "--forks[Include forked repositories]"
  "--limit[Maximum repositories to fetch (default\: 100, 0 \= no limit)]:limit:"
  {-f,--file}"[Config file to write to (default\: \~\/.vcspull.yaml)]:config:"
  {--dry-run,-n}"[Preview without writing to config file]"
  {--yes,-y}"[Skip confirmation prompt]"
  "--json[Output as JSON]"
  "--ndjson[Output as NDJSON (one JSON per line)]"
  "--https[Use HTTPS clone URLs instead of SSH (default\: SSH)]"
  "--color[When to use colors (default\: auto)]:color:(auto always never)"
  "--region[AWS region for CodeCommit]:region:"
  "--profile[AWS profile for CodeCommit]:profile:"
  ":Optional substring filter for repository names:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_import_codecommit_defaults_added=0

_shtab_vcspull_import_forgejo_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-w,--workspace}"[Workspace root directory (REQUIRED)]:workspace:"
  {-l,--language}"[Filter by programming language]:language:"
  "--topics[Filter by topics (comma-separated)]:topics:"
  "--min-stars[Minimum stars (for search mode)]:min_stars:"
  "--archived[Include archived repositories]"
  "--forks[Include forked repositories]"
  "--limit[Maximum repositories to fetch (default\: 100, 0 \= no limit)]:limit:"
  {-f,--file}"[Config file to write to (default\: \~\/.vcspull.yaml)]:config:"
  {--dry-run,-n}"[Preview without writing to config file]"
  {--yes,-y}"[Skip confirmation prompt]"
  "--json[Output as JSON]"
  "--ndjson[Output as NDJSON (one JSON per line)]"
  "--https[Use HTTPS clone URLs instead of SSH (default\: SSH)]"
  "--color[When to use colors (default\: auto)]:color:(auto always never)"
  "--token[API token (overrides env var\; prefer env var for security)]:token:"
  {-m,--mode}"[Import mode\: user (default), org, or search]:mode:(user org search)"
  "--url[Base URL of the Forgejo instance (required)]:base_url:"
  ":User, org name, or search query. For GitLab, supports subgroups with slash notation (e.g., parent\/child).:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_import_forgejo_defaults_added=0

_shtab_vcspull_import_gh_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-w,--workspace}"[Workspace root directory (REQUIRED)]:workspace:"
  {-l,--language}"[Filter by programming language]:language:"
  "--topics[Filter by topics (comma-separated)]:topics:"
  "--min-stars[Minimum stars (for search mode)]:min_stars:"
  "--archived[Include archived repositories]"
  "--forks[Include forked repositories]"
  "--limit[Maximum repositories to fetch (default\: 100, 0 \= no limit)]:limit:"
  {-f,--file}"[Config file to write to (default\: \~\/.vcspull.yaml)]:config:"
  {--dry-run,-n}"[Preview without writing to config file]"
  {--yes,-y}"[Skip confirmation prompt]"
  "--json[Output as JSON]"
  "--ndjson[Output as NDJSON (one JSON per line)]"
  "--https[Use HTTPS clone URLs instead of SSH (default\: SSH)]"
  "--color[When to use colors (default\: auto)]:color:(auto always never)"
  "--token[API token (overrides env var\; prefer env var for security)]:token:"
  {-m,--mode}"[Import mode\: user (default), org, or search]:mode:(user org search)"
  "--url[Base URL for GitHub Enterprise (optional)]:base_url:"
  ":User, org name, or search query. For GitLab, supports subgroups with slash notation (e.g., parent\/child).:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_import_gh_defaults_added=0

_shtab_vcspull_import_gitea_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-w,--workspace}"[Workspace root directory (REQUIRED)]:workspace:"
  {-l,--language}"[Filter by programming language]:language:"
  "--topics[Filter by topics (comma-separated)]:topics:"
  "--min-stars[Minimum stars (for search mode)]:min_stars:"
  "--archived[Include archived repositories]"
  "--forks[Include forked repositories]"
  "--limit[Maximum repositories to fetch (default\: 100, 0 \= no limit)]:limit:"
  {-f,--file}"[Config file to write to (default\: \~\/.vcspull.yaml)]:config:"
  {--dry-run,-n}"[Preview without writing to config file]"
  {--yes,-y}"[Skip confirmation prompt]"
  "--json[Output as JSON]"
  "--ndjson[Output as NDJSON (one JSON per line)]"
  "--https[Use HTTPS clone URLs instead of SSH (default\: SSH)]"
  "--color[When to use colors (default\: auto)]:color:(auto always never)"
  "--token[API token (overrides env var\; prefer env var for security)]:token:"
  {-m,--mode}"[Import mode\: user (default), org, or search]:mode:(user org search)"
  "--url[Base URL of the Gitea instance (required)]:base_url:"
  ":User, org name, or search query. For GitLab, supports subgroups with slash notation (e.g., parent\/child).:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_import_gitea_defaults_added=0

_shtab_vcspull_import_github_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-w,--workspace}"[Workspace root directory (REQUIRED)]:workspace:"
  {-l,--language}"[Filter by programming language]:language:"
  "--topics[Filter by topics (comma-separated)]:topics:"
  "--min-stars[Minimum stars (for search mode)]:min_stars:"
  "--archived[Include archived repositories]"
  "--forks[Include forked repositories]"
  "--limit[Maximum repositories to fetch (default\: 100, 0 \= no limit)]:limit:"
  {-f,--file}"[Config file to write to (default\: \~\/.vcspull.yaml)]:config:"
  {--dry-run,-n}"[Preview without writing to config file]"
  {--yes,-y}"[Skip confirmation prompt]"
  "--json[Output as JSON]"
  "--ndjson[Output as NDJSON (one JSON per line)]"
  "--https[Use HTTPS clone URLs instead of SSH (default\: SSH)]"
  "--color[When to use colors (default\: auto)]:color:(auto always never)"
  "--token[API token (overrides env var\; prefer env var for security)]:token:"
  {-m,--mode}"[Import mode\: user (default), org, or search]:mode:(user org search)"
  "--url[Base URL for GitHub Enterprise (optional)]:base_url:"
  ":User, org name, or search query. For GitLab, supports subgroups with slash notation (e.g., parent\/child).:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_import_github_defaults_added=0

_shtab_vcspull_import_gitlab_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-w,--workspace}"[Workspace root directory (REQUIRED)]:workspace:"
  {-l,--language}"[Filter by programming language]:language:"
  "--topics[Filter by topics (comma-separated)]:topics:"
  "--min-stars[Minimum stars (for search mode)]:min_stars:"
  "--archived[Include archived repositories]"
  "--forks[Include forked repositories]"
  "--limit[Maximum repositories to fetch (default\: 100, 0 \= no limit)]:limit:"
  {-f,--file}"[Config file to write to (default\: \~\/.vcspull.yaml)]:config:"
  {--dry-run,-n}"[Preview without writing to config file]"
  {--yes,-y}"[Skip confirmation prompt]"
  "--json[Output as JSON]"
  "--ndjson[Output as NDJSON (one JSON per line)]"
  "--https[Use HTTPS clone URLs instead of SSH (default\: SSH)]"
  "--color[When to use colors (default\: auto)]:color:(auto always never)"
  "--token[API token (overrides env var\; prefer env var for security)]:token:"
  {-m,--mode}"[Import mode\: user (default), org, or search]:mode:(user org search)"
  "--url[Base URL for self-hosted GitLab (optional)]:base_url:"
  "--flatten-groups[For \`\`--mode org\`\`, flatten subgroup repositories into the base workspace instead of preserving subgroup paths]"
  ":User, org name, or search query. For GitLab, supports subgroups with slash notation (e.g., parent\/child).:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_import_gitlab_defaults_added=0

_shtab_vcspull_import_gl_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {-w,--workspace}"[Workspace root directory (REQUIRED)]:workspace:"
  {-l,--language}"[Filter by programming language]:language:"
  "--topics[Filter by topics (comma-separated)]:topics:"
  "--min-stars[Minimum stars (for search mode)]:min_stars:"
  "--archived[Include archived repositories]"
  "--forks[Include forked repositories]"
  "--limit[Maximum repositories to fetch (default\: 100, 0 \= no limit)]:limit:"
  {-f,--file}"[Config file to write to (default\: \~\/.vcspull.yaml)]:config:"
  {--dry-run,-n}"[Preview without writing to config file]"
  {--yes,-y}"[Skip confirmation prompt]"
  "--json[Output as JSON]"
  "--ndjson[Output as NDJSON (one JSON per line)]"
  "--https[Use HTTPS clone URLs instead of SSH (default\: SSH)]"
  "--color[When to use colors (default\: auto)]:color:(auto always never)"
  "--token[API token (overrides env var\; prefer env var for security)]:token:"
  {-m,--mode}"[Import mode\: user (default), org, or search]:mode:(user org search)"
  "--url[Base URL for self-hosted GitLab (optional)]:base_url:"
  "--flatten-groups[For \`\`--mode org\`\`, flatten subgroup repositories into the base workspace instead of preserving subgroup paths]"
  ":User, org name, or search query. For GitLab, supports subgroups with slash notation (e.g., parent\/child).:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_import_gl_defaults_added=0

_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)"
  "--include-worktrees[include configured worktrees in the listing]"
  "(*)::filter repositories by name pattern (supports fnmatch):"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_list_defaults_added=0

_shtab_vcspull_search_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:"
  "*--field[limit unscoped queries to specific fields (name, path, url, workspace). Repeatable or comma-separated.]:fields:"
  {-i,--ignore-case}"[case-insensitive matching]"
  {-S,--smart-case}"[smart case matching (ignore case unless pattern has capitals)]"
  {-F,--fixed-strings}"[treat search terms as literal strings]"
  "--word-regexp[match only whole words]"
  {-v,--invert-match}"[show non-matching repositories]"
  "--any[match if any term matches (default\: all terms)]"
  "--json[output as JSON]"
  "--ndjson[output as NDJSON (one JSON per line)]"
  "--color[when to use colors (default\: auto)]:color:(auto always never)"
  "(*)::search query terms (regex by default). Use field prefixes like name\:, path\:, url\:, workspace\:.:"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_search_defaults_added=0

_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):"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_status_defaults_added=0

_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)]"
  {--all,-a}"[sync all configured repositories]"
  "--include-worktrees[also sync configured worktrees for each repository]"
  "(*)::patterns \/ terms of repos, accepts globs \/ fnmatch(3):"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_sync_defaults_added=0

_shtab_vcspull_worktree_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_worktree_defaults_added=0

_shtab_vcspull_worktree_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:"
  "--json[output as JSON]"
  "--ndjson[output as NDJSON (one JSON per line)]"
  "--color[when to use colors (default\: auto)]:color:(auto always never)"
  "(*)::patterns \/ terms of repos, accepts globs \/ fnmatch(3):"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_worktree_list_defaults_added=0

_shtab_vcspull_worktree_prune_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:"
  "--json[output as JSON]"
  "--ndjson[output as NDJSON (one JSON per line)]"
  "--color[when to use colors (default\: auto)]:color:(auto always never)"
  {--dry-run,-n}"[preview what would be pruned without making changes]"
  "(*)::patterns \/ terms of repos, accepts globs \/ fnmatch(3):"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_worktree_prune_defaults_added=0

_shtab_vcspull_worktree_sync_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:"
  "--json[output as JSON]"
  "--ndjson[output as NDJSON (one JSON per line)]"
  "--color[when to use colors (default\: auto)]:color:(auto always never)"
  {--dry-run,-n}"[preview what would be synced without making changes]"
  "(*)::patterns \/ terms of repos, accepts globs \/ fnmatch(3):"
)

# guard to ensure default positional specs are added only once per session
_shtab_vcspull_worktree_sync_defaults_added=0


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

  # Add default positional/remainder specs only if none exist, and only once per session
  if (( ! _shtab_vcspull_defaults_added )); then
    if (( ${_shtab_vcspull_options[(I)${(q)one_or_more}*]} +          ${_shtab_vcspull_options[(I)${(q)remainder}*]} +          ${_shtab_vcspull_options[(I)${(q)default}]} == 0 )); then
      _shtab_vcspull_options+=(': :_shtab_vcspull_commands' '*::: :->vcspull')
    fi
    _shtab_vcspull_defaults_added=1
  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 ;;
        import) _shtab_vcspull_import ;;
        list) _arguments -C -s $_shtab_vcspull_list_options ;;
        search) _arguments -C -s $_shtab_vcspull_search_options ;;
        status) _arguments -C -s $_shtab_vcspull_status_options ;;
        sync) _arguments -C -s $_shtab_vcspull_sync_options ;;
        worktree) _shtab_vcspull_worktree ;;
      esac
  esac
}

_shtab_vcspull_import() {
  local context state line curcontext="$curcontext" one_or_more='(*)' remainder='(-)*' default='*::: :->import'

  # Add default positional/remainder specs only if none exist, and only once per session
  if (( ! _shtab_vcspull_import_defaults_added )); then
    if (( ${_shtab_vcspull_import_options[(I)${(q)one_or_more}*]} +          ${_shtab_vcspull_import_options[(I)${(q)remainder}*]} +          ${_shtab_vcspull_import_options[(I)${(q)default}]} == 0 )); then
      _shtab_vcspull_import_options+=(': :_shtab_vcspull_import_commands' '*::: :->import')
    fi
    _shtab_vcspull_import_defaults_added=1
  fi
  _arguments -C -s $_shtab_vcspull_import_options

  case $state in
    import)
      words=($line[1] "${words[@]}")
      (( CURRENT += 1 ))
      curcontext="${curcontext%:*:*}:_shtab_vcspull_import-$line[1]:"
      case $line[1] in
        aws) _arguments -C -s $_shtab_vcspull_import_aws_options ;;
        cb) _arguments -C -s $_shtab_vcspull_import_cb_options ;;
        cc) _arguments -C -s $_shtab_vcspull_import_cc_options ;;
        codeberg) _arguments -C -s $_shtab_vcspull_import_codeberg_options ;;
        codecommit) _arguments -C -s $_shtab_vcspull_import_codecommit_options ;;
        forgejo) _arguments -C -s $_shtab_vcspull_import_forgejo_options ;;
        gh) _arguments -C -s $_shtab_vcspull_import_gh_options ;;
        gitea) _arguments -C -s $_shtab_vcspull_import_gitea_options ;;
        github) _arguments -C -s $_shtab_vcspull_import_github_options ;;
        gitlab) _arguments -C -s $_shtab_vcspull_import_gitlab_options ;;
        gl) _arguments -C -s $_shtab_vcspull_import_gl_options ;;
      esac
  esac
}

_shtab_vcspull_worktree() {
  local context state line curcontext="$curcontext" one_or_more='(*)' remainder='(-)*' default='*::: :->worktree'

  # Add default positional/remainder specs only if none exist, and only once per session
  if (( ! _shtab_vcspull_worktree_defaults_added )); then
    if (( ${_shtab_vcspull_worktree_options[(I)${(q)one_or_more}*]} +          ${_shtab_vcspull_worktree_options[(I)${(q)remainder}*]} +          ${_shtab_vcspull_worktree_options[(I)${(q)default}]} == 0 )); then
      _shtab_vcspull_worktree_options+=(': :_shtab_vcspull_worktree_commands' '*::: :->worktree')
    fi
    _shtab_vcspull_worktree_defaults_added=1
  fi
  _arguments -C -s $_shtab_vcspull_worktree_options

  case $state in
    worktree)
      words=($line[1] "${words[@]}")
      (( CURRENT += 1 ))
      curcontext="${curcontext%:*:*}:_shtab_vcspull_worktree-$line[1]:"
      case $line[1] in
        list) _arguments -C -s $_shtab_vcspull_worktree_list_options ;;
        prune) _arguments -C -s $_shtab_vcspull_worktree_prune_options ;;
        sync) _arguments -C -s $_shtab_vcspull_worktree_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

