This repository has been archived by the owner on May 21, 2024. It is now read-only.
Argument parsing for required and optional arguments should have a flexible order #31
Labels
feature request
Proposition for a new feature or improvement
The current argument parsing system for commands enforces a strict order of the types of arguments, which proceeds as:
#[rest]
argumentEach type of argument may be absent, but violating this order will result in a macro error. What this issue proposes, however, is to break the strict order for required and optional arguments. This would allow for backtracking when parsing arguments for a command.
For example, for the following command:
no error would originate from the macro. Instead, if just one argument is given,
user2
will beNone
, whileuser
will be populated with the argument. And in the case of two arguments,user2
will be the first argument, anduser
the second argument.Order between required/optional arguments and a variadic/
#[rest]
argument will stay the same and will have to be uphold.The text was updated successfully, but these errors were encountered: