Skip to content

Arguments

Drazape edited this page May 13, 2026 · 1 revision

A combination of 2 sorts of syntax is used for the parsing.

Fish Native

Native data-structures parsed by Fish, for helpText.

Features

  • Familiar
  • Evaluated even before passed the actual program by the shell
  • Multiple equifinal ways

Usage: Arguments

Currently, there is only one positional argument, so the order of the arguments doesn't matter (regardless of type)

Positional

Simply pass the string after the Base Command.

Flags

Value-less

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.

Value

Single

If the flag accepts a single value, use the flag once. Multiple uses overwrite the previous value.

Multiple

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.

Self-parsed

Syntax for data-structures unavailable natively in Fish.

Usage

Common

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

Features

  • 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)

Clone this wiki locally