romantic_common 0.0.4 romantic_common: ^0.0.4 copied to clipboard
Package including lot helpers for easy developing on dart language.
romantic_common #
Package including lot helpers for easy developing on dart language.
Usage #
args #
argParse #
- rule: (1) You need to configure the order of commands
class BrickFromCommand extends MasonCommandBase {
/// construct throught [CommandAdapter]
BrickFromCommand()
: super(
'bundleF',
exampleKey,
'Get brick template from bundle or dart.',
['bf', 'bundle_from'],
///<<<<<<<<<<<>>>>>>>>>>>
[MasonParseEnum.bundlePath, MasonParseEnum.outputDir],
);
(2) If the argument is option,(-xxx), you can use cli in any order
final derivedArgResult0 =
command.argParser.parse(['--json-path', bundlePath, '-o', outdir.path]);
final argResult3 = command.argParser.parse([bundlePath, outdir.path]);
...
///>>>>>>
(3) The rest unmatched arguments will be matched sequentially with those configured in (1) but not matched in (2)
expect(derivedArgResult0.dict('bundle-path', -1), bundlePath);
expect(derivedArgResult0.dict('output-dir', -1), outdir.path);
expect(argResult3.dict('bundle-path', 0), bundlePath);
expect(argResult3.dict('output-dir', 1), outdir.path);
get propty util #
mixin MasonPropMixin on IArgument2Statistical<MasonParseEnum> {
String get bundlePath => statistical.enumParse(MasonParseEnum.bundlePath);
/// in this example, bundlePath would be simple use to handle command.
Additional information #
TODO: Tell users more about the package: where to find more information, how to contribute to the package, how to file issues, what response they can expect from the package authors, and more.