Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename --all to --workspace #7241

Merged
merged 2 commits into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bin/cargo/commands/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ which indicates which package should be benchmarked. If it is not given, then
the current package is benchmarked. For more information on SPEC and its format,
see the `cargo help pkgid` command.

All packages in the workspace are benchmarked if the `--all` flag is supplied. The
`--all` flag is automatically assumed for a virtual manifest.
Note that `--exclude` has to be specified in conjunction with the `--all` flag.
All packages in the workspace are benchmarked if the `--workspace` flag is supplied. The
`--workspace` flag is automatically assumed for a virtual manifest.
Note that `--exclude` has to be specified in conjunction with the `--workspace` flag.

The `--jobs` argument affects the building of the benchmark executable but does
not affect how many jobs are used when running the benchmarks.
Expand Down
6 changes: 3 additions & 3 deletions src/bin/cargo/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ pub fn cli() -> App {
.arg_build_plan()
.after_help(
"\
All packages in the workspace are built if the `--all` flag is supplied. The
`--all` flag is automatically assumed for a virtual manifest.
Note that `--exclude` has to be specified in conjunction with the `--all` flag.
All packages in the workspace are built if the `--workspace` flag is supplied. The
`--workspace` flag is automatically assumed for a virtual manifest.
Note that `--exclude` has to be specified in conjunction with the `--workspace` flag.

Compilation can be configured via the use of profiles which are configured in
the manifest. The default profile for this command is `dev`, but passing
Expand Down
6 changes: 3 additions & 3 deletions src/bin/cargo/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ which indicates which package should be built. If it is not given, then the
current package is built. For more information on SPEC and its format, see the
`cargo help pkgid` command.

All packages in the workspace are checked if the `--all` flag is supplied. The
`--all` flag is automatically assumed for a virtual manifest.
Note that `--exclude` has to be specified in conjunction with the `--all` flag.
All packages in the workspace are checked if the `--workspace` flag is supplied. The
`--workspace` flag is automatically assumed for a virtual manifest.
Note that `--exclude` has to be specified in conjunction with the `--workspace` flag.

Compilation can be configured via the use of profiles which are configured in
the manifest. The default profile for this command is `dev`, but passing
Expand Down
6 changes: 3 additions & 3 deletions src/bin/cargo/commands/clippy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ which indicates which package should be built. If it is not given, then the
current package is built. For more information on SPEC and its format, see the
`cargo help pkgid` command.

All packages in the workspace are checked if the `--all` flag is supplied. The
`--all` flag is automatically assumed for a virtual manifest.
Note that `--exclude` has to be specified in conjunction with the `--all` flag.
All packages in the workspace are checked if the `--workspace` flag is supplied. The
`--workspace` flag is automatically assumed for a virtual manifest.
Note that `--exclude` has to be specified in conjunction with the `--workspace` flag.

To allow or deny a lint from the command line you can use `cargo clippy --`
with:
Expand Down
7 changes: 4 additions & 3 deletions src/bin/cargo/commands/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ pub fn cli() -> App {
By default the documentation for the local package and all dependencies is
built. The output is all placed in `target/doc` in rustdoc's usual format.

All packages in the workspace are documented if the `--all` flag is supplied. The
`--all` flag is automatically assumed for a virtual manifest.
Note that `--exclude` has to be specified in conjunction with the `--all` flag.
All packages in the workspace are documented if the `--workspace` flag is
supplied. The `--workspace` flag is automatically assumed for a virtual
manifest. Note that `--exclude` has to be specified in conjunction with the
`--workspace` flag.

If the `--package` argument is given, then SPEC is a package ID specification
which indicates which package should be documented. If it is not given, then the
Expand Down
6 changes: 3 additions & 3 deletions src/bin/cargo/commands/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ which indicates which package should be tested. If it is not given, then the
current package is tested. For more information on SPEC and its format, see the
`cargo help pkgid` command.

All packages in the workspace are tested if the `--all` flag is supplied. The
`--all` flag is automatically assumed for a virtual manifest.
Note that `--exclude` has to be specified in conjunction with the `--all` flag.
All packages in the workspace are tested if the `--workspace` flag is supplied. The
`--workspace` flag is automatically assumed for a virtual manifest.
Note that `--exclude` has to be specified in conjunction with the `--workspace` flag.

The `--jobs` argument affects the building of the test executable but does
not affect how many jobs are used when running the tests. The default value
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/core/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ pub struct Workspace<'cfg> {

// The subset of `members` that are used by the
// `build`, `check`, `test`, and `bench` subcommands
// when no package is selected with `--package` / `-p` and `--all`
// when no package is selected with `--package` / `-p` and `--workspace`
// is not used.
//
// This is set by the `default-members` config
// in the `[workspace]` section.
// When unset, this is the same as `members` for virtual workspaces
// (`--all` is implied)
// (`--workspace` is implied)
// or only the root package for non-virtual workspaces.
default_members: Vec<PathBuf>,

Expand Down
2 changes: 1 addition & 1 deletion src/cargo/ops/cargo_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl Packages {
Ok(match (all, exclude.len(), package.len()) {
(false, 0, 0) => Packages::Default,
(false, 0, _) => Packages::Packages(package),
(false, _, _) => failure::bail!("--exclude can only be used together with --all"),
(false, _, _) => failure::bail!("--exclude can only be used together with --workspace"),
(true, 0, _) => Packages::All,
(true, _, _) => Packages::OptOut(exclude),
})
Expand Down
6 changes: 4 additions & 2 deletions src/cargo/util/command_prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ pub trait AppExt: Sized {
exclude: &'static str,
) -> Self {
self.arg_package_spec_simple(package)
._arg(opt("all", all))
._arg(opt("all", "Alias for --workspace (deprecated)"))
._arg(opt("workspace", all))
._arg(multi_opt("exclude", "SPEC", exclude))
}

Expand Down Expand Up @@ -290,7 +291,8 @@ pub trait ArgMatchesExt {
workspace: Option<&Workspace<'a>>,
) -> CargoResult<CompileOptions<'a>> {
let spec = Packages::from_flags(
self._is_present("all"),
// TODO Integrate into 'workspace'
self._is_present("workspace") || self._is_present("all"),
self._values_of("exclude"),
self._values_of("package"),
)?;
Expand Down
10 changes: 7 additions & 3 deletions src/doc/man/generated/cargo-bench.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h3 id="cargo_bench_package_selection">Package Selection</h3>
<p>The default members of a workspace can be set explicitly with the
<code>workspace.default-members</code> key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
<code>--all</code>), and a non-virtual workspace will include only the root crate itself.</p>
<code>--workspace</code>), and a non-virtual workspace will include only the root crate itself.</p>
</div>
<div class="dlist">
<dl>
Expand All @@ -88,14 +88,18 @@ <h3 id="cargo_bench_package_selection">Package Selection</h3>
<p>Benchmark only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
<dt class="hdlist1"><strong>--workspace</strong></dt>
<dd>
<p>Benchmark all members in the workspace.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
<dd>
<p>Deprecated alias for <code>--workspace</code>.</p>
</dd>
<dt class="hdlist1"><strong>--exclude</strong> <em>SPEC</em>&#8230;&#8203;</dt>
<dd>
<p>Exclude the specified packages. Must be used in conjunction with the
<code>--all</code> flag. This flag may be specified multiple times.</p>
<code>--workspace</code> flag. This flag may be specified multiple times.</p>
</dd>
</dl>
</div>
Expand Down
10 changes: 7 additions & 3 deletions src/doc/man/generated/cargo-build.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h3 id="cargo_build_package_selection">Package Selection</h3>
<p>The default members of a workspace can be set explicitly with the
<code>workspace.default-members</code> key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
<code>--all</code>), and a non-virtual workspace will include only the root crate itself.</p>
<code>--workspace</code>), and a non-virtual workspace will include only the root crate itself.</p>
</div>
<div class="dlist">
<dl>
Expand All @@ -44,14 +44,18 @@ <h3 id="cargo_build_package_selection">Package Selection</h3>
<p>Build only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
<dt class="hdlist1"><strong>--workspace</strong></dt>
<dd>
<p>Build all members in the workspace.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
<dd>
<p>Deprecated alias for <code>--workspace</code>.</p>
</dd>
<dt class="hdlist1"><strong>--exclude</strong> <em>SPEC</em>&#8230;&#8203;</dt>
<dd>
<p>Exclude the specified packages. Must be used in conjunction with the
<code>--all</code> flag. This flag may be specified multiple times.</p>
<code>--workspace</code> flag. This flag may be specified multiple times.</p>
</dd>
</dl>
</div>
Expand Down
10 changes: 7 additions & 3 deletions src/doc/man/generated/cargo-check.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h3 id="cargo_check_package_selection">Package Selection</h3>
<p>The default members of a workspace can be set explicitly with the
<code>workspace.default-members</code> key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
<code>--all</code>), and a non-virtual workspace will include only the root crate itself.</p>
<code>--workspace</code>), and a non-virtual workspace will include only the root crate itself.</p>
</div>
<div class="dlist">
<dl>
Expand All @@ -48,14 +48,18 @@ <h3 id="cargo_check_package_selection">Package Selection</h3>
<p>Check only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
<dt class="hdlist1"><strong>--workspace</strong></dt>
<dd>
<p>Check all members in the workspace.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
<dd>
<p>Deprecated alias for <code>--workspace</code>.</p>
</dd>
<dt class="hdlist1"><strong>--exclude</strong> <em>SPEC</em>&#8230;&#8203;</dt>
<dd>
<p>Exclude the specified packages. Must be used in conjunction with the
<code>--all</code> flag. This flag may be specified multiple times.</p>
<code>--workspace</code> flag. This flag may be specified multiple times.</p>
</dd>
</dl>
</div>
Expand Down
10 changes: 7 additions & 3 deletions src/doc/man/generated/cargo-doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h3 id="cargo_doc_package_selection">Package Selection</h3>
<p>The default members of a workspace can be set explicitly with the
<code>workspace.default-members</code> key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
<code>--all</code>), and a non-virtual workspace will include only the root crate itself.</p>
<code>--workspace</code>), and a non-virtual workspace will include only the root crate itself.</p>
</div>
<div class="dlist">
<dl>
Expand All @@ -64,14 +64,18 @@ <h3 id="cargo_doc_package_selection">Package Selection</h3>
<p>Document only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
<dt class="hdlist1"><strong>--workspace</strong></dt>
<dd>
<p>Document all members in the workspace.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
<dd>
<p>Deprecated alias for <code>--workspace</code>.</p>
</dd>
<dt class="hdlist1"><strong>--exclude</strong> <em>SPEC</em>&#8230;&#8203;</dt>
<dd>
<p>Exclude the specified packages. Must be used in conjunction with the
<code>--all</code> flag. This flag may be specified multiple times.</p>
<code>--workspace</code> flag. This flag may be specified multiple times.</p>
</dd>
</dl>
</div>
Expand Down
10 changes: 7 additions & 3 deletions src/doc/man/generated/cargo-fix.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h3 id="cargo_fix_package_selection">Package Selection</h3>
<p>The default members of a workspace can be set explicitly with the
<code>workspace.default-members</code> key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
<code>--all</code>), and a non-virtual workspace will include only the root crate itself.</p>
<code>--workspace</code>), and a non-virtual workspace will include only the root crate itself.</p>
</div>
<div class="dlist">
<dl>
Expand All @@ -119,14 +119,18 @@ <h3 id="cargo_fix_package_selection">Package Selection</h3>
<p>Fix only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
<dt class="hdlist1"><strong>--workspace</strong></dt>
<dd>
<p>Fix all members in the workspace.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
<dd>
<p>Deprecated alias for <code>--workspace</code>.</p>
</dd>
<dt class="hdlist1"><strong>--exclude</strong> <em>SPEC</em>&#8230;&#8203;</dt>
<dd>
<p>Exclude the specified packages. Must be used in conjunction with the
<code>--all</code> flag. This flag may be specified multiple times.</p>
<code>--workspace</code> flag. This flag may be specified multiple times.</p>
</dd>
</dl>
</div>
Expand Down
10 changes: 7 additions & 3 deletions src/doc/man/generated/cargo-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h3 id="cargo_test_package_selection">Package Selection</h3>
<p>The default members of a workspace can be set explicitly with the
<code>workspace.default-members</code> key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
<code>--all</code>), and a non-virtual workspace will include only the root crate itself.</p>
<code>--workspace</code>), and a non-virtual workspace will include only the root crate itself.</p>
</div>
<div class="dlist">
<dl>
Expand All @@ -94,14 +94,18 @@ <h3 id="cargo_test_package_selection">Package Selection</h3>
<p>Test only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
<dt class="hdlist1"><strong>--workspace</strong></dt>
<dd>
<p>Test all members in the workspace.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
<dd>
<p>Deprecated alias for <code>--workspace</code>.</p>
</dd>
<dt class="hdlist1"><strong>--exclude</strong> <em>SPEC</em>&#8230;&#8203;</dt>
<dd>
<p>Exclude the specified packages. Must be used in conjunction with the
<code>--all</code> flag. This flag may be specified multiple times.</p>
<code>--workspace</code> flag. This flag may be specified multiple times.</p>
</dd>
</dl>
</div>
Expand Down
9 changes: 6 additions & 3 deletions src/doc/man/options-packages.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ by the manifest will be selected.
The default members of a workspace can be set explicitly with the
`workspace.default-members` key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
`--all`), and a non-virtual workspace will include only the root crate itself.
`--workspace`), and a non-virtual workspace will include only the root crate itself.

