Changeset View
Changeset View
Standalone View
Standalone View
scripts/arcanist.php
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | array( | ||||
), | ), | ||||
array( | array( | ||||
'name' => 'arcrc-file', | 'name' => 'arcrc-file', | ||||
'param' => 'filename', | 'param' => 'filename', | ||||
), | ), | ||||
array( | array( | ||||
'name' => 'conduit-uri', | 'name' => 'conduit-uri', | ||||
'param' => 'uri', | 'param' => 'uri', | ||||
'help' => pht('Connect to Phabricator install specified by __uri__.'), | 'help' => pht( | ||||
'Connect to the %s (or compatible software) server specified by '. | |||||
'__uri__.', | |||||
PlatformSymbols::getPlatformServerName()), | |||||
), | ), | ||||
array( | array( | ||||
'name' => 'conduit-token', | 'name' => 'conduit-token', | ||||
'param' => 'token', | 'param' => 'token', | ||||
'help' => pht('Use a specific authentication token.'), | 'help' => pht('Use a specific authentication token.'), | ||||
), | ), | ||||
array( | array( | ||||
'name' => 'anonymous', | 'name' => 'anonymous', | ||||
'help' => pht('Run workflow as a public user, without authenticating.'), | 'help' => pht('Run workflow as a public user, without authenticating.'), | ||||
), | ), | ||||
array( | array( | ||||
'name' => 'config', | 'name' => 'config', | ||||
'param' => 'key=value', | 'param' => 'key=value', | ||||
'repeat' => true, | 'repeat' => true, | ||||
'help' => pht( | 'help' => pht( | ||||
'Specify a runtime configuration value. This will take precedence '. | 'Specify a runtime configuration value. This will take precedence '. | ||||
'over static values, and only affect the current arcanist invocation.'), | 'over static values, and only affect the current process: the '. | ||||
'setting is not saved anywhere.'), | |||||
), | ), | ||||
)); | )); | ||||
$config_trace_mode = $base_args->getArg('trace'); | $config_trace_mode = $base_args->getArg('trace'); | ||||
$force_conduit = $base_args->getArg('conduit-uri'); | $force_conduit = $base_args->getArg('conduit-uri'); | ||||
$force_token = $base_args->getArg('conduit-token'); | $force_token = $base_args->getArg('conduit-token'); | ||||
$custom_arcrc = $base_args->getArg('arcrc-file'); | $custom_arcrc = $base_args->getArg('arcrc-file'); | ||||
▲ Show 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | try { | ||||
} | } | ||||
if ($need_conduit) { | if ($need_conduit) { | ||||
if (!$conduit_uri) { | if (!$conduit_uri) { | ||||
$message = phutil_console_format( | $message = phutil_console_format( | ||||
"%s\n\n - %s\n - %s\n - %s\n", | "%s\n\n - %s\n - %s\n - %s\n", | ||||
pht( | pht( | ||||
'This command requires arc to connect to a Phabricator install, '. | 'This command requires %s to connect to a %s (or compatible '. | ||||
'but no Phabricator installation is configured. To configure a '. | 'software) server, but no %s server is configured. To configure a '. | ||||
'Phabricator URI:'), | '%s server URI:', | ||||
PlatformSymbols::getPlatformClientName(), | |||||
PlatformSymbols::getPlatformServerName(), | |||||
PlatformSymbols::getPlatformServerName(), | |||||
PlatformSymbols::getPlatformServerName()), | |||||
pht( | pht( | ||||
'set a default location with `%s`; or', | 'set a default location with `%s`; or', | ||||
'arc set-config default <uri>'), | 'arc set-config default <uri>'), | ||||
pht( | pht( | ||||
'specify `%s` explicitly; or', | 'specify `%s` explicitly; or', | ||||
'--conduit-uri=uri'), | '--conduit-uri=uri'), | ||||
pht( | pht( | ||||
"run `%s` in a working copy with an '%s'.", | "run `%s` in a working copy with an '%s'.", | ||||
▲ Show 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | try { | ||||
$working_directory = dirname($location); | $working_directory = dirname($location); | ||||
fwrite( | fwrite( | ||||
STDERR, | STDERR, | ||||
tsprintf( | tsprintf( | ||||
"**<bg:yellow> %s </bg>** %s\n", | "**<bg:yellow> %s </bg>** %s\n", | ||||
pht('VERY META'), | pht('VERY META'), | ||||
pht( | pht( | ||||
'You are running one copy of Arcanist (at path "%s") against '. | 'You are running one copy of %s (at path "%s") against '. | ||||
'another copy of Arcanist (at path "%s"). Code in the current '. | 'another copy of %s (at path "%s"). Code in the current '. | ||||
'working directory will not be loaded or executed.', | 'working directory will not be loaded or executed.', | ||||
PlatformSymbols::getPlatformClientName(), | |||||
$executing_directory, | $executing_directory, | ||||
PlatformSymbols::getPlatformClientName(), | |||||
$working_directory))); | $working_directory))); | ||||
} | } | ||||
} | } | ||||
} | } |