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

Side by Side Diff: utils/pub/command_list.dart

Issue 10941049: Remove "pub list" command. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove dead code. Created 8 years, 3 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 | utils/pub/pub.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
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.
4
5 #library('command_list');
6
7 #import('package.dart');
8 #import('pub.dart');
9
10 /**
11 * Handles the `list` pub command. This is mostly just used so we can pull
12 * some basic data out of pub in the integration tests. Once pub is more
13 * full-featured and has other commands that test everything it does, this
14 * may go away.
15 */
16 class ListCommand extends PubCommand {
17 String get description => 'print the contents of repositories';
18 String get usage => 'pub list';
19
20 Future onRun() {
21 // TODO(nweiz): also list the contents of the packages directory when it's
22 // able to determine the source of its packages (that is, when we have a
23 // lockfile).
24 return cache.listAll().transform((ids) {
25 _printIds('system cache', ids);
26 });
27 }
28
29 _printIds(String title, List<PackageId> ids) {
30 ids = new List<PackageId>.from(ids);
31 ids.sort((a, b) => a.compareTo(b));
32
33 print('From $title:');
34 for (var id in ids) {
35 print(' $id');
36 }
37 }
38 }
OLDNEW
« no previous file with comments | « no previous file | utils/pub/pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698