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

Unified Diff: sdk/lib/_internal/pub/lib/src/command_uploader.dart

Issue 15444003: Use args' command support for pub commands. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Initialize command args in constructor. Created 7 years, 7 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 | « sdk/lib/_internal/pub/lib/src/command_update.dart ('k') | sdk/lib/_internal/pub/lib/src/hosted_source.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/command_uploader.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command_uploader.dart b/sdk/lib/_internal/pub/lib/src/command_uploader.dart
index 4097fbdc9a7a89233c04ff11f81cb31003c58c79..2f4208d54835f959c027a629f0c59db236a0c612 100644
--- a/sdk/lib/_internal/pub/lib/src/command_uploader.dart
+++ b/sdk/lib/_internal/pub/lib/src/command_uploader.dart
@@ -15,6 +15,7 @@ import 'command.dart';
import 'entrypoint.dart';
import 'exit_codes.dart' as exit_codes;
import 'http.dart';
+import 'hosted_source.dart';
import 'io.dart';
import 'log.dart' as log;
import 'oauth2.dart' as oauth2;
@@ -26,21 +27,17 @@ class UploaderCommand extends PubCommand {
final usage = "pub uploader [options] {add/remove} <email>";
final requiresEntrypoint = false;
- ArgParser get commandParser {
- var parser = new ArgParser();
- // TODO(nweiz): Use HostedSource.defaultUrl as the default value once we use
- // dart:io for HTTPS requests.
- parser.addOption('server', defaultsTo: 'https://pub.dartlang.org',
- help: 'The package server on which the package is hosted.');
- parser.addOption('package', help: 'The package whose uploaders will be '
- 'modified.\n'
- '(defaults to the current package)');
- return parser;
- }
-
/// The URL of the package hosting server.
Uri get server => Uri.parse(commandOptions['server']);
+ UploaderCommand() {
+ commandParser.addOption('server', defaultsTo: HostedSource.DEFAULT_URL,
+ help: 'The package server on which the package is hosted.');
+ commandParser.addOption('package',
+ help: 'The package whose uploaders will be modified.\n'
+ '(defaults to the current package)');
+ }
+
Future onRun() {
if (commandOptions.rest.isEmpty) {
log.error('No uploader command given.');
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command_update.dart ('k') | sdk/lib/_internal/pub/lib/src/hosted_source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698