Skip to content

Command line Options

tchule edited this page Jan 6, 2017 · 1 revision

Execute the run.php script without any options or with the --help option to see the supported command line options.

 $> php run.php --help

 Usage: php/run.php <options>

    Options:
       --src          Root of the source directory tree or a file.
       --exclude      [Optional] A directory or file that needs to be excluded.
       --format       [Optional] Output format (html/text/console). Defaults to 'html'.
       --outdir       [Optional] Report Directory. Defaults to './style-report'.
       --config       [Optional] The name of the config file.
       --debug        [Optional] Add some debug logs (warning, very verbose).
       --linecount    [Optional] Generate a report on the number of lines of code (JavaNCSS format)
       --progress     [Optional] Prints a message noting the file and every line that is covered by PHPCheckStyle.
       --lang  	      [Optional] Language file to use for the result (en-us by default).
       --quiet        [Optional] Quiet mode.
       --help         Display this usage information.  
  • --src: Specifies the php source file. Or a directory under which the php source files reside. If a directory is specified then all the php files within that directory will be processed (unless the a file or subdirectory is in the --exclude list)
  • --exclude: Excludes the specified file or directory from processing. Specify multiple times for more than one file/directory
  • --outdir: The directory where the checkstyle report is to be stored. The default is ./style-report.
  • --format: Can be "html", "text", "xml" and/or "console". Default is "html". The report is generated in the file outdir/index.html in case of "html" format or outdir/style-report.txt in case of "text" format. The "console" mode can be used to interact with tools that analyse the output of the console like the DLTK tools of Eclipse. The xml output can be used with tools like the Hudson/Jenkins violations plugin. If multiple formats are selected, they should be separated with a comma.
  • --config: Allow to specify the name of the configuration file used. The config file must be placed in the "config" directory.
  • --debug: Generates some debug information about the code analysed (it shows the tokens found, this is very verbose).
  • --linecount: Generates a new XML file in the JavaNCSS format that will contain informations about the number of classes, functions, lines of code and lines of comment of the analysed project.
  • --lang: Change the language file. You can add your own language file in the 'Lang' directory.