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

Side by Side Diff: sdk/lib/_internal/pub/bin/pub.dart

Issue 23272002: Command to print paths to dependencies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove unused variable. Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/command.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 import 'dart:math' as math; 7 import 'dart:math' as math;
8 8
9 import 'package:args/args.dart'; 9 import 'package:args/args.dart';
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 // Show the commands sorted. 145 // Show the commands sorted.
146 buffer.write('Available commands:\n'); 146 buffer.write('Available commands:\n');
147 147
148 // TODO(rnystrom): A sorted map would be nice. 148 // TODO(rnystrom): A sorted map would be nice.
149 int length = 0; 149 int length = 0;
150 var names = <String>[]; 150 var names = <String>[];
151 for (var command in PubCommand.commands.keys) { 151 for (var command in PubCommand.commands.keys) {
152 // Hide aliases. 152 // Hide aliases.
153 if (PubCommand.commands[command].aliases.indexOf(command) >= 0) continue; 153 if (PubCommand.commands[command].aliases.indexOf(command) >= 0) continue;
154
155 // Hide undocumented commands.
156 if (PubCommand.commands[command].hidden) continue;
157
154 length = math.max(length, command.length); 158 length = math.max(length, command.length);
155 names.add(command); 159 names.add(command);
156 } 160 }
157 161
158 names.sort((a, b) => a.compareTo(b)); 162 names.sort((a, b) => a.compareTo(b));
159 163
160 for (var name in names) { 164 for (var name in names) {
161 buffer.write(' ${padRight(name, length)} ' 165 buffer.write(' ${padRight(name, length)} '
162 '${PubCommand.commands[name].description}\n'); 166 '${PubCommand.commands[name].description}\n');
163 } 167 }
164 168
165 buffer.write('\n'); 169 buffer.write('\n');
166 buffer.write( 170 buffer.write(
167 'Use "pub help [command]" for more information about a command.'); 171 'Use "pub help [command]" for more information about a command.');
168 log.message(buffer.toString()); 172 log.message(buffer.toString());
169 } 173 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/command.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698