-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
Followup of #281 in support of #175.
@Task
annotated methods will be able to use the same exact API as unscripted to define method parameters that represent positionals, options, and flags, and have those discovered and injected with command-line arguments.
For example:
@Task()
bump(
@Positional(help: 'The type of release being performed.', allowed: const ['major', 'minor', 'patch', 'build', 'release'])
String releaseType),
{@Option(help: 'Do a pre-release with this prefix e.g. "dev"')
String preId,
@Flag(help: 'Whether to do a pre-release')
bool pre} {
var args = ['bump', releaseType];
if (pre) args.add('--pre');
if (preId != null) args.addAll(['--pre-id', preId]);
new PubApp.global('den').run(args);
}
As in unscripted, all metadata (Positional
, Option
, Flag
and their parameters) is optional.
This will require a lot of the same code existing in unscripted, so I may need to factor that out into a shared library or package along with some of the code that went in in #281.
enyo, martflu and queltos
Metadata
Metadata
Assignees
Labels
No labels