العرضar

خيار

Translation status: العربية reader-locale proof. Term names and code fences follow the ar pack; supporting prose may still be English.

Declares a CLI option annotation.

Syntax: @ خيار <binding> [مختصر \"x\"] [longum \"name\"] [typus <type>] [descriptio \"...\"] [ubique] [vel <default>]

Category#

cli

Examples#

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

Braced canonical @ خيار CLI option record.

# =============================================================================
# خيار — Braced canonical @ خيار CLI option record.
# =============================================================================
#
# What this teaches:
#   • Braced option annotation — `@ خيار { binding = NAME, … }` configures a
#     CLI option with named fields
#   • Option fields — binding, مختصر, مفصل, نمط, وصف, and عمومي
#     control how the option is parsed and documented
#
# Common mistakes:
#   • omitting required fields like `binding` or `مفصل` in `@ خيار` braced records; boolean flags need `نمط منطقي`
#
# See also: خيار, cli, annotation-sugar
# =============================================================================

# Braced @ خيار — canonical option record
#
# TARGET: annotation-sugar stage 2
# PAIR: sugar `@ خيار NAME مختصر \"x\" ...` (see خيار/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.

# =============================================================================
# خيار — Declares a CLI option annotation.
# =============================================================================
#
# What this teaches:
#   • CLI options — `@خيار` 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 خيار without at least one of مختصر or مفصل — boolean flags need a flag form to be usable.
#
# See also: معامل, cli, أمر, عمومي, vel
# =============================================================================

# خيار — CLI option annotation
#
# GRAMMAR:
#   annotation :← '@' 'خيار' optionSpec
#
# EXPECTED OUTPUT:
#   No بداية — declaration or test-runner surface only.
#
# BACKEND:
#   declaration-only CLI metadata (whitelist: خيار/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 {
}