-
Notifications
You must be signed in to change notification settings - Fork 0
Positional
Arguments recognised by their position
| Long | Short | Exclusive |
|---|---|---|
positional |
p |
Sub-Command |
Note
The program doesn't stop you from using it with Sub-Command, but there isn't really a use-case to do so
There are 4 Types of positional arguments, each having a different syntax used on the header:
When all the arguments appear a fixed number of time, then the header is simply a string, without any special syntax (prefix).
If there are variable argumnets
Prepend the variable argument's position [^single-vararg] with a +. This will affect the index of all the positionals that follows. [^index]
Tip
Try fooling around by prefixing + on different positions to know how it would affect the index counts
If arguments are optional, then you would use the earlier two types for the most part, but include a new row telling the user what happens when no argument is specified, with the header prefixed with a -.
Warning
Don't use this if the command throws an error when supplied no positional arguments
The header can be anything you like, e.g.:
- None
- Null
- Empty
- Current (in case of programs that take a path as argument{,s}; not a standard, just an example)
Note
The 3 positional arguments types above can by simultaneously used (Until multiple types aren't used on a single positional)
Don't pass the Positional switch if positional arguments aren't accepted.
Each header matched in the descriptions is automatically italicized