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

Unified Diff: sdk/lib/_internal/pub/lib/src/command/help.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/lib/src/command/help.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command/help.dart b/sdk/lib/_internal/pub/lib/src/command/help.dart
deleted file mode 100644
index d7df22324b3775f7e77a517f255fe972821b12ef..0000000000000000000000000000000000000000
--- a/sdk/lib/_internal/pub/lib/src/command/help.dart
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library pub.command.help;
-
-import 'dart:async';
-
-import '../command.dart';
-
-/// Handles the `help` pub command.
-class HelpCommand extends PubCommand {
- String get description => "Display help information for Pub.";
- String get usage => "pub help [command]";
- bool get takesArguments => true;
-
- Future onRun() {
- // Show the default help if no command was specified.
- if (commandOptions.rest.isEmpty) {
- PubCommand.printGlobalUsage();
- return null;
- }
-
- // Walk the command tree to show help for the selected command or
- // subcommand.
- var commands = PubCommand.mainCommands;
- var command = null;
- var commandString = "pub";
-
- for (var name in commandOptions.rest) {
- if (commands.isEmpty) {
- command.usageError(
- 'Command "$commandString" does not expect a subcommand.');
- }
-
- if (commands[name] == null) {
- if (command == null) {
- PubCommand.usageErrorWithCommands(commands,
- 'Could not find a command named "$name".');
- }
-
- command.usageError(
- 'Could not find a subcommand named "$name" for "$commandString".');
- }
-
- command = commands[name];
- commands = command.subcommands;
- commandString += " $name";
- }
-
- command.printUsage();
- return null;
- }
-}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/global_run.dart ('k') | sdk/lib/_internal/pub/lib/src/command/lish.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698