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).
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: 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. -
Values that look like switches or nodes (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. -
Ordering (DECIDED): contextual
-options may depend on order (NS-7);+free flags are order-independent. -
PROPOSED: a bare
name=valueassignment (no hyphen, as indd if=) where the namespace declares the name (NS-15 switch kinds).