Skip to content

Commit

Permalink
Update additional uses of --all.
Browse files Browse the repository at this point in the history
- man pages
- Slightly reword deprecation notice.
- Include --all in man pages.
- Update some additional usages in code and docs.
  • Loading branch information
ehuss committed Sep 4, 2019
1 parent 7176df0 commit ecf824f
Show file tree
Hide file tree
Showing 20 changed files with 100 additions and 45 deletions.
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
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
5 changes: 1 addition & 4 deletions src/cargo/util/command_prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ pub trait AppExt: Sized {
exclude: &'static str,
) -> Self {
self.arg_package_spec_simple(package)
._arg(opt(
"all",
"Will be changed to 'workspace' option (deprecated)",
))
._arg(opt("all", "Alias for --workspace (deprecated)"))
._arg(opt("workspace", all))
._arg(multi_opt("exclude", "SPEC", exclude))
}
Expand Down
6 changes: 5 additions & 1 deletion src/doc/man/generated/cargo-bench.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ <h3 id="cargo_bench_package_selection">Package Selection</h3>
<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
Expand Down Expand Up @@ -501,4 +505,4 @@ <h2 id="cargo_bench_see_also">SEE ALSO</h2>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-test.html">cargo-test(1)</a></p>
</div>
</div>
</div>
</div>
6 changes: 5 additions & 1 deletion src/doc/man/generated/cargo-build.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ <h3 id="cargo_build_package_selection">Package Selection</h3>
<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
Expand Down Expand Up @@ -464,4 +468,4 @@ <h2 id="cargo_build_see_also">SEE ALSO</h2>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-rustc.html">cargo-rustc(1)</a></p>
</div>
</div>
</div>
</div>
6 changes: 5 additions & 1 deletion src/doc/man/generated/cargo-check.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ <h3 id="cargo_check_package_selection">Package Selection</h3>
<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
Expand Down Expand Up @@ -455,4 +459,4 @@ <h2 id="cargo_check_see_also">SEE ALSO</h2>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-build.html">cargo-build(1)</a></p>
</div>
</div>
</div>
</div>
6 changes: 5 additions & 1 deletion src/doc/man/generated/cargo-doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ <h3 id="cargo_doc_package_selection">Package Selection</h3>
<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
Expand Down Expand Up @@ -416,4 +420,4 @@ <h2 id="cargo_doc_see_also">SEE ALSO</h2>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-rustdoc.html">cargo-rustdoc(1)</a>, <a href="https://doc.rust-lang.org/rustdoc/index.html">rustdoc(1)</a></p>
</div>
</div>
</div>
</div>
6 changes: 5 additions & 1 deletion src/doc/man/generated/cargo-fix.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ <h3 id="cargo_fix_package_selection">Package Selection</h3>
<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
Expand Down Expand Up @@ -534,4 +538,4 @@ <h2 id="cargo_fix_see_also">SEE ALSO</h2>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-check.html">cargo-check(1)</a></p>
</div>
</div>
</div>
</div>
6 changes: 5 additions & 1 deletion src/doc/man/generated/cargo-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ <h3 id="cargo_test_package_selection">Package Selection</h3>
<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
Expand Down Expand Up @@ -563,4 +567,4 @@ <h2 id="cargo_test_see_also">SEE ALSO</h2>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-bench.html">cargo-bench(1)</a></p>
</div>
</div>
</div>
</div>
3 changes: 3 additions & 0 deletions src/doc/man/options-packages.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ virtual workspace will include all workspace members (equivalent to passing
*--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
`--workspace` flag. This flag may be specified multiple times.
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
11 changes: 8 additions & 3 deletions src/etc/man/cargo-build.1
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,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
Build 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
Build 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
11 changes: 8 additions & 3 deletions src/etc/man/cargo-check.1
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,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
Check 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
Check 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
11 changes: 8 additions & 3 deletions src/etc/man/cargo-doc.1
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,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
Document 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
Document 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
11 changes: 8 additions & 3 deletions src/etc/man/cargo-fix.1
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,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
Fix 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
Fix 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
11 changes: 8 additions & 3 deletions src/etc/man/cargo-test.1
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,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
Test 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
Test 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

0 comments on commit ecf824f

Please sign in to comment.