You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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]);
newPubApp.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.
The text was updated successfully, but these errors were encountered:
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:
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.
The text was updated successfully, but these errors were encountered: