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

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

Issue 11267018: Make getKeys, getValues getters (keys, values). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month 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 | « utils/pub/git_source.dart ('k') | utils/pub/pubspec.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) 2012, the Dart project authors. Please see the AUTHORS file 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 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 /** 5 /**
6 * The main entrypoint for the pub command line application. 6 * The main entrypoint for the pub command line application.
7 */ 7 */
8 library pub; 8 library pub;
9 9
10 import '../../pkg/args/lib/args.dart'; 10 import '../../pkg/args/lib/args.dart';
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 print(''); 114 print('');
115 print('Global options:'); 115 print('Global options:');
116 print(pubArgParser.getUsage()); 116 print(pubArgParser.getUsage());
117 print(''); 117 print('');
118 print('The commands are:'); 118 print('The commands are:');
119 119
120 // Show the commands sorted. 120 // Show the commands sorted.
121 // TODO(rnystrom): A sorted map would be nice. 121 // TODO(rnystrom): A sorted map would be nice.
122 int length = 0; 122 int length = 0;
123 var names = <String>[]; 123 var names = <String>[];
124 for (var command in pubCommands.getKeys()) { 124 for (var command in pubCommands.keys) {
125 length = max(length, command.length); 125 length = max(length, command.length);
126 names.add(command); 126 names.add(command);
127 } 127 }
128 128
129 names.sort((a, b) => a.compareTo(b)); 129 names.sort((a, b) => a.compareTo(b));
130 130
131 for (var name in names) { 131 for (var name in names) {
132 print(' ${padRight(name, length)} ${pubCommands[name].description}'); 132 print(' ${padRight(name, length)} ${pubCommands[name].description}');
133 } 133 }
134 134
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 if (exception is HttpException || exception is HttpParserException || 267 if (exception is HttpException || exception is HttpParserException ||
268 exception is SocketIOException || exception is PubHttpException) { 268 exception is SocketIOException || exception is PubHttpException) {
269 return exit_codes.UNAVAILABLE; 269 return exit_codes.UNAVAILABLE;
270 } else if (exception is FormatException) { 270 } else if (exception is FormatException) {
271 return exit_codes.DATA; 271 return exit_codes.DATA;
272 } else { 272 } else {
273 return 1; 273 return 1;
274 } 274 }
275 } 275 }
276 } 276 }
OLDNEW
« no previous file with comments | « utils/pub/git_source.dart ('k') | utils/pub/pubspec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698