|
| 1 | +# Command-line arguments |
| 2 | + |
| 3 | +Here's a list of command-line arguments to `rustc` and what they do. |
| 4 | + |
| 5 | +## `-h`/`--help`: get help |
| 6 | + |
| 7 | +## `--cfg`: configure the compilation environment |
| 8 | + |
| 9 | +## `-L`: add a directory to the library search path. |
| 10 | + |
| 11 | +## `-l`: link the generated crate to a native library |
| 12 | + |
| 13 | +## `--crate-type`: a list of types of crates for the compiler to emit |
| 14 | + |
| 15 | +## `--crate-name`: specify the name of the crate being built |
| 16 | + |
| 17 | +## `--emit`: emit output other than a crate |
| 18 | + |
| 19 | +## `--print`: print compiler information |
| 20 | + |
| 21 | +## `-g`: include debug information |
| 22 | + |
| 23 | +## `-O`: optimize your code |
| 24 | + |
| 25 | +## `-o`: filename of the output |
| 26 | + |
| 27 | +## `--out-dir`: directory to write the output in |
| 28 | + |
| 29 | +## `--explain`: provide a detailed explanation of an error message |
| 30 | + |
| 31 | +## `--test`: build a test harness |
| 32 | + |
| 33 | +## `--target`: select a target triple to build |
| 34 | + |
| 35 | +## `-W`: set lint warnings |
| 36 | + |
| 37 | +## `-A`: set lint allowed |
| 38 | + |
| 39 | +## `-D`: set lint denied |
| 40 | + |
| 41 | +## `-F`: set lint forbidden |
| 42 | + |
| 43 | +## `--cap-lints`: set the most restrictive lint level |
| 44 | + |
| 45 | +## `-C`/`--codegen`: code generation options |
| 46 | + |
| 47 | +## `-V`/`--verision`: print a version |
| 48 | + |
| 49 | +## `-v`/`--verbose`: use verbose output |
| 50 | + |
| 51 | +## `--extern`: specify where an external library is located |
| 52 | + |
| 53 | +## `--sysroot`: Override the system root |
| 54 | + |
| 55 | +## `--error-format`: control how errors are produced |
| 56 | + |
| 57 | +## `--color`: configur coloring of output |
0 commit comments