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

Unified Diff: sdk/lib/_internal/pub/lib/src/command/deps.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/deps.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command/deps.dart b/sdk/lib/_internal/pub/lib/src/command/deps.dart
index fd397b699b08072d2988aa2f2ed2ee11fe0def39..7b1bafc8a591ac080a11fd70144b8e6be77dafbd 100644
--- a/sdk/lib/_internal/pub/lib/src/command/deps.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/deps.dart
@@ -16,10 +16,12 @@ import '../utils.dart';
/// Handles the `deps` pub command.
class DepsCommand extends PubCommand {
+ String get name => "deps";
String get description => "Print package dependencies.";
List<String> get aliases => const ["dependencies", "tab"];
- String get usage => "pub deps";
+ String get invocation => "pub deps";
String get docUrl => "http://dartlang.org/tools/pub/cmd/pub-deps.html";
+ bool get takesArguments => false;
/// The loaded package graph.
PackageGraph _graph;
@@ -28,20 +30,20 @@ class DepsCommand extends PubCommand {
StringBuffer _buffer;
DepsCommand() {
- commandParser.addOption("style", abbr: "s",
+ argParser.addOption("style", abbr: "s",
help: "How output should be displayed.",
allowed: ["compact", "tree", "list"],
defaultsTo: "tree");
}
- Future onRun() {
+ Future run() {
return entrypoint.loadPackageGraph().then((graph) {
_graph = graph;
_buffer = new StringBuffer();
_buffer.writeln(_labelPackage(entrypoint.root));
- switch (commandOptions["style"]) {
+ switch (argResults["style"]) {
case "compact": _outputCompact(); break;
case "list": _outputList(); break;
case "tree": _outputTree(); break;
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/cache_repair.dart ('k') | sdk/lib/_internal/pub/lib/src/command/downgrade.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698