Skip to content

Commit 96fca4c

Browse files
committed
Merge pull request #403 from Yasushi/add-doc-subcommand
Add `rustup doc`.
2 parents 2da4bef + 31c53a5 commit 96fca4c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/rustup-cli/rustup_mode.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use clap::{App, Arg, AppSettings, SubCommand, ArgMatches};
1+
use clap::{App, Arg, ArgGroup, AppSettings, SubCommand, ArgMatches};
22
use common;
33
use rustup::{Cfg, Toolchain, command};
44
use rustup::telemetry::TelemetryMode;
@@ -159,6 +159,17 @@ pub fn cli() -> App<'static, 'static> {
159159
.required(true)))
160160
.subcommand(SubCommand::with_name("remove")
161161
.about("Remove the override toolchain for a directory")))
162+
.subcommand(SubCommand::with_name("doc")
163+
.about("Open the documentation for the current toolchain.")
164+
.arg(Arg::with_name("book")
165+
.long("book")
166+
.help("The Rust Programming Language book"))
167+
.arg(Arg::with_name("std")
168+
.long("std")
169+
.help("Standard library API documentation"))
170+
.group(ArgGroup::with_name("page")
171+
.args(&["book", "std"]))
172+
)
162173
.subcommand(SubCommand::with_name("self")
163174
.about("Modify the rustup installation")
164175
.setting(AppSettings::SubcommandRequiredElseHelp)

0 commit comments

Comments
 (0)