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

Side by Side Diff: sdk/lib/_internal/pub_generated/lib/src/command/cache_add.dart

Issue 602253002: Use pub_semver package in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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
OLDNEW
1 library pub.command.cache_add; 1 library pub.command.cache_add;
2 import 'dart:async'; 2 import 'dart:async';
3 import 'package:pub_semver/pub_semver.dart';
3 import '../command.dart'; 4 import '../command.dart';
4 import '../log.dart' as log; 5 import '../log.dart' as log;
5 import '../package.dart'; 6 import '../package.dart';
6 import '../utils.dart'; 7 import '../utils.dart';
7 import '../version.dart';
8 class CacheAddCommand extends PubCommand { 8 class CacheAddCommand extends PubCommand {
9 String get description => "Install a package."; 9 String get description => "Install a package.";
10 String get usage => 10 String get usage =>
11 "pub cache add <package> [--version <constraint>] [--all]"; 11 "pub cache add <package> [--version <constraint>] [--all]";
12 String get docUrl => "http://dartlang.org/tools/pub/cmd/pub-cache.html"; 12 String get docUrl => "http://dartlang.org/tools/pub/cmd/pub-cache.html";
13 bool get takesArguments => true; 13 bool get takesArguments => true;
14 CacheAddCommand() { 14 CacheAddCommand() {
15 commandParser.addFlag( 15 commandParser.addFlag(
16 "all", 16 "all",
17 help: "Install all matching versions.", 17 help: "Install all matching versions.",
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 if (commandOptions["all"]) { 55 if (commandOptions["all"]) {
56 versions.sort(); 56 versions.sort();
57 return Future.forEach(versions, downloadVersion); 57 return Future.forEach(versions, downloadVersion);
58 } else { 58 } else {
59 versions.sort(Version.prioritize); 59 versions.sort(Version.prioritize);
60 return downloadVersion(versions.last); 60 return downloadVersion(versions.last);
61 } 61 }
62 }); 62 });
63 } 63 }
64 } 64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698