渲染zh-Hant

可選項

Translation status: 繁體中文 reader-locale proof. Term names and code fences follow the zh-Hant pack; supporting prose may still be English.

Binds CLI options metadata to a function declaration.

Syntax: 函式 <name>(...) 可選項 <ident> → <type>

Category#

entry

Examples#

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

Binds CLI options metadata to a function declaration.

# =============================================================================
# 可選項 — Binds CLI options metadata to a function declaration.
# =============================================================================
#
# What this teaches:
#   • Options bundle — The `可選項 <ident> → <type>` syntax attaches a CLI options struct to a function.
#   • Declaration syntax — Options are declared as a modifier on the function signature, after the parameter list.
#
# Common mistakes:
#   • Duplicate flag definitions in 可選項 — each short and long flag must be unique within the CLI surface.
#
# See also: 引數, 端點
# =============================================================================

# 可選項 — CLI options bundle on 函式
#
# GRAMMAR:
#   funcModifier :← ')' '可選項' ident '→' type
#
# EXPECTED OUTPUT:
#   No 入口 — declaration or test-runner surface only.
#
# BACKEND:
#   declaration-only CLI binding (whitelist: 可選項/optiones.fab).
#

fn mitte() options Opts → string {
    return "ok"
}