Ulf Adams | 9e24ebd | 2016-06-23 09:24:57 +0000 | [diff] [blame] | 1 | --- |
| 2 | layout: documentation |
| 3 | title: Command-Line Reference |
| 4 | --- |
Ulf Adams | 9e24ebd | 2016-06-23 09:24:57 +0000 | [diff] [blame] | 5 | <h1>Command-Line Reference</h1> |
| 6 | |
| 7 | <pre> |
Ulf Adams | 25f4404 | 2016-06-23 11:44:08 +0000 | [diff] [blame] | 8 | bazel [<startup options>] <command> [<args>] |
Ulf Adams | 9e24ebd | 2016-06-23 09:24:57 +0000 | [diff] [blame] | 9 | </pre> |
| 10 | |
| 11 | or |
| 12 | |
| 13 | <pre> |
Ulf Adams | 25f4404 | 2016-06-23 11:44:08 +0000 | [diff] [blame] | 14 | bazel [<startup options>] <command> [<args>] -- [<target patterns>] |
Ulf Adams | 9e24ebd | 2016-06-23 09:24:57 +0000 | [diff] [blame] | 15 | </pre> |
| 16 | |
laurentlb | c68d264 | 2018-10-18 16:01:03 -0700 | [diff] [blame] | 17 | See the <a href="guide.html#target-patterns">User's Guide</a> for the |
| 18 | target patterns syntax. |
| 19 | |
Ulf Adams | 9e24ebd | 2016-06-23 09:24:57 +0000 | [diff] [blame] | 20 | <h2>Option Syntax</h2> |
| 21 | |
| 22 | <p> |
Ulf Adams | 25f4404 | 2016-06-23 11:44:08 +0000 | [diff] [blame] | 23 | Options can be passed to Bazel in different ways. Options that require a value |
Ulf Adams | 9e24ebd | 2016-06-23 09:24:57 +0000 | [diff] [blame] | 24 | can be passed with either an equals sign or a space: |
| 25 | <pre> |
| 26 | --<option>=<value> |
| 27 | --<option> <value> |
| 28 | </pre> |
| 29 | Some options have a single character short form; in that case, the short form |
| 30 | has to be passed with a single dash and a space. |
| 31 | <pre> |
| 32 | -<short_form> <value> |
| 33 | </pre> |
| 34 | </p> |
| 35 | |
| 36 | <p> |
| 37 | Boolean options can be enabled as follows: |
| 38 | <pre> |
| 39 | --<option> |
| 40 | --<option>=[true|yes|1] |
| 41 | </pre> |
| 42 | |
| 43 | and disabled as follows: |
| 44 | <pre> |
| 45 | --no<option> |
Ulf Adams | 9e24ebd | 2016-06-23 09:24:57 +0000 | [diff] [blame] | 46 | --<option>=[false|no|0] |
| 47 | </pre> |
| 48 | </p> |
| 49 | |
| 50 | <p> |
| 51 | Tristate options are usually set to automatic by default, and can be |
| 52 | force-enabled as follows: |
| 53 | <pre> |
| 54 | --<option>=[true|yes|1] |
| 55 | </pre> |
| 56 | or force-disabled as follows: |
| 57 | <pre> |
| 58 | --no<option> |
Ulf Adams | 9e24ebd | 2016-06-23 09:24:57 +0000 | [diff] [blame] | 59 | --<option>=[false|no|0] |
| 60 | </pre> |
| 61 | </p> |