Command-line argument errors
When an osh command line is being processed, any tokens that do not correspond to an argument description are taken to be error tokens.
An error message is generated for each error token, with the arg token number and text included in the error message. The engine then discards the error token and attempts to process the next argument token according to the argument description.
In a subargument list, an unrecognized argument token terminates the subargument list. The engine then checks any constraints, and processes other subarguments of the enclosing argument list.
When an argument token is seen that matches one of the argument descriptions, subsequent argument tokens are processed using the assumption that the argument has been correctly matched. Any local discrepancies such as a bad value, a bad subargument list, and so on, are reported along with the argument tokens making up the argument being processed and any usage-style information relating to the argument.
When an argument list is terminated, the constraints are checked for such aspects as occurrence restrictions, exclusivity, and implies relationships; and any violations are reported with the appropriate contextual information, including the argument instances involved and appropriate usage-style information describing the violated constraints.