// 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.

/** Handles the `list` pub command. */
void commandList(PubOptions options, List<String> args) {
  // TODO(rnystrom): Validate args. Right now, this just lists the packages in
  // your cache.
  final cache = new PackageCache(options.cacheDir);
  cache.listAll().then((packages) {
    for (final package in packages) {
      print(package.name);
    }
  });
}
// 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.

/** Handles the `list` pub command. */
void commandList(PubOptions options, List<String> args) {
  // TODO(rnystrom): Validate args. Right now, this just lists the packages in
  // your cache.
  final cache = new PackageCache(options.cacheDir);
  cache.listAll().then((packages) {
    packages.sort((a, b) => a.name.compareTo(b.name));
    for (final package in packages) {
      print(package.name);
    }
  });
}
Sort packages by name before listing them.
Sort packages by name before listing them.

Review URL: https://chromiumcodereview.appspot.com//10191027

git-svn-id: a962b240025cf0577aa172e20f49ccb159ba6be1@6978 260f80e4-7a28-3924-810f-c04153c831b5
