]> khamidou — GitHub mirrors - arcanist.git/commitdiff
When `arc` is run with `--trace`, print out argv explicitly
authorepriestley <git@epriestley.com>
Wed, 16 Dec 2015 14:00:50 +0000 (06:00 -0800)
committerepriestley <git@epriestley.com>
Fri, 18 Dec 2015 00:15:00 +0000 (16:15 -0800)
Summary:
Ref T9993. Users may have shell aliases or wrapper scripts that they forget about.

Print out the arguments we received to make it obvious that something went through an indirection layer.

Test Plan: Ran `arc version --help`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9993

Differential Revision: https://secure.phabricator.com/D14797

scripts/arcanist.php

index f29311f667991a575838abdc51c4697a04595ea7..c888fae935ac575f94a9bb2fd3086a3d72b25b50 100755 (executable)
@@ -74,17 +74,27 @@ $config = null;
 $workflow = null;
 
 try {
+  if ($config_trace_mode) {
+    echo tsprintf(
+      "**<bg:magenta> %s </bg>** %s\n",
+      pht('ARGV'),
+      csprintf('%Ls', $original_argv));
+
+    $libraries = array(
+      'phutil',
+      'arcanist',
+    );
 
-  $console->writeLog(
-    "%s\n",
-    pht(
-      "libphutil loaded from '%s'.",
-      phutil_get_library_root('phutil')));
-  $console->writeLog(
-    "%s\n",
-    pht(
-      "arcanist loaded from '%s'.",
-      phutil_get_library_root('arcanist')));
+    foreach ($libraries as $library_name) {
+      echo tsprintf(
+        "**<bg:magenta> %s </bg>** %s\n",
+        pht('LOAD'),
+        pht(
+          'Loaded "%s" from "%s".',
+          $library_name,
+          phutil_get_library_root($library_name)));
+    }
+  }
 
   if (!$args) {
     if ($help) {