diff --git a/.gitignore b/.gitignore
index cfaa50dbf4b..ad72371994b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
composer.lock
vendor
phpunit.xml
-
diff --git a/Symfony/CS/Console/Command/FixCommand.php b/Symfony/CS/Console/Command/FixCommand.php
index fcad207c4fa..e4426e45bff 100644
--- a/Symfony/CS/Console/Command/FixCommand.php
+++ b/Symfony/CS/Console/Command/FixCommand.php
@@ -55,6 +55,7 @@ protected function configure()
->setDefinition(array(
new InputArgument('path', InputArgument::REQUIRED, 'The path'),
new InputOption('config', '', InputOption::VALUE_REQUIRED, 'The configuration name', null),
+ new InputOption('config-file', '', InputOption::VALUE_OPTIONAL, 'The path to a .php_cs file ', null),
new InputOption('dry-run', '', InputOption::VALUE_NONE, 'Only shows which files would have been modified'),
new InputOption('level', '', InputOption::VALUE_REQUIRED, 'The level of fixes (can be psr0, psr1, psr2, or all)', null),
new InputOption('fixers', '', InputOption::VALUE_REQUIRED, 'A list of fixers to run'),
@@ -148,6 +149,9 @@ protected function configure()
->fixers(array('-Psr0Fixer'))
->finder(\$finder)
;
+
+With the --config-file option you can specify the path to the
+.php_cs file.
EOF
);
}
@@ -187,6 +191,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (null === $config) {
throw new \InvalidArgumentException(sprintf('The configuration "%s" is not defined', $input->getOption('config')));
}
+ } elseif ($input->getOption('config-file')) {
+ $file = $input->getOption('config-file');
+ $config = include $file;
} elseif (file_exists($file = $path.'/.php_cs')) {
$config = include $file;
$addSuppliedPathFromCli = false;