#compdef acceptarium

autoload -U is-at-least

_acceptarium() {
    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[@]}" : \
'-p+[Set project root path]:PROJECT:_files -/' \
'--project=[Set project root path]:PROJECT:_files -/' \
'*-c+[Override a configuration value (can be passed multiple times)]:KEY:_default:KEY:_default' \
'*--config=[Override a configuration value (can be passed multiple times)]:KEY:_default:KEY:_default' \
'--config-file=[Path to a TOML config file, relative to project root]:CONFIG_FILE:_files' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-n[Run actions in dry run mode that checks everything but makes no changes]' \
'--dry-run[Run actions in dry run mode that checks everything but makes no changes]' \
'--no-dry-run[]' \
'-d[Allow changing Git state even when repository is dirty]' \
'--dirty[Allow changing Git state even when repository is dirty]' \
'--no-dirty[]' \
'--overwrite[Overwrite existing extracted transaction data]' \
'--no-overwrite[]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_acceptarium_commands" \
"*::: :->acceptarium" \
&& ret=0
    case $state in
    (acceptarium)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:acceptarium-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" : \
'-t[Automatically commit imported asset to VCS tracker (if configured)]' \
'--commit[Automatically commit imported asset to VCS tracker (if configured)]' \
'--no-commit[]' \
'-c[Copy the source file from its current location into the configured data directory]' \
'--copy[Copy the source file from its current location into the configured data directory]' \
'--no-copy[]' \
'-r[Rename source files using the internal asset ID when copying to data folder]' \
'--rename[Rename source files using the internal asset ID when copying to data folder]' \
'--no-rename[]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
'*::files -- Files to add as assets (at least one required):_files' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
'--tracked[View only assets currently tracked in VCS (if configured)]' \
'--no-tracked[]' \
'-a[Operate on all known assets]' \
'--all[Operate on all known assets]' \
'-p[Operate only on assets have been marked as processed]' \
'--processed[Operate only on assets have been marked as processed]' \
'-u[Operate only on assets that have not been marked as processed]' \
'--unprocessed[Operate only on assets that have not been marked as processed]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
'*::ids -- Operate on a list of asset ID(s):_default' \
&& ret=0
;;
(process)
_arguments "${_arguments_options[@]}" : \
'--processor=[Choose a specific image processor]:PROCESSOR:(manual ocr vision)' \
'--extractor=[Choose a specific data extractor]:EXTRACTOR:(manual llm regex vision)' \
'-a[Operate on all known assets]' \
'--all[Operate on all known assets]' \
'-p[Operate only on assets have been marked as processed]' \
'--processed[Operate only on assets have been marked as processed]' \
'-u[Operate only on assets that have not been marked as processed]' \
'--unprocessed[Operate only on assets that have not been marked as processed]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
'*::ids -- Operate on a list of asset ID(s):_default' \
&& ret=0
;;
(dump)
_arguments "${_arguments_options[@]}" : \
'-f+[Data format to target]:FORMAT:(hjson json toml yaml xml)' \
'--format=[Data format to target]:FORMAT:(hjson json toml yaml xml)' \
'-a[Operate on all known assets]' \
'--all[Operate on all known assets]' \
'-p[Operate only on assets have been marked as processed]' \
'--processed[Operate only on assets have been marked as processed]' \
'-u[Operate only on assets that have not been marked as processed]' \
'--unprocessed[Operate only on assets that have not been marked as processed]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
'*::ids -- Operate on a list of asset ID(s):_default' \
&& ret=0
;;
(export)
_arguments "${_arguments_options[@]}" : \
'-f+[Ledger format to target]:FORMAT:(hledger ledger-cli beancount custom)' \
'--format=[Ledger format to target]:FORMAT:(hledger ledger-cli beancount custom)' \
'-a[Operate on all known assets]' \
'--all[Operate on all known assets]' \
'-p[Operate only on assets have been marked as processed]' \
'--processed[Operate only on assets have been marked as processed]' \
'-u[Operate only on assets that have not been marked as processed]' \
'--unprocessed[Operate only on assets that have not been marked as processed]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
'*::ids -- Operate on a list of asset ID(s):_default' \
&& ret=0
;;
(get)
_arguments "${_arguments_options[@]}" : \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
':id -- Asset ID to look up:_default' \
':key -- Metadata key for which to return the value:_default' \
&& ret=0
;;
(set)
_arguments "${_arguments_options[@]}" : \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
':id -- Asset ID to modify:_default' \
':key -- Metadata key to set:_default' \
':value -- Value to set:_default' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
'-a[Operate on all known assets]' \
'--all[Operate on all known assets]' \
'-p[Operate only on assets have been marked as processed]' \
'--processed[Operate only on assets have been marked as processed]' \
'-u[Operate only on assets that have not been marked as processed]' \
'--unprocessed[Operate only on assets that have not been marked as processed]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
'*::ids -- Operate on a list of asset ID(s):_default' \
&& ret=0
;;
(run)
_arguments "${_arguments_options[@]}" : \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
':name -- Name of script supplied either by Acceptarium or a local project:_command_names -e' \
'*::arguments -- Arguments to pass to script being run:_default' \
&& ret=0
;;
(status)
_arguments "${_arguments_options[@]}" : \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(tui)
_arguments "${_arguments_options[@]}" : \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_acceptarium__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:acceptarium-help-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(process)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(dump)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(export)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(run)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(status)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(tui)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_acceptarium_commands] )) ||
_acceptarium_commands() {
    local commands; commands=(
'add:Import an asset file and begin tracking via the configured storage' \
'list:List known assets' \
'process:Process an asset to extract data' \
'dump:Output an asset to a structured data format' \
'export:Output an asset to a PTA format' \
'get:Get metadata for a specific asset by ID' \
'set:Set metadata for a specific asset by ID' \
'remove:Remove an asset and its metadata' \
'run:Execute a script as a child process that inherits Acceptarium environment' \
'status:Show status information about configuration, and state' \
'tui:TUI for interactively reviewing and managing assets' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'acceptarium commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__add_commands] )) ||
_acceptarium__subcmd__add_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium add commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__dump_commands] )) ||
_acceptarium__subcmd__dump_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium dump commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__export_commands] )) ||
_acceptarium__subcmd__export_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium export commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__get_commands] )) ||
_acceptarium__subcmd__get_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium get commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__help_commands] )) ||
_acceptarium__subcmd__help_commands() {
    local commands; commands=(
'add:Import an asset file and begin tracking via the configured storage' \
'list:List known assets' \
'process:Process an asset to extract data' \
'dump:Output an asset to a structured data format' \
'export:Output an asset to a PTA format' \
'get:Get metadata for a specific asset by ID' \
'set:Set metadata for a specific asset by ID' \
'remove:Remove an asset and its metadata' \
'run:Execute a script as a child process that inherits Acceptarium environment' \
'status:Show status information about configuration, and state' \
'tui:TUI for interactively reviewing and managing assets' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'acceptarium help commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__help__subcmd__add_commands] )) ||
_acceptarium__subcmd__help__subcmd__add_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium help add commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__help__subcmd__dump_commands] )) ||
_acceptarium__subcmd__help__subcmd__dump_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium help dump commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__help__subcmd__export_commands] )) ||
_acceptarium__subcmd__help__subcmd__export_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium help export commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__help__subcmd__get_commands] )) ||
_acceptarium__subcmd__help__subcmd__get_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium help get commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__help__subcmd__help_commands] )) ||
_acceptarium__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium help help commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__help__subcmd__list_commands] )) ||
_acceptarium__subcmd__help__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium help list commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__help__subcmd__process_commands] )) ||
_acceptarium__subcmd__help__subcmd__process_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium help process commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__help__subcmd__remove_commands] )) ||
_acceptarium__subcmd__help__subcmd__remove_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium help remove commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__help__subcmd__run_commands] )) ||
_acceptarium__subcmd__help__subcmd__run_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium help run commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__help__subcmd__set_commands] )) ||
_acceptarium__subcmd__help__subcmd__set_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium help set commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__help__subcmd__status_commands] )) ||
_acceptarium__subcmd__help__subcmd__status_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium help status commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__help__subcmd__tui_commands] )) ||
_acceptarium__subcmd__help__subcmd__tui_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium help tui commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__list_commands] )) ||
_acceptarium__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium list commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__process_commands] )) ||
_acceptarium__subcmd__process_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium process commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__remove_commands] )) ||
_acceptarium__subcmd__remove_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium remove commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__run_commands] )) ||
_acceptarium__subcmd__run_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium run commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__set_commands] )) ||
_acceptarium__subcmd__set_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium set commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__status_commands] )) ||
_acceptarium__subcmd__status_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium status commands' commands "$@"
}
(( $+functions[_acceptarium__subcmd__tui_commands] )) ||
_acceptarium__subcmd__tui_commands() {
    local commands; commands=()
    _describe -t commands 'acceptarium tui commands' commands "$@"
}

if [ "$funcstack[1]" = "_acceptarium" ]; then
    _acceptarium "$@"
else
    compdef _acceptarium acceptarium
fi
