args_simple 1.2.1
args_simple: ^1.2.1 copied to clipboard
a simple argument parser and handler, integrated with JSON and dart:io.
1.2.1 #
ArgsSimple:- Fixed
argument/option/property(and the typed*AsInt,*AsDouble,*AsBool, ... accessors) throwing aTypeErrorwhen a value can't be parsed (e.g.--port abcwithoptionAsInt('port', 8080)): they now return the default (ornull).
- Fixed
TypeParser:- Fixed
parseMap/parseMapEntrythrowing aTypeErrorfor a key without a value (parseMap<String, String>('a;b=1')) when the value type is non-nullable: the entry is now skipped byparseMap({'b': '1'}) andparseMapEntryreturnsdef. A nullable/dynamic value type still keeps the key with anullvalue.
- Fixed
- Tests: added edge-case tests (empty input,
--,--key=value,=in values, repeated options/flags/properties,-P/-Dprefixes, negative numbers vs. flags, quoting, unicode),parse -> toList -> parseround-trips, and end-to-end tests running real processes (the example CLI, and a script comparing realargvparsing with in-process parsing). Tests: 69 -> 127. Line coverage: 99.3% -> 100%. - GitHub CI: the Codecov upload now uses the
CODECOV_TOKENsecret and fails CI on error.
1.2.0 #
-
ArgsSimple:toList: an option given more than once (stored as aList) is now emitted as one--key valuepair per value, sotoListround-trips throughparse(it used to emit--key [v1, v2]).
-
TypeParser:parseMapEntry/parseMap: fixed whitespace around the key/value delimiter leaking into the value ('a = 1'gave the value'= 1').- Use
Iterable.nonNullsinstead of the deprecatedwhereNotNullfrompackage:collection.
-
Removed unnecessary library names.
-
Removed dependency
collection(no longer used). -
Tests: added unit tests for
TypeParser,TypeParserIO, theArgsSimpleaccessors,fromJson, serialization and thedart:ioextension, plus integration tests running the example CLI. Line coverage: 31.5% -> 99.3%. -
GitHub CI:
actions/checkout@v7,codecov/codecov-action@v7; tests run on SDK 3.13.0 and stable. -
sdk: ^3.13.0
-
yaml: ^3.1.4
-
lints: ^6.1.0
-
test: ^1.33.0
-
dependency_validator: ^5.1.0
-
coverage: ^1.16.0
1.1.0 #
-
ArgsSimple:parse: allow multiple values for the same option.- Added
flagOr.
-
sdk: '>=3.0.0 <4.0.0'
-
collection: ^1.18.0
-
yaml: ^3.1.2
-
lints: ^2.1.1
-
test: ^1.24.9
-
dependency_validator: ^3.2.2
-
coverage: ^1.7.1
1.0.0 #
- Initial version.