Chromium Code Reviews| Index: utils/pub/command_lish.dart |
| =================================================================== |
| --- utils/pub/command_lish.dart (revision 18263) |
| +++ utils/pub/command_lish.dart (working copy) |
| @@ -32,6 +32,8 @@ |
| var parser = new ArgParser(); |
| // TODO(nweiz): Use HostedSource.defaultUrl as the default value once we use |
| // dart:io for HTTPS requests. |
| + parser.addFlag('preview', abbr: 'p', negatable: false, |
| + help: 'Preview publishing the package'); |
|
nweiz
2013/02/09 00:20:50
Weren't we going to call this --dry-run?
keertip
2013/02/09 00:53:40
Not sure what we settled on in the end, but am OK
nweiz
2013/02/09 00:59:02
I'd prefer --dry-run, since that's consistent with
keertip
2013/02/09 04:05:47
Done.
|
| parser.addOption('server', defaultsTo: 'https://pub.dartlang.org', |
| help: 'The package server to which to upload this package'); |
| return parser; |
| @@ -164,6 +166,11 @@ |
| var s = warnings.length == 1 ? '' : 's'; |
| message = "Package has ${warnings.length} warning$s. Upload anyway"; |
| } |
| + |
| + if (commandOptions['preview']){ |
| + log.warning("Package has ${warnings.length} warnings."); |
|
nweiz
2013/02/09 00:20:50
Nit: it would be nice to do the pluralization tric
keertip
2013/02/09 00:53:40
Done.
|
| + exit(0); |
| + } |
|
nweiz
2013/02/09 00:20:50
Style nit: I'd move this block above the message a
keertip
2013/02/09 00:53:40
Done.
|
| return confirm(message).then((confirmed) { |
| if (!confirmed) throw "Package upload canceled."; |