),
'cache' => array(
'param' => 'bool',
- 'help' => "0 to disable cache (default), 1 to enable.",
+ 'help' => "0 to disable cache, 1 to enable (default).",
),
'*' => 'paths',
);
$rev = $this->getArgument('rev');
$paths = $this->getArgument('paths');
+ $use_cache = $this->getArgument('cache', true);
if ($rev && $paths) {
throw new ArcanistUsageException("Specify either --rev or paths.");
$engine->setMinimumSeverity(
$this->getArgument('severity', self::DEFAULT_SEVERITY));
- if ($this->getArgument('cache')) {
+ if ($use_cache) {
$cache = $this->readScratchJSONFile('lint-cache.json');
$cache = idx($cache, $this->getCacheKey(), array());
$cache = array_intersect_key($cache, array_flip($paths));
$cache = $this->readScratchJSONFile('lint-cache.json');
$cached = idx($cache, $this->getCacheKey(), array());
- if ($cached || $this->getArgument('cache')) {
+ if ($cached || $use_cache) {
foreach ($results as $result) {
$path = $result->getPath();
- if (!$this->getArgument('cache')) {
+ if (!$use_cache) {
unset($cached[$path]);
continue;
}