#compdef nickel

autoload -U is-at-least

_nickel() {
    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[@]}" : \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_nickel_commands" \
"*::: :->nickel-lang-cli" \
&& ret=0
    case $state in
    (nickel-lang-cli)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:nickel-command-$line[1]:"
        case $line[1] in
            (eval)
_arguments "${_arguments_options[@]}" : \
'*--apply-contract=[Validates the final configuration against a contract specified as a Nickel file. If this argument is used multiple times, all specified contracts will be applied sequentially]:APPLY_CONTRACT:_files' \
'()--stdin-format=[Specify the format of the input from stdin]:STDIN_FORMAT:(nickel json yaml toml nix text)' \
'*-I+[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'*--import-path=[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'--field=[Only query or act on a specific field of the configuration. For example, \`nickel export config.ncl --field machines.servers.remote_builder\` will only evaluate and export the content of the \`remote_builder\` field]:FIELD_PATH:_default' \
'--manifest-path=[Path to a package lock file]:MANIFEST_PATH:_files' \
'--package-cache-dir=[Filesystem location for caching fetched packages]:PACKAGE_CACHE_DIR:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::files -- Input files. Omit to read from stdin. If multiple files are provided, the corresponding Nickel expressions are merged (combined with `&`) to produce the result:_files' \
&& ret=0
;;
(pprint-ast)
_arguments "${_arguments_options[@]}" : \
'*--apply-contract=[Validates the final configuration against a contract specified as a Nickel file. If this argument is used multiple times, all specified contracts will be applied sequentially]:APPLY_CONTRACT:_files' \
'*-I+[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'*--import-path=[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'--manifest-path=[Path to a package lock file]:MANIFEST_PATH:_files' \
'--package-cache-dir=[Filesystem location for caching fetched packages]:PACKAGE_CACHE_DIR:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--transform[Performs code transformations before printing]' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::files -- Input files. Omit to read from stdin. If multiple files are provided, the corresponding Nickel expressions are merged (combined with `&`) to produce the result:_files' \
&& ret=0
;;
(export)
_arguments "${_arguments_options[@]}" : \
'-f+[]:FORMAT:((text\:"Evaluate a Nickel expression to a string and write that text to the output Note\: \`raw\` is a deprecated alias for \`text\`; prefer \`text\` instead"
json\:""
yaml\:""
yaml-documents\:"Like \`Yaml\`, but generates multiple YAML documents in a single file, separated by \`---\`. The output data must be a list\: each list element is converted into its own document"
toml\:""))' \
'--format=[]:FORMAT:((text\:"Evaluate a Nickel expression to a string and write that text to the output Note\: \`raw\` is a deprecated alias for \`text\`; prefer \`text\` instead"
json\:""
yaml\:""
yaml-documents\:"Like \`Yaml\`, but generates multiple YAML documents in a single file, separated by \`---\`. The output data must be a list\: each list element is converted into its own document"
toml\:""))' \
'-o+[Output file. Standard output by default]:OUTPUT:_files' \
'--output=[Output file. Standard output by default]:OUTPUT:_files' \
'*--apply-contract=[Validates the final configuration against a contract specified as a Nickel file. If this argument is used multiple times, all specified contracts will be applied sequentially]:APPLY_CONTRACT:_files' \
'()--stdin-format=[Specify the format of the input from stdin]:STDIN_FORMAT:(nickel json yaml toml nix text)' \
'*-I+[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'*--import-path=[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'--field=[Only query or act on a specific field of the configuration. For example, \`nickel export config.ncl --field machines.servers.remote_builder\` will only evaluate and export the content of the \`remote_builder\` field]:FIELD_PATH:_default' \
'--manifest-path=[Path to a package lock file]:MANIFEST_PATH:_files' \
'--package-cache-dir=[Filesystem location for caching fetched packages]:PACKAGE_CACHE_DIR:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::files -- Input files. Omit to read from stdin. If multiple files are provided, the corresponding Nickel expressions are merged (combined with `&`) to produce the result:_files' \
&& ret=0
;;
(query)
_arguments "${_arguments_options[@]}" : \
'(--doc --contract --type --default --value)-f+[Export the value and all metadata of selected field in the specified format. Value is exported in its string representation, capped at 80 characters]:FORMAT:(markdown json yaml toml)' \
'(--doc --contract --type --default --value)--format=[Export the value and all metadata of selected field in the specified format. Value is exported in its string representation, capped at 80 characters]:FORMAT:(markdown json yaml toml)' \
'(--doc --contract --type --default --value)-o+[Output file. Standard output by default]:OUTPUT:_files' \
'(--doc --contract --type --default --value)--output=[Output file. Standard output by default]:OUTPUT:_files' \
'*--apply-contract=[Validates the final configuration against a contract specified as a Nickel file. If this argument is used multiple times, all specified contracts will be applied sequentially]:APPLY_CONTRACT:_files' \
'()--stdin-format=[Specify the format of the input from stdin]:STDIN_FORMAT:(nickel json yaml toml nix text)' \
'*-I+[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'*--import-path=[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'--field=[Only query or act on a specific field of the configuration. For example, \`nickel export config.ncl --field machines.servers.remote_builder\` will only evaluate and export the content of the \`remote_builder\` field]:FIELD_PATH:_default' \
'--manifest-path=[Path to a package lock file]:MANIFEST_PATH:_files' \
'--package-cache-dir=[Filesystem location for caching fetched packages]:PACKAGE_CACHE_DIR:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--doc[]' \
'--contract[]' \
'--type[]' \
'--default[]' \
'--value[]' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::files -- Input files. Omit to read from stdin. If multiple files are provided, the corresponding Nickel expressions are merged (combined with `&`) to produce the result:_files' \
&& ret=0
;;
(typecheck)
_arguments "${_arguments_options[@]}" : \
'*--apply-contract=[Validates the final configuration against a contract specified as a Nickel file. If this argument is used multiple times, all specified contracts will be applied sequentially]:APPLY_CONTRACT:_files' \
'*-I+[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'*--import-path=[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'--manifest-path=[Path to a package lock file]:MANIFEST_PATH:_files' \
'--package-cache-dir=[Filesystem location for caching fetched packages]:PACKAGE_CACHE_DIR:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--strict-typechecking[Start the type-checker in strict mode, so that the entire input is treated as a typed block]' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::files -- Input files. Omit to read from stdin. If multiple files are provided, the corresponding Nickel expressions are merged (combined with `&`) to produce the result:_files' \
&& ret=0
;;
(convert)
_arguments "${_arguments_options[@]}" : \
'()--stdin-format=[Specify the format of the input from stdin]:STDIN_FORMAT:(nickel json yaml toml nix text)' \
'-o+[Output file. Standard output by default]:OUTPUT:_files' \
'--output=[Output file. Standard output by default]:OUTPUT:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help]' \
'--help[Print help]' \
'::file -- Input file. Omit to read from stdin:_files' \
&& ret=0
;;
(package)
_arguments "${_arguments_options[@]}" : \
'--manifest-path=[The location of the package'\''s manifest file]:MANIFEST_PATH:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_nickel__package_commands" \
"*::: :->package" \
&& ret=0

    case $state in
    (package)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:nickel-package-command-$line[1]:"
        case $line[1] in
            (lock)
_arguments "${_arguments_options[@]}" : \
'--manifest-path=[The location of the package'\''s manifest file]:MANIFEST_PATH:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::out -- The path at which to write the lock file:_files' \
&& ret=0
;;
(debug-resolution)
_arguments "${_arguments_options[@]}" : \
'--manifest-path=[The location of the package'\''s manifest file]:MANIFEST_PATH:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(download-deps)
_arguments "${_arguments_options[@]}" : \
'--out-dir=[]:OUT_DIR:_files' \
'--manifest-path=[The location of the package'\''s manifest file]:MANIFEST_PATH:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(publish)
_arguments "${_arguments_options[@]}" : \
'--index=[The location of the index to modify]:INDEX:_files' \
'--package-id=[The package id (like "github\:nickel-lang/json-schema-lib") that you want to publish]:PACKAGE_ID:_default' \
'--manifest-path=[The location of the package'\''s manifest file]:MANIFEST_PATH:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_nickel__package__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:nickel-package-help-command-$line[1]:"
        case $line[1] in
            (lock)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(debug-resolution)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(download-deps)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(publish)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(repl)
_arguments "${_arguments_options[@]}" : \
'--history-file=[]:HISTORY_FILE:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(doc)
_arguments "${_arguments_options[@]}" : \
'-o+[The path of the generated documentation file. Default to \`~/.nickel/doc/<input-file>.md\` for input \`<input-file>.ncl\`, or to \`~/.nickel/doc/out.md\` if the input is read from stdin]:OUTPUT:_files' \
'--output=[The path of the generated documentation file. Default to \`~/.nickel/doc/<input-file>.md\` for input \`<input-file>.ncl\`, or to \`~/.nickel/doc/out.md\` if the input is read from stdin]:OUTPUT:_files' \
'--format=[The output format for the generated documentation]:FORMAT:(json markdown)' \
'*--apply-contract=[Validates the final configuration against a contract specified as a Nickel file. If this argument is used multiple times, all specified contracts will be applied sequentially]:APPLY_CONTRACT:_files' \
'*-I+[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'*--import-path=[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'--field=[Only query or act on a specific field of the configuration. For example, \`nickel export config.ncl --field machines.servers.remote_builder\` will only evaluate and export the content of the \`remote_builder\` field]:FIELD_PATH:_default' \
'--manifest-path=[Path to a package lock file]:MANIFEST_PATH:_files' \
'--package-cache-dir=[Filesystem location for caching fetched packages]:PACKAGE_CACHE_DIR:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--stdout[Write documentation to stdout. Takes precedence over \`output\`]' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::files -- Input files. Omit to read from stdin. If multiple files are provided, the corresponding Nickel expressions are merged (combined with `&`) to produce the result:_files' \
&& ret=0
;;
(test)
_arguments "${_arguments_options[@]}" : \
'*--apply-contract=[Validates the final configuration against a contract specified as a Nickel file. If this argument is used multiple times, all specified contracts will be applied sequentially]:APPLY_CONTRACT:_files' \
'*-I+[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'*--import-path=[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'--field=[Only query or act on a specific field of the configuration. For example, \`nickel export config.ncl --field machines.servers.remote_builder\` will only evaluate and export the content of the \`remote_builder\` field]:FIELD_PATH:_default' \
'--manifest-path=[Path to a package lock file]:MANIFEST_PATH:_files' \
'--package-cache-dir=[Filesystem location for caching fetched packages]:PACKAGE_CACHE_DIR:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::files -- Input files. Omit to read from stdin. If multiple files are provided, the corresponding Nickel expressions are merged (combined with `&`) to produce the result:_files' \
&& ret=0
;;
(format)
_arguments "${_arguments_options[@]}" : \
'*--apply-contract=[Validates the final configuration against a contract specified as a Nickel file. If this argument is used multiple times, all specified contracts will be applied sequentially]:APPLY_CONTRACT:_files' \
'*-I+[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'*--import-path=[Adds a directory to the list of paths to search for imports in]:IMPORT_PATH:_files' \
'--manifest-path=[Path to a package lock file]:MANIFEST_PATH:_files' \
'--package-cache-dir=[Filesystem location for caching fetched packages]:PACKAGE_CACHE_DIR:_files' \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--check[Do not change the input files, instead return non-zero if any of the input file is badly formatted]' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::files -- Input files. Omit to read from stdin. If multiple files are provided, the corresponding Nickel expressions are merged (combined with `&`) to produce the result:_files' \
&& ret=0
;;
(gen-completions)
_arguments "${_arguments_options[@]}" : \
'--color=[Configure when to output messages in color]:COLOR:(auto always never)' \
'--error-format=[Output error messages in a specific format. The schema of serialized errors reflects the way they are currently rendered. This schema is not guaranteed to be stable yet]:ERROR_FORMAT:(text json yaml toml)' \
'--metrics[Print all recorded metrics at the very end of the program]' \
'-h[Print help]' \
'--help[Print help]' \
':shell:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_nickel__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:nickel-help-command-$line[1]:"
        case $line[1] in
            (eval)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(pprint-ast)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(export)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(query)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(typecheck)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(convert)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(package)
_arguments "${_arguments_options[@]}" : \
":: :_nickel__help__package_commands" \
"*::: :->package" \
&& ret=0

    case $state in
    (package)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:nickel-help-package-command-$line[1]:"
        case $line[1] in
            (lock)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(debug-resolution)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(download-deps)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(publish)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(repl)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(doc)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(test)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(format)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(gen-completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_nickel_commands] )) ||
_nickel_commands() {
    local commands; commands=(
'eval:Evaluates a Nickel program and pretty-prints the result' \
'pprint-ast:Converts the parsed representation (AST) back to Nickel source code and prints it. Used for debugging purpose' \
'export:Evaluates a Nickel program and serializes the result to a given format' \
'query:Prints the metadata attached to an attribute, given as a path' \
'typecheck:Typechecks the program but does not run it' \
'convert:Converts from a plain-data format to Nickel' \
'package:Performs packaging and dependency-resolution operations' \
'repl:Starts a REPL session' \
'doc:Generates the documentation files for the a specified nickel file' \
'test:Tests the documentation examples in the specified nickel file' \
'format:Formats Nickel files' \
'gen-completions:Generate shell completion files' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'nickel commands' commands "$@"
}
(( $+functions[_nickel__convert_commands] )) ||
_nickel__convert_commands() {
    local commands; commands=()
    _describe -t commands 'nickel convert commands' commands "$@"
}
(( $+functions[_nickel__doc_commands] )) ||
_nickel__doc_commands() {
    local commands; commands=()
    _describe -t commands 'nickel doc commands' commands "$@"
}
(( $+functions[_nickel__eval_commands] )) ||
_nickel__eval_commands() {
    local commands; commands=()
    _describe -t commands 'nickel eval commands' commands "$@"
}
(( $+functions[_nickel__export_commands] )) ||
_nickel__export_commands() {
    local commands; commands=()
    _describe -t commands 'nickel export commands' commands "$@"
}
(( $+functions[_nickel__format_commands] )) ||
_nickel__format_commands() {
    local commands; commands=()
    _describe -t commands 'nickel format commands' commands "$@"
}
(( $+functions[_nickel__gen-completions_commands] )) ||
_nickel__gen-completions_commands() {
    local commands; commands=()
    _describe -t commands 'nickel gen-completions commands' commands "$@"
}
(( $+functions[_nickel__help_commands] )) ||
_nickel__help_commands() {
    local commands; commands=(
'eval:Evaluates a Nickel program and pretty-prints the result' \
'pprint-ast:Converts the parsed representation (AST) back to Nickel source code and prints it. Used for debugging purpose' \
'export:Evaluates a Nickel program and serializes the result to a given format' \
'query:Prints the metadata attached to an attribute, given as a path' \
'typecheck:Typechecks the program but does not run it' \
'convert:Converts from a plain-data format to Nickel' \
'package:Performs packaging and dependency-resolution operations' \
'repl:Starts a REPL session' \
'doc:Generates the documentation files for the a specified nickel file' \
'test:Tests the documentation examples in the specified nickel file' \
'format:Formats Nickel files' \
'gen-completions:Generate shell completion files' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'nickel help commands' commands "$@"
}
(( $+functions[_nickel__help__convert_commands] )) ||
_nickel__help__convert_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help convert commands' commands "$@"
}
(( $+functions[_nickel__help__doc_commands] )) ||
_nickel__help__doc_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help doc commands' commands "$@"
}
(( $+functions[_nickel__help__eval_commands] )) ||
_nickel__help__eval_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help eval commands' commands "$@"
}
(( $+functions[_nickel__help__export_commands] )) ||
_nickel__help__export_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help export commands' commands "$@"
}
(( $+functions[_nickel__help__format_commands] )) ||
_nickel__help__format_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help format commands' commands "$@"
}
(( $+functions[_nickel__help__gen-completions_commands] )) ||
_nickel__help__gen-completions_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help gen-completions commands' commands "$@"
}
(( $+functions[_nickel__help__help_commands] )) ||
_nickel__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help help commands' commands "$@"
}
(( $+functions[_nickel__help__package_commands] )) ||
_nickel__help__package_commands() {
    local commands; commands=(
'lock:Generate a lock file for a package' \
'debug-resolution:Make a package map and print it out. For internal debugging' \
'download-deps:Download all of a package'\''s non-local dependencies into the given directory' \
'publish:Modify a local copy of the index, by adding a new version of a package' \
    )
    _describe -t commands 'nickel help package commands' commands "$@"
}
(( $+functions[_nickel__help__package__debug-resolution_commands] )) ||
_nickel__help__package__debug-resolution_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help package debug-resolution commands' commands "$@"
}
(( $+functions[_nickel__help__package__download-deps_commands] )) ||
_nickel__help__package__download-deps_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help package download-deps commands' commands "$@"
}
(( $+functions[_nickel__help__package__lock_commands] )) ||
_nickel__help__package__lock_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help package lock commands' commands "$@"
}
(( $+functions[_nickel__help__package__publish_commands] )) ||
_nickel__help__package__publish_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help package publish commands' commands "$@"
}
(( $+functions[_nickel__help__pprint-ast_commands] )) ||
_nickel__help__pprint-ast_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help pprint-ast commands' commands "$@"
}
(( $+functions[_nickel__help__query_commands] )) ||
_nickel__help__query_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help query commands' commands "$@"
}
(( $+functions[_nickel__help__repl_commands] )) ||
_nickel__help__repl_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help repl commands' commands "$@"
}
(( $+functions[_nickel__help__test_commands] )) ||
_nickel__help__test_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help test commands' commands "$@"
}
(( $+functions[_nickel__help__typecheck_commands] )) ||
_nickel__help__typecheck_commands() {
    local commands; commands=()
    _describe -t commands 'nickel help typecheck commands' commands "$@"
}
(( $+functions[_nickel__package_commands] )) ||
_nickel__package_commands() {
    local commands; commands=(
'lock:Generate a lock file for a package' \
'debug-resolution:Make a package map and print it out. For internal debugging' \
'download-deps:Download all of a package'\''s non-local dependencies into the given directory' \
'publish:Modify a local copy of the index, by adding a new version of a package' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'nickel package commands' commands "$@"
}
(( $+functions[_nickel__package__debug-resolution_commands] )) ||
_nickel__package__debug-resolution_commands() {
    local commands; commands=()
    _describe -t commands 'nickel package debug-resolution commands' commands "$@"
}
(( $+functions[_nickel__package__download-deps_commands] )) ||
_nickel__package__download-deps_commands() {
    local commands; commands=()
    _describe -t commands 'nickel package download-deps commands' commands "$@"
}
(( $+functions[_nickel__package__help_commands] )) ||
_nickel__package__help_commands() {
    local commands; commands=(
'lock:Generate a lock file for a package' \
'debug-resolution:Make a package map and print it out. For internal debugging' \
'download-deps:Download all of a package'\''s non-local dependencies into the given directory' \
'publish:Modify a local copy of the index, by adding a new version of a package' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'nickel package help commands' commands "$@"
}
(( $+functions[_nickel__package__help__debug-resolution_commands] )) ||
_nickel__package__help__debug-resolution_commands() {
    local commands; commands=()
    _describe -t commands 'nickel package help debug-resolution commands' commands "$@"
}
(( $+functions[_nickel__package__help__download-deps_commands] )) ||
_nickel__package__help__download-deps_commands() {
    local commands; commands=()
    _describe -t commands 'nickel package help download-deps commands' commands "$@"
}
(( $+functions[_nickel__package__help__help_commands] )) ||
_nickel__package__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'nickel package help help commands' commands "$@"
}
(( $+functions[_nickel__package__help__lock_commands] )) ||
_nickel__package__help__lock_commands() {
    local commands; commands=()
    _describe -t commands 'nickel package help lock commands' commands "$@"
}
(( $+functions[_nickel__package__help__publish_commands] )) ||
_nickel__package__help__publish_commands() {
    local commands; commands=()
    _describe -t commands 'nickel package help publish commands' commands "$@"
}
(( $+functions[_nickel__package__lock_commands] )) ||
_nickel__package__lock_commands() {
    local commands; commands=()
    _describe -t commands 'nickel package lock commands' commands "$@"
}
(( $+functions[_nickel__package__publish_commands] )) ||
_nickel__package__publish_commands() {
    local commands; commands=()
    _describe -t commands 'nickel package publish commands' commands "$@"
}
(( $+functions[_nickel__pprint-ast_commands] )) ||
_nickel__pprint-ast_commands() {
    local commands; commands=()
    _describe -t commands 'nickel pprint-ast commands' commands "$@"
}
(( $+functions[_nickel__query_commands] )) ||
_nickel__query_commands() {
    local commands; commands=()
    _describe -t commands 'nickel query commands' commands "$@"
}
(( $+functions[_nickel__repl_commands] )) ||
_nickel__repl_commands() {
    local commands; commands=()
    _describe -t commands 'nickel repl commands' commands "$@"
}
(( $+functions[_nickel__test_commands] )) ||
_nickel__test_commands() {
    local commands; commands=()
    _describe -t commands 'nickel test commands' commands "$@"
}
(( $+functions[_nickel__typecheck_commands] )) ||
_nickel__typecheck_commands() {
    local commands; commands=()
    _describe -t commands 'nickel typecheck commands' commands "$@"
}

if [ "$funcstack[1]" = "_nickel" ]; then
    _nickel "$@"
else
    compdef _nickel nickel
fi
