mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 01:13:30 +00:00
Add a mechanism for recording *all* command line args.
This should allow programs to report bad command line arguments
(such as --i-am-not-an-option) and still keep going, if they wish.
library/getopt_io.m:
Add record_all_arguments, a version of the existing record_arguments
predicate that processes the entire command line even in the presence
of errors.
To make this possible, rewrite record_arguments' existing code
to separate out the handling of individual options from the code
that decides whether to stop processing. The code of both
record_arguments and record_all_arguments is now a thin veneer
on top of the new record_argument (singular) predicate, which
does the first job above. The separation of concerns and the new,
documented data structures should also make the new code easier
to understand.
library/getopt.m:
Automatic copy of the new getopt_io.m.
NEWS.md:
Announce the new predicate.
RELEASE_NOTES_NEXT:
Add a reminder about deleting getopt_io.m.
This commit is contained in:
@@ -8,6 +8,9 @@ after that, remove the option, and always generate an error.
|
||||
After the release, delete from io.m the predicates that simply forward
|
||||
the work to one of the submodules we carved off io.m years ago.
|
||||
|
||||
After the release, delete getopt_io.m, and the make rules that construct
|
||||
getopt.m from it.
|
||||
|
||||
For each of the quoted-x-flag options, delete its original x-flag version.
|
||||
|
||||
Delete the --warn-interface-imports option name synonym.
|
||||
|
||||
Reference in New Issue
Block a user