Renderingen-US

option

Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.

Declares a CLI option annotation.

Syntax: @ option <binding> [short \"x\"] [longum \"name\"] [typus <type>] [descriptio \"...\"] [ubique] [vel <default>]

Category#

cli

Examples#

radix/corpus/annotation-sugar/optio-braced.fab (canonical · annotation)#

Braced canonical @ option CLI option record.

# =============================================================================
# option — Braced canonical @ option CLI option record.
# =============================================================================
#
# What this teaches:
#   • Braced option annotation — `@ option { binding = NAME, … }` configures a
#     CLI option with named fields
#   • Option fields — binding, short, long, type, description, and global
#     control how the option is parsed and documented
#
# Common mistakes:
#   • omitting required fields like `binding` or `long` in `@ option` braced records; boolean flags need `type bool`
#
# See also: option, cli, annotation-sugar
# =============================================================================

# Braced @ option — canonical option record
#
# TARGET: annotation-sugar stage 2
# PAIR: sugar `@ option NAME short \"x\" ...` (see option/optio.fab)

@ cli { name = "optio-braced-smoke" }
@ option { binding = verbose, short = "v", long = "verbose", type = bool, description = "Verbose mode", global = true }
main args args {
}

radix/corpus/optio/optio.fab (canonical · keyword)#

Declares a CLI option annotation.

# =============================================================================
# option — Declares a CLI option annotation.
# =============================================================================
#
# What this teaches:
#   • CLI options — `@option` declares named flags (short and long forms) for CLI subcommands.
#   • Option metadata — Each option specifies binding, type, description, and optional default values.
#
# Common mistakes:
#   • Declaring a boolean option without at least one of short or long — boolean flags need a flag form to be usable.
#
# See also: operand, cli, command, global, vel
# =============================================================================

# option — CLI option annotation
#
# GRAMMAR:
#   annotation :← '@' 'option' optionSpec
#
# EXPECTED OUTPUT:
#   No main — declaration or test-runner surface only.
#
# BACKEND:
#   declaration-only CLI metadata (whitelist: option/optio.fab).
#

@ cli "optio-smoke"
@ option verbose short "v" long "verbose" type bool description "Verbose mode"
@ option count long "count" type int description "Repeat count"
main args args {
}