From a183c2c4ba5836628a6bf1285a7e9109d2866fde Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 16 Dec 2015 06:00:50 -0800 Subject: [PATCH] When `arc` is run with `--trace`, print out argv explicitly 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 | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/scripts/arcanist.php b/scripts/arcanist.php index f29311f6..c888fae9 100755 --- a/scripts/arcanist.php +++ b/scripts/arcanist.php @@ -74,17 +74,27 @@ $config = null; $workflow = null; try { + if ($config_trace_mode) { + echo tsprintf( + "** %s ** %s\n", + pht('ARGV'), + csprintf('%Ls', $original_argv)); - $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'))); + $libraries = array( + 'phutil', + 'arcanist', + ); + + foreach ($libraries as $library_name) { + echo tsprintf( + "** %s ** %s\n", + pht('LOAD'), + pht( + 'Loaded "%s" from "%s".', + $library_name, + phutil_get_library_root($library_name))); + } + } if (!$args) { if ($help) {