Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: bin/generate.dart

Issue 1085593003: Split `run_config` into `run_config download` and `run_config generate`. (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.md ('k') | lib/googleapis_generator.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « README.md ('k') | lib/googleapis_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698