blob: 59f2b7907c4cf03d68dbb6cc92bd3f63787439a7 [file] [log] [blame]
Ulf Adams9e24ebd2016-06-23 09:24:57 +00001---
2layout: documentation
3title: Command-Line Reference
4---
Ulf Adams9e24ebd2016-06-23 09:24:57 +00005<h1>Command-Line Reference</h1>
6
7<pre>
Ulf Adams25f44042016-06-23 11:44:08 +00008bazel [&lt;startup options&gt;] &lt;command&gt; [&lt;args&gt;]
Ulf Adams9e24ebd2016-06-23 09:24:57 +00009</pre>
10
11or
12
13<pre>
Ulf Adams25f44042016-06-23 11:44:08 +000014bazel [&lt;startup options&gt;] &lt;command&gt; [&lt;args&gt;] -- [&lt;target patterns&gt;]
Ulf Adams9e24ebd2016-06-23 09:24:57 +000015</pre>
16
laurentlbc68d2642018-10-18 16:01:03 -070017See the <a href="guide.html#target-patterns">User's Guide</a> for the
18target patterns syntax.
19
Ulf Adams9e24ebd2016-06-23 09:24:57 +000020<h2>Option Syntax</h2>
21
22<p>
Ulf Adams25f44042016-06-23 11:44:08 +000023Options can be passed to Bazel in different ways. Options that require a value
Ulf Adams9e24ebd2016-06-23 09:24:57 +000024can be passed with either an equals sign or a space:
25<pre>
26--&lt;option&gt;=&lt;value&gt;
27--&lt;option&gt; &lt;value&gt;
28</pre>
29Some options have a single character short form; in that case, the short form
30has to be passed with a single dash and a space.
31<pre>
32-&lt;short_form&gt; &lt;value&gt;
33</pre>
34</p>
35
36<p>
37Boolean options can be enabled as follows:
38<pre>
39--&lt;option&gt;
40--&lt;option&gt;=[true|yes|1]
41</pre>
42
43and disabled as follows:
44<pre>
45--no&lt;option&gt;
Ulf Adams9e24ebd2016-06-23 09:24:57 +000046--&lt;option&gt;=[false|no|0]
47</pre>
48</p>
49
50<p>
51Tristate options are usually set to automatic by default, and can be
52force-enabled as follows:
53<pre>
54--&lt;option&gt;=[true|yes|1]
55</pre>
56or force-disabled as follows:
57<pre>
58--no&lt;option&gt;
Ulf Adams9e24ebd2016-06-23 09:24:57 +000059--&lt;option&gt;=[false|no|0]
60</pre>
61</p>