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

Side by Side Diff: lib/src/command.dart

Issue 1228093003: Fix several package spec bugs. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 5 years, 5 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
« no previous file with comments | « no previous file | lib/src/entrypoint.dart » ('j') | test/descriptor/packages.dart » ('J')
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 library pub.command; 5 library pub.command;
6 6
7 import 'package:args/args.dart'; 7 import 'package:args/args.dart';
8 import 'package:args/command_runner.dart'; 8 import 'package:args/command_runner.dart';
9 import 'package:path/path.dart' as path; 9 import 'package:path/path.dart' as path;
10 10
(...skipping 24 matching lines...) Expand all
35 } 35 }
36 GlobalPackages _globals; 36 GlobalPackages _globals;
37 37
38 /// Gets the [Entrypoint] package for the current working directory. 38 /// Gets the [Entrypoint] package for the current working directory.
39 /// 39 ///
40 /// This will load the pubspec and fail with an error if the current directory 40 /// This will load the pubspec and fail with an error if the current directory
41 /// is not a package. 41 /// is not a package.
42 Entrypoint get entrypoint { 42 Entrypoint get entrypoint {
43 // Lazy load it. 43 // Lazy load it.
44 if (_entrypoint == null) { 44 if (_entrypoint == null) {
45 _entrypoint = new Entrypoint(path.current, cache, 45 _entrypoint = new Entrypoint('.', cache,
46 packageSymlinks: globalResults['package-symlinks']); 46 packageSymlinks: globalResults['package-symlinks']);
47 } 47 }
48 return _entrypoint; 48 return _entrypoint;
49 } 49 }
50 Entrypoint _entrypoint; 50 Entrypoint _entrypoint;
51 51
52 /// The URL for web documentation for this command. 52 /// The URL for web documentation for this command.
53 String get docUrl => null; 53 String get docUrl => null;
54 54
55 /// Override this and return `false` to disallow trailing options from being 55 /// Override this and return `false` to disallow trailing options from being
(...skipping 29 matching lines...) Expand all
85 /// 85 ///
86 /// If the parsing fails, prints a usage message and exits. 86 /// If the parsing fails, prints a usage message and exits.
87 int parseInt(String intString, String name) { 87 int parseInt(String intString, String name) {
88 try { 88 try {
89 return int.parse(intString); 89 return int.parse(intString);
90 } on FormatException catch (_) { 90 } on FormatException catch (_) {
91 usageException('Could not parse $name "$intString".'); 91 usageException('Could not parse $name "$intString".');
92 } 92 }
93 } 93 }
94 } 94 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/entrypoint.dart » ('j') | test/descriptor/packages.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698