]> git.proxmox.com Git - rustc.git/blob - src/tools/cargo/src/doc/man/includes/options-new.md
New upstream version 1.70.0+dfsg2
[rustc.git] / src / tools / cargo / src / doc / man / includes / options-new.md
1 {{#options}}
2
3 {{#option "`--bin`" }}
4 Create a package with a binary target (`src/main.rs`).
5 This is the default behavior.
6 {{/option}}
7
8 {{#option "`--lib`" }}
9 Create a package with a library target (`src/lib.rs`).
10 {{/option}}
11
12 {{#option "`--edition` _edition_" }}
13 Specify the Rust edition to use. Default is 2021.
14 Possible values: 2015, 2018, 2021
15 {{/option}}
16
17 {{#option "`--name` _name_" }}
18 Set the package name. Defaults to the directory name.
19 {{/option}}
20
21 {{#option "`--vcs` _vcs_" }}
22 Initialize a new VCS repository for the given version control system (git,
23 hg, pijul, or fossil) or do not initialize any version control at all
24 (none). If not specified, defaults to `git` or the configuration value
25 `cargo-new.vcs`, or `none` if already inside a VCS repository.
26 {{/option}}
27
28 {{#option "`--registry` _registry_" }}
29 This sets the `publish` field in `Cargo.toml` to the given registry name
30 which will restrict publishing only to that registry.
31
32 Registry names are defined in [Cargo config files](../reference/config.html).
33 If not specified, the default registry defined by the `registry.default`
34 config key is used. If the default registry is not set and `--registry` is not
35 used, the `publish` field will not be set which means that publishing will not
36 be restricted.
37 {{/option}}
38
39 {{/options}}