Merge: lib/opts: accept non-conflicting parameters for OptionString and rename get_er...
authorJean Privat <jean@pryen.org>
Tue, 8 Sep 2015 15:54:28 +0000 (11:54 -0400)
committerJean Privat <jean@pryen.org>
Tue, 8 Sep 2015 15:54:28 +0000 (11:54 -0400)
commita878479de1d89a49aef829bb7854cf4cc77491e3
tree0df1ca4aeb26a60422ff1df8910f738ca686caa9
parent938373216463aa2820bb039dc36f827361fd3c64
parentaf139e100e1ccb296a6ccf5d0fd8953f321c2808
Merge: lib/opts: accept non-conflicting parameters for OptionString and rename get_errors to errors

`OptionString` reads the next argument to be used as its parameter. However, to detect errors it did not read parameter beginning with `-`. This PR changes this behavior to only avoid parameters that are the name of a known option in the current `OptionContext`. This should report real errors and accept parameters beginning with `-`, such parameter are useful to forward options to subprograms.

Renaming `OptionContext::get_errors` to `errors` assign the short name to the most commonly used property. `errors` was previously reserved for errors local to the context only. From the Nit repo, only 2 projects correctly used `get_errors`, 8 wrongfully used `errors` and thus did not catch all errors.

Pull-Request: #1686
Reviewed-by: Jean Privat <jean@pryen.org>