*-p* _SPEC_...::
*--package* _SPEC_...::
{actionverb} only the specified packages. See man:cargo-pkgid[1] for the
SPEC format. This flag may be specified multiple times.

*--all*::
*--workspace*::
{actionverb} all members in the workspace.

*--all*::
Deprecated alias for `--workspace`.

*--exclude* _SPEC_...::
Exclude the specified packages. Must be used in conjunction with the
`--all` flag. This flag may be specified multiple times.
`--workspace` flag. This flag may be specified multiple times.
4 changes: 2 additions & 2 deletions src/doc/src/reference/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ manifest*.
#### Package selection

In a workspace, package-related cargo commands like [`cargo build`] apply to
packages selected by `-p` / `--package` or `--all` command-line parameters.
packages selected by `-p` / `--package` or `--workspace` command-line parameters.
When neither is specified, the optional `default-members` configuration is used:

```toml
Expand All @@ -670,7 +670,7 @@ default-members = ["path/to/member2", "path/to/member3/foo"]
When specified, `default-members` must expand to a subset of `members`.

When `default-members` is not specified, the default is the root manifest
if it is a package, or every member manifest (as if `--all` were specified
if it is a package, or every member manifest (as if `--workspace` were specified
on the command-line) for virtual workspaces.

### The project layout
Expand Down
2 changes: 1 addition & 1 deletion src/etc/cargo.bashcomp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _cargo()
local opt_quiet='-q --quiet'
local opt_color='--color'
local opt_common="$opt_help $opt_verbose $opt_quiet $opt_color"
local opt_pkg_spec='-p --package --all --exclude'
local opt_pkg_spec='-p --package --all --exclude --workspace'
local opt_pkg='-p --package'
local opt_feat='--features --all-features --no-default-features'
local opt_mani='--manifest-path'
Expand Down
11 changes: 8 additions & 3 deletions src/etc/man/cargo-bench.1
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,28 @@ by the manifest will be selected.
The default members of a workspace can be set explicitly with the
\fBworkspace.default\-members\fP key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
\fB\-\-all\fP), and a non\-virtual workspace will include only the root crate itself.
\fB\-\-workspace\fP), and a non\-virtual workspace will include only the root crate itself.
.sp
\fB\-p\fP \fISPEC\fP..., \fB\-\-package\fP \fISPEC\fP...
.RS 4
Benchmark only the specified packages. See \fBcargo\-pkgid\fP(1) for the
SPEC format. This flag may be specified multiple times.
.RE
.sp
\fB\-\-all\fP
\fB\-\-workspace\fP
.RS 4
Benchmark all members in the workspace.
.RE
.sp
\fB\-\-all\fP
.RS 4
Deprecated alias for \fB\-\-workspace\fP.
.RE
.sp
\fB\-\-exclude\fP \fISPEC\fP...
.RS 4
Exclude the specified packages. Must be used in conjunction with the
\fB\-\-all\fP flag. This flag may be specified multiple times.
\fB\-\-workspace\fP flag. This flag may be specified multiple times.
.RE
.SS "Target Selection"
.sp
Expand Down
Loading