Skip to content

Command Line Options

SomMeri edited this page Oct 27, 2012 · 17 revisions

Less4j can run from the command line. Command line version can run in two modes: single input file mode or in multiple input files mode. Less4j uses single file mode by default.

Single file mode

Less4j expects one or two arguments. First one contains input less filename and the second one contains the output css filename. If the output file argument is not present, less4j will print the result into standard output.

Multiple files mode

Must be turned on by '-m' or '--multiMode' parameter. Less4j assumes that all input files are less files. All are going to be compiled into css files. Each input file will generate an output file with the same name and suffix '.css'.

Usage: less4j [options] [list of files]

Options

  • -h, --help: Print help screen. Default: false
  • -m, --multiMode: Turn on multi less files mode. Default: false
  • -o, --outputDir: Specify the output directory. If not present, Less4j will place output files into current directory. This option is available only in single multiple files mode.

Examples

  • Compile 'test.less' file and print the result into standard output: less4j test.less
  • Compile 'test.less' file and print the result into 'test.css' file: less4j test.less test.css
  • Compile 't1.less', 't2.less' and 't3.less' files into 't1.css', 't2.css' and 't3.css': less4j -m t1.less t2.less t3.less
  • Compile 't1.less', 't2.less', 't3.less' files into 't1.css', 't2.css', 't3.css'. Place the result into '..\css' directory: less4j -m -o ..\css\ t1.less t2.less t3.less