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

Unified Diff: sdk/lib/_internal/pub/lib/src/executable.dart

Issue 372123002: Get rid of deferred binding for usage errors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/lib/src/executable.dart
diff --git a/sdk/lib/_internal/pub/lib/src/executable.dart b/sdk/lib/_internal/pub/lib/src/executable.dart
index ab63765ba60727a2a663cdb78d3535601336e588..e7d1c10139b19ac18aa04a113cc0e4c332c72f4f 100644
--- a/sdk/lib/_internal/pub/lib/src/executable.dart
+++ b/sdk/lib/_internal/pub/lib/src/executable.dart
@@ -13,6 +13,7 @@ import 'package:stack_trace/stack_trace.dart';
import 'barback/asset_environment.dart';
import 'barback/barback_server.dart';
+import 'command.dart';
import 'entrypoint.dart';
import 'exit_codes.dart' as exit_codes;
import 'log.dart' as log;
@@ -28,8 +29,8 @@ import 'utils.dart';
/// Arguments from [args] will be passed to the spawned Dart application.
///
/// Returns the exit code of the spawned app.
-Future<int> runExecutable(Entrypoint entrypoint, String package,
- String executable, Iterable<String> args) {
+Future<int> runExecutable(PubCommand command, Entrypoint entrypoint,
+ String package, String executable, Iterable<String> args) {
// If the command has a path separator, then it's a path relative to the
// root of the package. Otherwise, it's implicitly understood to be in
// "bin".
@@ -37,7 +38,8 @@ Future<int> runExecutable(Entrypoint entrypoint, String package,
var parts = p.split(executable);
if (parts.length > 1) {
if (package != entrypoint.root.name) {
- usageError("Cannot run an executable in a subdirectory of a dependency.");
+ command.usageError(
+ "Cannot run an executable in a subdirectory of a dependency.");
}
rootDir = parts.first;

Powered by Google App Engine
This is Rietveld 408576698