#compdef dedrunk

autoload -U is-at-least

_dedrunk() {
    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[@]}" : \
'-c+[Dedrunk Ratslang override file]:PATH:_files' \
'--config=[Dedrunk Ratslang override file]:PATH:_files' \
'*-o+[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'*--override=[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'-y[Answer yes to overwrite prompts]' \
'--yes[Answer yes to overwrite prompts]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_dedrunk_commands" \
"*::: :->dedrunk" \
&& ret=0
    case $state in
    (dedrunk)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:dedrunk-command-$line[1]:"
        case $line[1] in
            (noise)
_arguments "${_arguments_options[@]}" : \
'-O+[Kalibr YAML to write]:PATH:_files' \
'--output=[Kalibr YAML to write]:PATH:_files' \
'--csv=[Where to write the Allan deviation curves for plotting]:PATH:_files' \
'-c+[Dedrunk Ratslang override file]:PATH:_files' \
'--config=[Dedrunk Ratslang override file]:PATH:_files' \
'*-o+[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'*--override=[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'-y[Answer yes to overwrite prompts]' \
'--yes[Answer yes to overwrite prompts]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':bag -- The MCAP recording, bag directory, or marina dataset tag:_files' \
&& ret=0
;;
(intrinsics)
_arguments "${_arguments_options[@]}" : \
'-O+[Kalibr YAML to write]:PATH:_files' \
'--output=[Kalibr YAML to write]:PATH:_files' \
'-c+[Dedrunk Ratslang override file]:PATH:_files' \
'--config=[Dedrunk Ratslang override file]:PATH:_files' \
'*-o+[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'*--override=[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'-y[Answer yes to overwrite prompts]' \
'--yes[Answer yes to overwrite prompts]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':bag -- The MCAP recording, bag directory, or marina dataset tag:_files' \
&& ret=0
;;
(extrinsics)
_arguments "${_arguments_options[@]}" : \
'--imu-bag=[Bag holding the IMU, or marina dataset tag, if it is not the same one]:PATH:_files' \
'-c+[Dedrunk Ratslang override file]:PATH:_files' \
'--config=[Dedrunk Ratslang override file]:PATH:_files' \
'*-o+[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'*--override=[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'-y[Answer yes to overwrite prompts]' \
'--yes[Answer yes to overwrite prompts]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':bag -- Bag holding the Lidar-only odometry, or marina dataset tag:_files' \
&& ret=0
;;
(merge)
_arguments "${_arguments_options[@]}" : \
'-O+[Kalibr YAML to write]:PATH:_files' \
'--output=[Kalibr YAML to write]:PATH:_files' \
'-c+[Dedrunk Ratslang override file]:PATH:_files' \
'--config=[Dedrunk Ratslang override file]:PATH:_files' \
'*-o+[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'*--override=[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'-y[Answer yes to overwrite prompts]' \
'--yes[Answer yes to overwrite prompts]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':intrinsics -- File to take the deterministic parameters from:_files' \
':noise -- File to take the noise parameters from:_files' \
&& ret=0
;;
(show)
_arguments "${_arguments_options[@]}" : \
'-c+[Dedrunk Ratslang override file]:PATH:_files' \
'--config=[Dedrunk Ratslang override file]:PATH:_files' \
'*-o+[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'*--override=[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'-y[Answer yes to overwrite prompts]' \
'--yes[Answer yes to overwrite prompts]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':path -- The Kalibr YAML file:_files' \
&& ret=0
;;
(topics)
_arguments "${_arguments_options[@]}" : \
'-c+[Dedrunk Ratslang override file]:PATH:_files' \
'--config=[Dedrunk Ratslang override file]:PATH:_files' \
'*-o+[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'*--override=[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'-y[Answer yes to overwrite prompts]' \
'--yes[Answer yes to overwrite prompts]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':bag -- The MCAP recording, bag directory, or marina dataset tag:_files' \
&& ret=0
;;
(config)
_arguments "${_arguments_options[@]}" : \
'-c+[Dedrunk Ratslang override file]:PATH:_files' \
'--config=[Dedrunk Ratslang override file]:PATH:_files' \
'*-o+[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'*--override=[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'-y[Answer yes to overwrite prompts]' \
'--yes[Answer yes to overwrite prompts]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_dedrunk__subcmd__config_commands" \
"*::: :->config" \
&& ret=0

    case $state in
    (config)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:dedrunk-config-command-$line[1]:"
        case $line[1] in
            (generate)
_arguments "${_arguments_options[@]}" : \
'-c+[Dedrunk Ratslang override file]:PATH:_files' \
'--config=[Dedrunk Ratslang override file]:PATH:_files' \
'*-o+[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'*--override=[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'-y[Answer yes to overwrite prompts]' \
'--yes[Answer yes to overwrite prompts]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':kind -- Which configuration to generate:(recommended full)' \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" : \
'-c+[Dedrunk Ratslang override file]:PATH:_files' \
'--config=[Dedrunk Ratslang override file]:PATH:_files' \
'*-o+[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'*--override=[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'-y[Answer yes to overwrite prompts]' \
'--yes[Answer yes to overwrite prompts]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::path -- The configuration file to verify. Use '\''-'\'' to read from stdin:_files' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_dedrunk__subcmd__config__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:dedrunk-config-help-command-$line[1]:"
        case $line[1] in
            (generate)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'-c+[Dedrunk Ratslang override file]:PATH:_files' \
'--config=[Dedrunk Ratslang override file]:PATH:_files' \
'*-o+[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'*--override=[Override one setting, as KEY=VALUE. Repeatable]:KEY=VALUE:_default' \
'-y[Answer yes to overwrite prompts]' \
'--yes[Answer yes to overwrite prompts]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::shell -- The shell whose completion script should be printed:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_dedrunk__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:dedrunk-help-command-$line[1]:"
        case $line[1] in
            (noise)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(intrinsics)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(extrinsics)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(merge)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(show)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(topics)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(config)
_arguments "${_arguments_options[@]}" : \
":: :_dedrunk__subcmd__help__subcmd__config_commands" \
"*::: :->config" \
&& ret=0

    case $state in
    (config)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:dedrunk-help-config-command-$line[1]:"
        case $line[1] in
            (generate)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_dedrunk_commands] )) ||
_dedrunk_commands() {
    local commands; commands=(
'noise:Noise densities and bias random walks, from a long stationary recording' \
'intrinsics:Scale, misalignment and biases, from a multi-orientation recording' \
'extrinsics:Where the IMU sits relative to the Lidar, from a Lidar-only trajectory' \
'merge:Combine a noise result and an intrinsics result into one Kalibr file' \
'show:Print what a Kalibr YAML file contains' \
'topics:List the IMU and odometry topics in a recording' \
'config:Create or validate configuration files' \
'completions:Install shell completions, or print them for a specific shell' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'dedrunk commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__completions_commands] )) ||
_dedrunk__subcmd__completions_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk completions commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__config_commands] )) ||
_dedrunk__subcmd__config_commands() {
    local commands; commands=(
'generate:Generate a configuration. Choose '\''recommended'\'' for the settings most runs touch, or '\''full'\'' for the complete annotated defaults' \
'verify:Compile a configuration file and check it against the defaults' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'dedrunk config commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__config__subcmd__generate_commands] )) ||
_dedrunk__subcmd__config__subcmd__generate_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk config generate commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__config__subcmd__help_commands] )) ||
_dedrunk__subcmd__config__subcmd__help_commands() {
    local commands; commands=(
'generate:Generate a configuration. Choose '\''recommended'\'' for the settings most runs touch, or '\''full'\'' for the complete annotated defaults' \
'verify:Compile a configuration file and check it against the defaults' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'dedrunk config help commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__config__subcmd__help__subcmd__generate_commands] )) ||
_dedrunk__subcmd__config__subcmd__help__subcmd__generate_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk config help generate commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__config__subcmd__help__subcmd__help_commands] )) ||
_dedrunk__subcmd__config__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk config help help commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__config__subcmd__help__subcmd__verify_commands] )) ||
_dedrunk__subcmd__config__subcmd__help__subcmd__verify_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk config help verify commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__config__subcmd__verify_commands] )) ||
_dedrunk__subcmd__config__subcmd__verify_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk config verify commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__extrinsics_commands] )) ||
_dedrunk__subcmd__extrinsics_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk extrinsics commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__help_commands] )) ||
_dedrunk__subcmd__help_commands() {
    local commands; commands=(
'noise:Noise densities and bias random walks, from a long stationary recording' \
'intrinsics:Scale, misalignment and biases, from a multi-orientation recording' \
'extrinsics:Where the IMU sits relative to the Lidar, from a Lidar-only trajectory' \
'merge:Combine a noise result and an intrinsics result into one Kalibr file' \
'show:Print what a Kalibr YAML file contains' \
'topics:List the IMU and odometry topics in a recording' \
'config:Create or validate configuration files' \
'completions:Install shell completions, or print them for a specific shell' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'dedrunk help commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__help__subcmd__completions_commands] )) ||
_dedrunk__subcmd__help__subcmd__completions_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk help completions commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__help__subcmd__config_commands] )) ||
_dedrunk__subcmd__help__subcmd__config_commands() {
    local commands; commands=(
'generate:Generate a configuration. Choose '\''recommended'\'' for the settings most runs touch, or '\''full'\'' for the complete annotated defaults' \
'verify:Compile a configuration file and check it against the defaults' \
    )
    _describe -t commands 'dedrunk help config commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__help__subcmd__config__subcmd__generate_commands] )) ||
_dedrunk__subcmd__help__subcmd__config__subcmd__generate_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk help config generate commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__help__subcmd__config__subcmd__verify_commands] )) ||
_dedrunk__subcmd__help__subcmd__config__subcmd__verify_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk help config verify commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__help__subcmd__extrinsics_commands] )) ||
_dedrunk__subcmd__help__subcmd__extrinsics_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk help extrinsics commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__help__subcmd__help_commands] )) ||
_dedrunk__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk help help commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__help__subcmd__intrinsics_commands] )) ||
_dedrunk__subcmd__help__subcmd__intrinsics_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk help intrinsics commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__help__subcmd__merge_commands] )) ||
_dedrunk__subcmd__help__subcmd__merge_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk help merge commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__help__subcmd__noise_commands] )) ||
_dedrunk__subcmd__help__subcmd__noise_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk help noise commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__help__subcmd__show_commands] )) ||
_dedrunk__subcmd__help__subcmd__show_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk help show commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__help__subcmd__topics_commands] )) ||
_dedrunk__subcmd__help__subcmd__topics_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk help topics commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__intrinsics_commands] )) ||
_dedrunk__subcmd__intrinsics_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk intrinsics commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__merge_commands] )) ||
_dedrunk__subcmd__merge_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk merge commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__noise_commands] )) ||
_dedrunk__subcmd__noise_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk noise commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__show_commands] )) ||
_dedrunk__subcmd__show_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk show commands' commands "$@"
}
(( $+functions[_dedrunk__subcmd__topics_commands] )) ||
_dedrunk__subcmd__topics_commands() {
    local commands; commands=()
    _describe -t commands 'dedrunk topics commands' commands "$@"
}

if [ "$funcstack[1]" = "_dedrunk" ]; then
    _dedrunk "$@"
else
    compdef _dedrunk dedrunk
fi
