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

Unified Diff: pkg/polymer/lib/builder.dart

Issue 27903006: Improves how to initialize polymer apps and fixes polymer build and linter to (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
Index: pkg/polymer/lib/builder.dart
diff --git a/pkg/polymer/lib/builder.dart b/pkg/polymer/lib/builder.dart
index 32ad168b6c19fe0d5f0bd856d9610a54c5101d40..11f401bfd5d4608cf5cbc571d97a71458f770608 100644
--- a/pkg/polymer/lib/builder.dart
+++ b/pkg/polymer/lib/builder.dart
@@ -301,19 +301,31 @@ CommandLineOptions parseOptions([List<String> args]) {
defaultsTo: 'out')
..addFlag('js', help:
'deploy replaces *.dart scripts with *.dart.js. This flag \n'
- 'leaves "packages/browser/dart.js" to do the replacement at runtime.'
+ 'leaves "packages/browser/dart.js" to do the replacement at runtime.',
defaultsTo: true)
..addFlag('csp', help:
'replaces *.dart with *.dart.precompiled.js to comply with \n'
- 'Content Security Policy restrictions.');
+ 'Content Security Policy restrictions.')
..addFlag('help', abbr: 'h',
negatable: false, help: 'Displays this help and exit.');
- var res = parser.parse(args == null ? new Options().arguments : args);
- if (res['help']) {
- print('A build script that invokes the polymer linter and deploy tools.');
+
+ showUsage() {
print('Usage: dart build.dart [options]');
print('\nThese are valid options expected by build.dart:');
print(parser.getUsage());
+ }
+
+ var res;
+ try {
+ res = parser.parse(args == null ? new Options().arguments : args);
+ } on FormatException catch (e) {
+ print(e.message);
+ showUsage();
+ exit(1);
+ }
+ if (res['help']) {
+ print('A build script that invokes the polymer linter and deploy tools.');
+ showUsage();
exit(0);
}
return new CommandLineOptions(res['changed'], res['removed'], res['clean'],
« no previous file with comments | « pkg/polymer/example/component/news/test/news_index_test.html ('k') | pkg/polymer/lib/src/build/import_inliner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698