Kết xuấtvi

tùy_chọn

Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi pack; supporting prose may still be English.

Declares a CLI option annotation.

Syntax: @ tùy_chọn <binding> [ngắn \"x\"] [longum \"name\"] [typus <type>] [descriptio \"...\"] [ubique] [vel <default>]

Category#

cli

Examples#

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

Braced canonical @ tùy_chọn CLI option record.

# =============================================================================
# tùy_chọn — Braced canonical @ tùy_chọn CLI option record.
# =============================================================================
#
# What this teaches:
#   • Braced option annotation — `@ tùy_chọn { binding = NAME, … }` configures a
#     CLI option with named fields
#   • Option fields — binding, ngắn, dài, kiểu_tên, mô_tả, and toàn_cục
#     control how the option is parsed and documented
#
# Common mistakes:
#   • omitting required fields like `binding` or `dài` in `@ tùy_chọn` braced records; boolean flags need `kiểu_tên logic`
#
# See also: tùy_chọn, cli, annotation-sugar
# =============================================================================

# Braced @ tùy_chọn — canonical option record
#
# TARGET: annotation-sugar stage 2
# PAIR: sugar `@ tùy_chọn NAME ngắn \"x\" ...` (see tùy_chọn/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.

# =============================================================================
# tùy_chọn — Declares a CLI option annotation.
# =============================================================================
#
# What this teaches:
#   • CLI options — `@tùy_chọn` 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 tùy_chọn without at least one of ngắn or dài — boolean flags need a flag form to be usable.
#
# See also: toán_hạng, cli, lệnh, toàn_cục, vel
# =============================================================================

# tùy_chọn — CLI option annotation
#
# GRAMMAR:
#   annotation :← '@' 'tùy_chọn' optionSpec
#
# EXPECTED OUTPUT:
#   No bắt_đầu — declaration or test-runner surface only.
#
# BACKEND:
#   declaration-only CLI metadata (whitelist: tùy_chọn/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 {
}