# Print an optspec for argparse to handle cmd's options that are independent of any subcommand.
function __fish_garden_global_optspecs
	string join \n color= c/config= C/chdir= d/debug= D/define= r/root= q/quiet v/verbose h/help V/version
end

function __fish_garden_needs_command
	# Figure out if the current invocation already has a command.
	set -l cmd (commandline -opc)
	set -e cmd[1]
	argparse -s (__fish_garden_global_optspecs) -- $cmd 2>/dev/null
	or return
	if set -q argv[1]
		# Also print the command, so this can be used to figure out what it is.
		echo $argv[1]
		return 1
	end
	return 0
end

function __fish_garden_using_subcommand
	set -l cmd (__fish_garden_needs_command)
	test -z "$cmd"
	and return 1
	contains -- $cmd[1] $argv
end

complete -c garden -n "__fish_garden_needs_command" -l color -d 'Use ANSI colors [auto, true, false, on, off, always, never, 1, 0]' -r
complete -c garden -n "__fish_garden_needs_command" -s c -l config -d 'Set the Garden file to use' -r -F
complete -c garden -n "__fish_garden_needs_command" -s C -l chdir -d 'Change directories before searching for Garden files' -r -f -a "(__fish_complete_directories)"
complete -c garden -n "__fish_garden_needs_command" -s d -l debug -d 'Increase verbosity for a debug category' -r
complete -c garden -n "__fish_garden_needs_command" -s D -l define -d 'Set variables using \'name=value\' expressions' -r
complete -c garden -n "__fish_garden_needs_command" -s r -l root -d 'Set the Garden tree root' -r -f -a "(__fish_complete_directories)"
complete -c garden -n "__fish_garden_needs_command" -s q -l quiet -d 'Be quiet'
complete -c garden -n "__fish_garden_needs_command" -s v -l verbose -d 'Increase verbosity level (default: 0)'
complete -c garden -n "__fish_garden_needs_command" -s h -l help -d 'Print help'
complete -c garden -n "__fish_garden_needs_command" -s V -l version -d 'Print version'
complete -c garden -n "__fish_garden_needs_command" -f -a "cmd" -d 'Run custom commands over gardens'
complete -c garden -n "__fish_garden_needs_command" -f -a "completion" -d 'Generate shell completions'
complete -c garden -n "__fish_garden_needs_command" -f -a "eval" -d 'Evaluate garden expressions'
complete -c garden -n "__fish_garden_needs_command" -f -a "exec" -d 'Run commands inside garden environments'
complete -c garden -n "__fish_garden_needs_command" -f -a "git" -d 'Execute Git commands'
complete -c garden -n "__fish_garden_needs_command" -f -a "grow" -d 'Grow garden worktrees into existence'
complete -c garden -n "__fish_garden_needs_command" -f -a "gui" -d 'Garden GUI (run "garden-gui --help" for more details)'
complete -c garden -n "__fish_garden_needs_command" -f -a "init" -d 'Initialize a "garden.yaml" garden configuration file'
complete -c garden -n "__fish_garden_needs_command" -f -a "ls" -d 'List available gardens, groups, trees and commands'
complete -c garden -n "__fish_garden_needs_command" -f -a "plant" -d 'Add pre-existing worktrees to a garden configuration file'
complete -c garden -n "__fish_garden_needs_command" -f -a "prune" -d 'Remove unreferenced Git repositories'
complete -c garden -n "__fish_garden_needs_command" -f -a "shell" -d 'Open a shell in a garden environment'
complete -c garden -n "__fish_garden_needs_command" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c garden -n "__fish_garden_using_subcommand cmd" -s t -l trees -d 'Filter trees by name post-query using a glob pattern' -r
complete -c garden -n "__fish_garden_using_subcommand cmd" -s D -l define -d 'Set variables using \'name=value\' expressions' -r
complete -c garden -n "__fish_garden_using_subcommand cmd" -s j -l jobs -d 'Run commands in parallel using the specified number of jobs' -r
complete -c garden -n "__fish_garden_using_subcommand cmd" -s b -l breadth-first -d 'Run a command in all trees before running the next command'
complete -c garden -n "__fish_garden_using_subcommand cmd" -s N -l dry-run -d 'Perform a trial run without running commands'
complete -c garden -n "__fish_garden_using_subcommand cmd" -s k -l keep-going -d 'Continue to the next tree when errors occur'
complete -c garden -n "__fish_garden_using_subcommand cmd" -s n -l no-errexit -d 'Do not pass "-e" to the shell. Prevent the "errexit" shell option from being set. By default, the "-e" option is passed to the configured shell so that multi-line and multi-statement commands halt execution when the first statement with a non-zero exit code is encountered. This option has the effect of making multi-line and multi-statement commands run all statements even when an earlier statement returns a non-zero exit code'
complete -c garden -n "__fish_garden_using_subcommand cmd" -s f -l force -d 'Run commands even when the tree does not exist'
complete -c garden -n "__fish_garden_using_subcommand cmd" -s q -l quiet -d 'Be quiet'
complete -c garden -n "__fish_garden_using_subcommand cmd" -s v -l verbose -d 'Increase verbosity level (default: 0)'
complete -c garden -n "__fish_garden_using_subcommand cmd" -s x -l echo -d 'Enable echo mode by passing "-x" to the shell'
complete -c garden -n "__fish_garden_using_subcommand cmd" -s z -l no-wordsplit -d 'Do not pass "-o shwordsplit" to zsh. Prevent the "shwordsplit" shell option from being set when using zsh. The "-o shwordsplit" option is passed to zsh by default so that unquoted $variable expressions are subject to word splitting, just like other shells. This option disables this behavior'
complete -c garden -n "__fish_garden_using_subcommand cmd" -s h -l help -d 'Print help'
complete -c garden -n "__fish_garden_using_subcommand completion" -s c -l commands -d 'Include completions for custom commands'
complete -c garden -n "__fish_garden_using_subcommand completion" -s h -l help -d 'Print help'
complete -c garden -n "__fish_garden_using_subcommand eval" -s D -l define -d 'Set variables using \'name=value\' expressions' -r
complete -c garden -n "__fish_garden_using_subcommand eval" -s h -l help -d 'Print help'
complete -c garden -n "__fish_garden_using_subcommand exec" -s t -l trees -d 'Filter trees by name post-query using a glob pattern' -r
complete -c garden -n "__fish_garden_using_subcommand exec" -s j -l jobs -d 'Run commands in parallel using the specified number of jobs' -r
complete -c garden -n "__fish_garden_using_subcommand exec" -s N -l dry-run -d 'Perform a trial run without executing any commands'
complete -c garden -n "__fish_garden_using_subcommand exec" -s q -l quiet -d 'Be quiet'
complete -c garden -n "__fish_garden_using_subcommand exec" -s v -l verbose -d 'Increase verbosity level (default: 0)'
complete -c garden -n "__fish_garden_using_subcommand exec" -s h -l help -d 'Print help'
complete -c garden -n "__fish_garden_using_subcommand git" -s t -l trees -d 'Filter trees by name post-query using a glob pattern' -r
complete -c garden -n "__fish_garden_using_subcommand git" -s j -l jobs -d 'Run commands in parallel using the specified number of jobs' -r
complete -c garden -n "__fish_garden_using_subcommand git" -s N -l dry-run -d 'Perform a trial run without executing any commands'
complete -c garden -n "__fish_garden_using_subcommand git" -s q -l quiet -d 'Be quiet'
complete -c garden -n "__fish_garden_using_subcommand git" -s v -l verbose -d 'Increase verbosity level (default: 0)'
complete -c garden -n "__fish_garden_using_subcommand git" -s h -l help -d 'Print help'
complete -c garden -n "__fish_garden_using_subcommand grow" -s t -l trees -d 'Filter trees by name post-query using a glob pattern' -r
complete -c garden -n "__fish_garden_using_subcommand grow" -l remote -d 'Filter remotes by name using a glob pattern' -r
complete -c garden -n "__fish_garden_using_subcommand grow" -s v -l verbose -d 'Increase verbosity level (default: 0)'
complete -c garden -n "__fish_garden_using_subcommand grow" -s h -l help -d 'Print help'
complete -c garden -n "__fish_garden_using_subcommand gui" -s h -l help -d 'Print help'
complete -c garden -n "__fish_garden_using_subcommand init" -l root -d 'Set the garden root path' -r -f -a "(__fish_complete_directories)"
complete -c garden -n "__fish_garden_using_subcommand init" -l empty -d 'Do not add any trees when initializing'
complete -c garden -n "__fish_garden_using_subcommand init" -s f -l force -d 'Overwrite existing config files'
complete -c garden -n "__fish_garden_using_subcommand init" -l global -d 'Use the user-wide configuration directory (~/.config/garden/garden.yaml)'
complete -c garden -n "__fish_garden_using_subcommand init" -s h -l help -d 'Print help'
complete -c garden -n "__fish_garden_using_subcommand ls" -s s -l sort -d 'Sort trees using the specified mode [none, name, time]' -r
complete -c garden -n "__fish_garden_using_subcommand ls" -s t -l trees -d 'Filter trees by name post-query using a glob pattern' -r
complete -c garden -n "__fish_garden_using_subcommand ls" -s a -l all -d 'Display details for all trees, including missing trees'
complete -c garden -n "__fish_garden_using_subcommand ls" -s C -l no-commands -d 'Do not show commands'
complete -c garden -n "__fish_garden_using_subcommand ls" -s c -l commands -d 'Display commands. Omits descriptions, remotes and links so that commands are more visible'
complete -c garden -n "__fish_garden_using_subcommand ls" -s N -l no-gardens -d 'Do not show gardens'
complete -c garden -n "__fish_garden_using_subcommand ls" -s G -l no-groups -d 'Do not show groups'
complete -c garden -n "__fish_garden_using_subcommand ls" -s R -l no-remotes -d 'Do not show remotes'
complete -c garden -n "__fish_garden_using_subcommand ls" -s r -l reverse -d 'Print trees in reverse order'
complete -c garden -n "__fish_garden_using_subcommand ls" -s v -l verbose -d 'Increase verbosity level (default: 0)'
complete -c garden -n "__fish_garden_using_subcommand ls" -s w -l worktrees -d 'Display worktrees'
complete -c garden -n "__fish_garden_using_subcommand ls" -s h -l help -d 'Print help'
complete -c garden -n "__fish_garden_using_subcommand plant" -s o -l output -d 'Garden configuration file to write [default: "garden.yaml"]' -r
complete -c garden -n "__fish_garden_using_subcommand plant" -s s -l sort -d 'Sort all trees after planting new trees'
complete -c garden -n "__fish_garden_using_subcommand plant" -s v -l verbose -d 'Increase verbosity level (default: 0)'
complete -c garden -n "__fish_garden_using_subcommand plant" -s h -l help -d 'Print help'
complete -c garden -n "__fish_garden_using_subcommand prune" -s j -l jobs -d 'Prune repositories in parallel using the specified number of jobs' -r
complete -c garden -n "__fish_garden_using_subcommand prune" -s d -l max-depth -d 'Set the maximum prune depth' -r
complete -c garden -n "__fish_garden_using_subcommand prune" -l min-depth -d 'Only prune starting at the given depth' -r
complete -c garden -n "__fish_garden_using_subcommand prune" -l exact-depth -d 'Only prune at the exact depth. Alias for \'--min-depth=# --max-depth=#\'' -r
complete -c garden -n "__fish_garden_using_subcommand prune" -l no-prompt -d 'Prune all repositories without prompting (DANGER!)'
complete -c garden -n "__fish_garden_using_subcommand prune" -l rm -d 'Enable deletion [default: deletion is disabled]'
complete -c garden -n "__fish_garden_using_subcommand prune" -s h -l help -d 'Print help'
complete -c garden -n "__fish_garden_using_subcommand shell" -s v -l verbose -d 'Increase verbosity level (default: 0)'
complete -c garden -n "__fish_garden_using_subcommand shell" -s h -l help -d 'Print help'
complete -c garden -n "__fish_garden_using_subcommand help; and not __fish_seen_subcommand_from cmd completion eval exec git grow gui init ls plant prune shell help" -f -a "cmd" -d 'Run custom commands over gardens'
complete -c garden -n "__fish_garden_using_subcommand help; and not __fish_seen_subcommand_from cmd completion eval exec git grow gui init ls plant prune shell help" -f -a "completion" -d 'Generate shell completions'
complete -c garden -n "__fish_garden_using_subcommand help; and not __fish_seen_subcommand_from cmd completion eval exec git grow gui init ls plant prune shell help" -f -a "eval" -d 'Evaluate garden expressions'
complete -c garden -n "__fish_garden_using_subcommand help; and not __fish_seen_subcommand_from cmd completion eval exec git grow gui init ls plant prune shell help" -f -a "exec" -d 'Run commands inside garden environments'
complete -c garden -n "__fish_garden_using_subcommand help; and not __fish_seen_subcommand_from cmd completion eval exec git grow gui init ls plant prune shell help" -f -a "git" -d 'Execute Git commands'
complete -c garden -n "__fish_garden_using_subcommand help; and not __fish_seen_subcommand_from cmd completion eval exec git grow gui init ls plant prune shell help" -f -a "grow" -d 'Grow garden worktrees into existence'
complete -c garden -n "__fish_garden_using_subcommand help; and not __fish_seen_subcommand_from cmd completion eval exec git grow gui init ls plant prune shell help" -f -a "gui" -d 'Garden GUI (run "garden-gui --help" for more details)'
complete -c garden -n "__fish_garden_using_subcommand help; and not __fish_seen_subcommand_from cmd completion eval exec git grow gui init ls plant prune shell help" -f -a "init" -d 'Initialize a "garden.yaml" garden configuration file'
complete -c garden -n "__fish_garden_using_subcommand help; and not __fish_seen_subcommand_from cmd completion eval exec git grow gui init ls plant prune shell help" -f -a "ls" -d 'List available gardens, groups, trees and commands'
complete -c garden -n "__fish_garden_using_subcommand help; and not __fish_seen_subcommand_from cmd completion eval exec git grow gui init ls plant prune shell help" -f -a "plant" -d 'Add pre-existing worktrees to a garden configuration file'
complete -c garden -n "__fish_garden_using_subcommand help; and not __fish_seen_subcommand_from cmd completion eval exec git grow gui init ls plant prune shell help" -f -a "prune" -d 'Remove unreferenced Git repositories'
complete -c garden -n "__fish_garden_using_subcommand help; and not __fish_seen_subcommand_from cmd completion eval exec git grow gui init ls plant prune shell help" -f -a "shell" -d 'Open a shell in a garden environment'
complete -c garden -n "__fish_garden_using_subcommand help; and not __fish_seen_subcommand_from cmd completion eval exec git grow gui init ls plant prune shell help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'

# Generated by garden v2.6.0.
