args
Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.
Binds command-line arguments for an entry point.
Syntax: main args <name> <block> | fn <name>() args <name> <block>
Category#
entry
Related#
Examples#
radix/corpus/argumenta/argumenta.fab (canonical · keyword)#
Binds command-line arguments for an entry point.
# =============================================================================
# args — Binds command-line arguments for an entry point.
# =============================================================================
#
# What this teaches:
# • CLI entry binding — `main args <name>` declares a program entry
# that receives command-line arguments
# • Annotation-driven CLI — `@ cli`, `@ description`, and `main args`
# work together to define a structured CLI interface
#
# Common mistakes:
# • attaching `@ cli` to a `fn` instead of an `main` (SEM009), or forgetting to annotate with `@ cli` before `main args`
#
# See also: main, cli, command, option, operand
# =============================================================================
# args — CLI entry operand binding
#
# GRAMMAR:
# entryDecl :← 'main' 'args' ident block
#
# EXPECTED OUTPUT:
# No main — declaration or test-runner surface only.
#
# BACKEND:
# declaration-only CLI entry (whitelist: args/argumenta.fab).
#
@ cli "argumenta-smoke"
@ description "argumenta exemplum"
main args args {
}