-
Notifications
You must be signed in to change notification settings - Fork 0
Arguments
A combination of 2 sorts of syntax is used for the parsing.
Native data-structures parsed by Fish, for helpText.
- Familiar
- Evaluated even before passed the actual program by the shell
- Multiple equifinal ways
Currently, there is only one positional argument, so the order of the arguments doesn't matter (regardless of type)
Simply pass the string after the Base Command.
Flags that don't accept or require a value can simply be passed just like Positional arguments, with the limitation that each flag must be passed before -- is.
If the flag accepts a single value, use the flag once. Multiple uses overwrite the previous value.
Instead of passing the flag multiple times, you can simply use {} with the , delimeter to pass multiple values.
help-text --<long-flag>={
…,
…,
…
}
-<s>{
…,
…,
}Those values (…) contain the Self-parsed Syntax.
Syntax for data-structures unavailable natively in Fish.
The header and the descriptions are separated by |.
help-text --<flag>='<header> | <description>'- [Positionals](Arguments/Individual/Switches/Switch: Positional.md)
- [Flags](Arguments/Individual/Switches/Switch: Flag.md)
Important
The punctuation (; , .) in the descriptions on each of the switches is automatically dimmed
- Limited: The syntax parsed by the program itself only includes division of certain sections in the text, since most of the parsing is handled by native Fish data-structures.
-
Inescapable: The only escaping ever possible in the self-parsed syntax would be
|splitting and+prefixes (in case of fixed number of arguments) in headers; these are very unlikely to literally appear in those, and hence, escaping is not an option.
[^arg-dir]: The direction of the arguments can be both from the left and the right. This determines if the index value displayed to the user would be positive (left) or negative. Negative indices are the only choice for arguments followed by variable arguments
[^single-vararg]: There can only be one variable positional argument since there is no way of determining if an argument is a fixed argument or a variable argument, and if a variable argument, then which one
[^index]: The index of the variable argument will simply be a +, while the followed positionals will be negatively indexed, and the rest of the positionals (before the variable positionals) will be positively indexed (like they do without any variable argument)