| Index: bin/generate.dart
|
| diff --git a/bin/generate.dart b/bin/generate.dart
|
| index 7eea3462909d833c46c8d0dba5880967897ce920..56f0837bd184945d49b2abd9b33cb58a3e2ad8c0 100755
|
| --- a/bin/generate.dart
|
| +++ b/bin/generate.dart
|
| @@ -19,6 +19,8 @@ ArgParser downloadCommandArgParser() {
|
|
|
| ArgParser runConfigCommandArgParser() {
|
| return new ArgParser()
|
| + ..addCommand('download')
|
| + ..addCommand('generate')
|
| ..addOption('config-file',
|
| help: 'Configuration file describing package generation.',
|
| defaultsTo: 'config.yaml');
|
| @@ -80,8 +82,22 @@ void main(List<String> arguments) {
|
| downloadDiscoveryDocuments(commandOptions['output-dir']);
|
| break;
|
| case 'run_config':
|
| + if (commandOptions.command == null ||
|
| + !['download', 'generate'].contains(commandOptions.command.name)) {
|
| + dieWithUsage('The `run_config` command has only the two subcommands: '
|
| + '`download` and `generate`.');
|
| + }
|
| +
|
| var configFile = commandOptions['config-file'];
|
| - generateFromConfiguration(configFile).then((_) => print('Done!'));
|
| + switch (commandOptions.command.name) {
|
| + case 'download':
|
| + downloadFromConfiguration(configFile).then((_) => print('Done!'));
|
| + break;
|
| + case 'generate':
|
| + generateFromConfiguration(configFile);
|
| + print('Done');
|
| + break;
|
| + }
|
| break;
|
| }
|
| }
|
|
|