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

Unified Diff: sdk/lib/_internal/pub_generated/lib/src/command/lish.dart

Issue 805393002: Update pub to use the new command runner API in args. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 5 years, 11 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: sdk/lib/_internal/pub_generated/lib/src/command/lish.dart
diff --git a/sdk/lib/_internal/pub_generated/lib/src/command/lish.dart b/sdk/lib/_internal/pub_generated/lib/src/command/lish.dart
index 279ddda6579304bcda93ad870747be6b583465af..ef5840e430232641badc81e71774423925a506b5 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/command/lish.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/command/lish.dart
@@ -20,16 +20,18 @@ import '../validator.dart';
/// Handles the `lish` and `publish` pub commands.
class LishCommand extends PubCommand {
+ String get name => "publish";
String get description => "Publish the current package to pub.dartlang.org.";
- String get usage => "pub publish [options]";
+ String get invocation => "pub publish [options]";
String get docUrl => "http://dartlang.org/tools/pub/cmd/pub-lish.html";
List<String> get aliases => const ["lish", "lush"];
+ bool get takesArguments => false;
/// The URL of the server to which to upload the package.
Uri get server {
// An explicit argument takes precedence.
- if (commandOptions.wasParsed('server')) {
- return Uri.parse(commandOptions['server']);
+ if (argResults.wasParsed('server')) {
+ return Uri.parse(argResults['server']);
}
// Otherwise, use the one specified in the pubspec.
@@ -42,23 +44,23 @@ class LishCommand extends PubCommand {
}
/// Whether the publish is just a preview.
- bool get dryRun => commandOptions['dry-run'];
+ bool get dryRun => argResults['dry-run'];
/// Whether the publish requires confirmation.
- bool get force => commandOptions['force'];
+ bool get force => argResults['force'];
LishCommand() {
- commandParser.addFlag(
+ argParser.addFlag(
'dry-run',
abbr: 'n',
negatable: false,
help: 'Validate but do not publish the package.');
- commandParser.addFlag(
+ argParser.addFlag(
'force',
abbr: 'f',
negatable: false,
help: 'Publish without confirmation if there are no errors.');
- commandParser.addOption(
+ argParser.addOption(
'server',
defaultsTo: HostedSource.defaultUrl,
help: 'The package server to which to upload this package.');
@@ -118,9 +120,9 @@ class LishCommand extends PubCommand {
});
}
- Future onRun() {
+ Future run() {
if (force && dryRun) {
- usageError('Cannot use both --force and --dry-run.');
+ usageException('Cannot use both --force and --dry-run.');
}
if (entrypoint.root.pubspec.isPrivate) {

Powered by Google App Engine
This is Rietveld 408576698