FAKE Command Line
The fake.exe
command line interface (CLI) is defined as follows:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: |
|
Please refer to the Fake.Core.CommandLineParsing documentation for an explanation of the synax.
For now fake only supports the run
and build
subcommands which are basically equivalent to the Fake as you know it, but more are planned in the future. In general you should use the run
subcommand in scripting when you use parameters, because it is safer in regards to adding options without breaking. Use build
to have a more dense workflow in the command line
Disclaimer
Ordering of arguments does MATTER. This is a change in behavior from FAKE version 4 to 5.
Examples:
fake run -v build.fsx
- This will not run fake in verbose mode. Instead it will try to run the script named-v
. (But we might support that in the future)fake run build.fsx --fsiargs "--define:BOOTSTRAP"
- This will not runbuild.fsx
and define BOOTSTRAP, because--fsiargs
needs to be before the script-name.fake build -s
- This will run fake in single-target mode and not in silent mode, you need to usefake -s build
as described in the above usage description.
--verbose [-v]
Print details of FAKE's activity. Note that -v
was used for --version
in previous versions of Fake.
Currently Fake supports 4 verbosity levels:
- a single
--silent
will prevent all output from the fake runner. This makes it easy to use a.fsx
script for data processing or pipelining on the command-line - None is regular fake information like performance-numbers, general informations and warnings as well as regular output from the script
- a single
--verbose
means verbose output from the fake runner - two
--verbose --verbose
or-vv
mean to set other projects (like paket) to verbose mode as well.
--version
Prints FAKE version information.
--help
Prints help information. In contrast to the other options you can use --help everywhere.
For example fake run --help
to get help about the run
subcommand.
Basic examples
Specify build script only: fake.exe run mybuildscript.fsx
Specify target name only: fake.exe run build.fsx --target Clean
(runs the Clean
target).
As fake build
is a shortcut you could use:
Specify target name only: fake.exe build -t Clean
(runs the Clean
target).
<script.fsx>
or --script <script.fsx>
Required. The path to your .fsx
build file. Note that for fake run
the first "unknown" argument is parsed as the script name and all other parameters are interpreted as arguments for the script.
To support specially named files like --fsiargs
you could use fake build --script --fsiargs
--fsiargs <fsiargs>
Pass a single argument after this switch to FSI when running the build script. See F# Interactive Options for the fsi CLI details.
This way you can use for example #if MYFLAG
compiler directives in your script and use --fsiargs --define:MYFLAG
--help
or -h
Display CLI help.
Running Targets
Please refer to the Fake.Core.Target module documentation
For reference the CLI for the targets-module looks like this:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: |
|
Basically this means you insert the options as <scriptargs>
parameters at the end.