ordinaryd 0.7.0

Ordinary Server
Documentation
#compdef ordinaryd

autoload -U is-at-least

_ordinaryd() {
    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[@]}" : \
'--data-dir=[specify the data directory]:DATA_DIR:_default' \
'--stdio-logs-fmt=[how to format stdio logs]:STDIO_LOGS_FMT:(concise pretty json)' \
'--log-level=[base log level for every component]:LOG_LEVEL:(error warn info debug trace)' \
'--stored-logs[persists JSON formatted log lines to <data-dir>/logs/<domain>/]' \
'--stdio-logs[logs events to stdio]' \
'--journald-logs[logs events to \`journald\` (only works on Linux distros that use \`systemd\`)]' \
'--log-sizes[whether storage and certain payload sizes are logged]' \
'--stdio-logs-timing[whether span timing is logged]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_ordinaryd_commands" \
"*::: :->ordinaryd" \
&& ret=0
    case $state in
    (ordinaryd)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:ordinaryd-command-$line[1]:"
        case $line[1] in
            (init)
_arguments "${_arguments_options[@]}" : \
'--environment=[environment (e.g production, development, staging)]:ENVIRONMENT:_default' \
'--storage-size=[Storage size in bytes (rounded up to nearest OS page size)]:STORAGE_SIZE:_default' \
'--api-domain=[domain name for API console]:API_DOMAIN:_default' \
'--password=[instance user password]:PASSWORD:_default' \
'*--api-contacts=[contacts for the API domain cert provisioning]:API_CONTACTS:_default' \
'*--app-domains=[domains that apps can subdomain off of]:APP_DOMAINS:_default' \
'*--privileged-domains=[list of applications that have access to API server level commands (i.e. API server invite token generation)]::PRIVILEGED_DOMAINS:_default' \
'--data-dir=[specify the data directory]:DATA_DIR:_default' \
'--stdio-logs-fmt=[how to format stdio logs]:STDIO_LOGS_FMT:(concise pretty json)' \
'--log-level=[base log level for every component]:LOG_LEVEL:(error warn info debug trace)' \
'--mfa-stored[store the MFA key locally instead of copying a QR code]' \
'--stored-logs[persists JSON formatted log lines to <data-dir>/logs/<domain>/]' \
'--stdio-logs[logs events to stdio]' \
'--journald-logs[logs events to \`journald\` (only works on Linux distros that use \`systemd\`)]' \
'--log-sizes[whether storage and certain payload sizes are logged]' \
'--stdio-logs-timing[whether span timing is logged]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(api)
_arguments "${_arguments_options[@]}" : \
'--environment=[environment (e.g production, development, staging)]:ENVIRONMENT:_default' \
'--storage-size=[Storage size in bytes (rounded up to nearest OS page size)]:STORAGE_SIZE:_default' \
'--provision=[what mode TLS certs should be provisioned in]:PROVISION:(staging production localhost)' \
'--port=[specify HTTP(s) port for server]:PORT:_default' \
'--redirect-port=[specify HTTP port for server when running in secure mode]:REDIRECT_PORT:_default' \
'--log-ttl-hours=[max period of time logs are stored]:LOG_TTL_HOURS:_default' \
'--log-rotation-file-size=[max size (in bytes) per log file]:LOG_ROTATION_FILE_SIZE:_default' \
'--log-rotation-mins=[max amount of time a log file is appended to before being compressed and stored]:LOG_ROTATION_MINS:_default' \
'--redacted-header-hash=["none" | "blake2" | "blake3"]:REDACTED_HEADER_HASH:_default' \
'--data-dir=[specify the data directory]:DATA_DIR:_default' \
'--stdio-logs-fmt=[how to format stdio logs]:STDIO_LOGS_FMT:(concise pretty json)' \
'--log-level=[base log level for every component]:LOG_LEVEL:(error warn info debug trace)' \
'--insecure[run without HTTPS]' \
'--insecure-cookies[run with insecure cookies]' \
'--log-headers[whether HTTP request and response headers are logged]' \
'--log-ips[whether IP Addresses are logged with HTTP requests]' \
'--danger-dns-no-verify[set to \`true\` to bypass verification of proxy domain and CNAME DNS TXT records]' \
'--dedicated-ports[give each app its own port]' \
'--swagger[Storage size in bytes (rounded up to nearest OS page size)]' \
'--stored-logs[persists JSON formatted log lines to <data-dir>/logs/<domain>/]' \
'--stdio-logs[logs events to stdio]' \
'--journald-logs[logs events to \`journald\` (only works on Linux distros that use \`systemd\`)]' \
'--log-sizes[whether storage and certain payload sizes are logged]' \
'--stdio-logs-timing[whether span timing is logged]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(app)
_arguments "${_arguments_options[@]}" : \
'--provision=[what mode TLS certs should be provisioned in]:PROVISION:(staging production localhost)' \
'--port=[specify HTTP(s) port for server]:PORT:_default' \
'--redirect-port=[specify HTTP port for server when running in secure mode]:REDIRECT_PORT:_default' \
'--log-ttl-hours=[max period of time logs are stored]:LOG_TTL_HOURS:_default' \
'--log-rotation-file-size=[max size (in bytes) per log file]:LOG_ROTATION_FILE_SIZE:_default' \
'--log-rotation-mins=[max amount of time a log file is appended to before being compressed and stored]:LOG_ROTATION_MINS:_default' \
'--redacted-header-hash=["none" | "blake2" | "blake3"]:REDACTED_HEADER_HASH:_default' \
'-p+[for running a standalone project. (project must already be built)]:PROJECT:_default' \
'--project=[for running a standalone project. (project must already be built)]:PROJECT:_default' \
'--domain-override=[use a different domain than what'\''s in the \`ordinary.json\`]:DOMAIN_OVERRIDE:_default' \
'--data-dir=[specify the data directory]:DATA_DIR:_default' \
'--stdio-logs-fmt=[how to format stdio logs]:STDIO_LOGS_FMT:(concise pretty json)' \
'--log-level=[base log level for every component]:LOG_LEVEL:(error warn info debug trace)' \
'--insecure[run without HTTPS]' \
'--insecure-cookies[run with insecure cookies]' \
'--log-headers[whether HTTP request and response headers are logged]' \
'--log-ips[whether IP Addresses are logged with HTTP requests]' \
'--danger-dns-no-verify[set to \`true\` to bypass verification of proxy domain and CNAME DNS TXT records]' \
'--stored-logs[persists JSON formatted log lines to <data-dir>/logs/<domain>/]' \
'--stdio-logs[logs events to stdio]' \
'--journald-logs[logs events to \`journald\` (only works on Linux distros that use \`systemd\`)]' \
'--log-sizes[whether storage and certain payload sizes are logged]' \
'--stdio-logs-timing[whether span timing is logged]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_ordinaryd__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:ordinaryd-help-command-$line[1]:"
        case $line[1] in
            (init)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(api)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(app)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_ordinaryd_commands] )) ||
_ordinaryd_commands() {
    local commands; commands=(
'init:initialize the environment for an Ordinary API server' \
'api:start the Ordinary API server' \
'app:start an Ordinary Application server' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'ordinaryd commands' commands "$@"
}
(( $+functions[_ordinaryd__subcmd__api_commands] )) ||
_ordinaryd__subcmd__api_commands() {
    local commands; commands=()
    _describe -t commands 'ordinaryd api commands' commands "$@"
}
(( $+functions[_ordinaryd__subcmd__app_commands] )) ||
_ordinaryd__subcmd__app_commands() {
    local commands; commands=()
    _describe -t commands 'ordinaryd app commands' commands "$@"
}
(( $+functions[_ordinaryd__subcmd__help_commands] )) ||
_ordinaryd__subcmd__help_commands() {
    local commands; commands=(
'init:initialize the environment for an Ordinary API server' \
'api:start the Ordinary API server' \
'app:start an Ordinary Application server' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'ordinaryd help commands' commands "$@"
}
(( $+functions[_ordinaryd__subcmd__help__subcmd__api_commands] )) ||
_ordinaryd__subcmd__help__subcmd__api_commands() {
    local commands; commands=()
    _describe -t commands 'ordinaryd help api commands' commands "$@"
}
(( $+functions[_ordinaryd__subcmd__help__subcmd__app_commands] )) ||
_ordinaryd__subcmd__help__subcmd__app_commands() {
    local commands; commands=()
    _describe -t commands 'ordinaryd help app commands' commands "$@"
}
(( $+functions[_ordinaryd__subcmd__help__subcmd__help_commands] )) ||
_ordinaryd__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'ordinaryd help help commands' commands "$@"
}
(( $+functions[_ordinaryd__subcmd__help__subcmd__init_commands] )) ||
_ordinaryd__subcmd__help__subcmd__init_commands() {
    local commands; commands=()
    _describe -t commands 'ordinaryd help init commands' commands "$@"
}
(( $+functions[_ordinaryd__subcmd__init_commands] )) ||
_ordinaryd__subcmd__init_commands() {
    local commands; commands=()
    _describe -t commands 'ordinaryd init commands' commands "$@"
}

if [ "$funcstack[1]" = "_ordinaryd" ]; then
    _ordinaryd "$@"
else
    compdef _ordinaryd ordinaryd
fi