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

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

Issue 1035853003: Improve quoting in pub reproduction command line in pub error message. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/command_runner.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command_runner.dart b/sdk/lib/_internal/pub/lib/src/command_runner.dart
index 287a469d3c7afab37ae8cae062586b9023f1c47a..8f04ee183d175c8409ad2375150a2233eca9fe30 100644
--- a/sdk/lib/_internal/pub/lib/src/command_runner.dart
+++ b/sdk/lib/_internal/pub/lib/src/command_runner.dart
@@ -131,10 +131,11 @@ class PubCommandRunner extends CommandRunner {
if (options['trace']) {
log.dumpTranscript();
} else if (!isUserFacingException(error)) {
+ String protectArgument(String x) => x.contains(' ') ? '"$x"' : x;
nweiz 2015/03/26 21:46:21 Can you add a TODO here to do proper shell escapin
log.error("""
This is an unexpected error. Please run
- pub --trace ${options.arguments.map((arg) => "'$arg'").join(' ')}
+ pub --trace ${options.arguments.map(protectArgument).join(' ')}
and include the results in a bug report on http://dartbug.com/new.
""");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698