SOS Formal Grammar
Standardized Operations Syntax (SOS) replaces loosely defined POSIX guidelines with a strict CFG based on the Standardized Operations Syntax.
Option spelling follows NS-15; switch values follow NS-15 switch kinds. This page summarizes them; where they differ, NS-15 governs.
Switches and values
To prevent "greedy" consumption of positional arguments and ensure unambiguous parsing:
-
REQUIRED:
-flag value. Long options use a single dash; a value switch takes its value as the next, space-separated argument. -
NOT ALLOWED:
-flag=value. Hyphen switches never use=(NS-15). -
DEPRECATED:
--flag value.--longis a legacy alias of-long, scheduled for removal in the next major revision of the standard; frameworks MUST warn about it at build time and at run time (NS-15). In Plus Shell native syntax the--prefix is retired altogether (DECIDED 2026-12-05, NS-15); this bullet is the legacy-shell rule.
Whether a switch takes a value is declared by the tool’s command namespace, so a switch never consumes a positional argument it did not declare. PROPOSED: fixed arity, with no optional values (except level-typed switches, which are DECIDED to take 0 or 1): a plain switch takes 0 values, a value switch exactly 1 (NS-15 switch kinds).
Key Syntax Rules
-
Short aliases: one letter,
-v,-f. There is no implicit bundling:-xvzis the long optionxvz; groups are written-x-v-z. -
Long options:
-verbose,-file path/to/script. -
Hyphen-leading values (DECIDED 2026-11-29): bare hyphen-leading tokens are banned as input values. In
plush, quote them with double quotes (-output "-final.mkv"instead of-output : -final.mkv). In legacy shells (bash/zsh) where quotes are stripped before argv, positional hyphen-leading values fall back to:or./. Future shell scripting should pass structured data instead of text-based string parsing. -
Values that collide with nodes (and legacy-shell escapes) (DECIDED): a lone
:makes the next argument a value, and a lone::makes the rest of the line values (NS-15 token kinds). This replaces the POSIX--terminator; repeated dashes are reserved on the legacy path and retired in Plus Shell native syntax. -
Ordering (DECIDED): contextual
-options may depend on order (NS-7);+free flags are order-independent. -
Intensity is a level value (DECIDED 2026-12-05, replaces the repeated-switch, dash-count and
!suffix mechanisms):-clean 2,-verbose 0, with a schema-declaredleveltype (0to9pluslow,med,high;0means disabled). Alevelswitch takes 0 or 1 value, and the next token is its value only if it is in the declared enum, which is the single exception to fixed arity (NS-15 intensity level). The!/!!suffix remains only as an optional Plus Shell shorthand, with no~fallback; on shells that mangle!it is simply not available (NS-15 intensity suffix, CH-28). -
Nested options and help modes (DECIDED 2026-12-05):
/is the generic namespace separator for the legacy form of records and nesting:-video/codec x264,help/i,-help/i(NS-15, CH-27). Dotted names (-video.codec) are not used, because PowerShell splits them. The first segment is at least two letters (-h/iis rewritten by Git Bash and MSYS2). A token that starts with/is a path and nothing else. -
PROPOSED: a bare
name=valueassignment (no hyphen, as indd if=) where the namespace declares the name (NS-15 switch kinds).