Skip to content

Commit

Permalink
Bump clap to 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zohnannor committed Apr 27, 2023
1 parent 1a5cebd commit 25fd0aa
Show file tree
Hide file tree
Showing 56 changed files with 567 additions and 732 deletions.
45 changes: 7 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ no-self-update = []
anyhow.workspace = true
cfg-if = "1.0"
chrono = "0.4"
clap = { version = "3", features = ["wrap_help"] }
clap_complete = "3"
clap = { version = "4", features = ["wrap_help"] }
clap_complete = "4"
download = { path = "download", default-features = false }
effective-limits = "0.5.5"
enum-map = "2.5.0"
Expand Down
67 changes: 27 additions & 40 deletions rustup-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,48 +25,35 @@ RUSTUP_UPDATE_ROOT="${RUSTUP_UPDATE_ROOT:-https://static.rust-lang.org/rustup}"
# NOTICE: If you change anything here, please make the same changes in setup_mode.rs
usage() {
cat <<EOF
rustup-init 1.26.0 (577bf51ae 2023-04-05)
The installer for rustup
USAGE:
rustup-init [OPTIONS]
OPTIONS:
-v, --verbose
Enable verbose output
-q, --quiet
Disable progress output
-y
Disable confirmation prompt.
--default-host <default-host>
Choose a default host triple
--default-toolchain <default-toolchain>
Choose a default toolchain to install. Use 'none' to not install any toolchains at all
--profile <profile>
[default: default] [possible values: minimal, default, complete]
-c, --component <components>...
Component name to also install
-t, --target <targets>...
Target name to also install
--no-update-default-toolchain
Don't update any existing default toolchain after install
--no-modify-path
Don't configure the PATH environment variable
-h, --help
Print help information
-V, --version
Print version information
Usage: rustup-init [OPTIONS]
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Disable progress output
-y
Disable confirmation prompt.
--default-host <default-host>
Choose a default host triple
--default-toolchain <default-toolchain>
Choose a default toolchain to install. Use 'none' to not install any toolchains at all
--profile <profile>
[default: default] [possible values: minimal, default, complete]
-c, --component <components>...
Component name to also install
-t, --target <targets>...
Target name to also install
--no-update-default-toolchain
Don't update any existing default toolchain after install
--no-modify-path
Don't configure the PATH environment variable
-h, --help
Print help
-V, --version
Print version
EOF
}

Expand Down
26 changes: 13 additions & 13 deletions src/cli/help.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub(crate) static RUSTUP_HELP: &str = r"DISCUSSION:
pub(crate) static RUSTUP_HELP: &str = r"Discussion:
Rustup installs The Rust Programming Language from the official
release channels, enabling you to easily switch between stable,
beta, and nightly compilers and keep them updated. It makes
Expand All @@ -8,7 +8,7 @@ pub(crate) static RUSTUP_HELP: &str = r"DISCUSSION:
If you are new to Rust consider running `rustup doc --book` to
learn Rust.";

pub(crate) static SHOW_HELP: &str = r"DISCUSSION:
pub(crate) static SHOW_HELP: &str = r"Discussion:
Shows the name of the active toolchain and the version of `rustc`.

If the active toolchain has installed support for additional
Expand All @@ -17,7 +17,7 @@ pub(crate) static SHOW_HELP: &str = r"DISCUSSION:
If there are multiple toolchains installed then all installed
toolchains are listed as well.";

pub(crate) static SHOW_ACTIVE_TOOLCHAIN_HELP: &str = r"DISCUSSION:
pub(crate) static SHOW_ACTIVE_TOOLCHAIN_HELP: &str = r"Discussion:
Shows the name of the active toolchain.

This is useful for figuring out the active tool chain from
Expand All @@ -26,24 +26,24 @@ pub(crate) static SHOW_ACTIVE_TOOLCHAIN_HELP: &str = r"DISCUSSION:
You should use `rustc --print sysroot` to get the sysroot, or
`rustc --version` to get the toolchain version.";

pub(crate) static UPDATE_HELP: &str = r"DISCUSSION:
pub(crate) static UPDATE_HELP: &str = r"Discussion:
With no toolchain specified, the `update` command updates each of
the installed toolchains from the official release channels, then
updates rustup itself.

If given a toolchain argument then `update` updates that
toolchain, the same as `rustup toolchain install`.";

pub(crate) static INSTALL_HELP: &str = r"DISCUSSION:
pub(crate) static INSTALL_HELP: &str = r"Discussion:
Installs a specific rust toolchain.

The 'install' command is an alias for 'rustup update <toolchain>'.";

pub(crate) static DEFAULT_HELP: &str = r"DISCUSSION:
pub(crate) static DEFAULT_HELP: &str = r"Discussion:
Sets the default toolchain to the one specified. If the toolchain
is not already installed then it is installed first.";

pub(crate) static TOOLCHAIN_HELP: &str = r"DISCUSSION:
pub(crate) static TOOLCHAIN_HELP: &str = r"Discussion:
Many `rustup` commands deal with *toolchains*, a single
installation of the Rust compiler. `rustup` supports multiple
types of toolchains. The most basic track the official release
Expand Down Expand Up @@ -85,7 +85,7 @@ pub(crate) static TOOLCHAIN_HELP: &str = r"DISCUSSION:
often used for developing Rust itself. For more information see
`rustup toolchain help link`.";

pub(crate) static TOOLCHAIN_LINK_HELP: &str = r"DISCUSSION:
pub(crate) static TOOLCHAIN_LINK_HELP: &str = r"Discussion:
'toolchain' is the custom name to be assigned to the new toolchain.
Any name is permitted as long as it does not fully match an initial
substring of a standard release channel. For example, you can use
Expand All @@ -104,7 +104,7 @@ pub(crate) static TOOLCHAIN_LINK_HELP: &str = r"DISCUSSION:
If you now compile a crate in the current directory, the custom
toolchain 'latest-stage1' will be used.";

pub(crate) static OVERRIDE_HELP: &str = r"DISCUSSION:
pub(crate) static OVERRIDE_HELP: &str = r"Discussion:
Overrides configure Rustup to use a specific toolchain when
running in a specific directory.

Expand All @@ -125,14 +125,14 @@ pub(crate) static OVERRIDE_HELP: &str = r"DISCUSSION:
override and use the default toolchain again, `rustup override
unset`.";

pub(crate) static OVERRIDE_UNSET_HELP: &str = r"DISCUSSION:
pub(crate) static OVERRIDE_UNSET_HELP: &str = r"Discussion:
If `--path` argument is present, removes the override toolchain
for the specified directory. If `--nonexistent` argument is
present, removes the override toolchain for all nonexistent
directories. Otherwise, removes the override toolchain for the
current directory.";

pub(crate) static RUN_HELP: &str = r"DISCUSSION:
pub(crate) static RUN_HELP: &str = r"Discussion:
Configures an environment to use the given toolchain and then runs
the specified program. The command may be any program, not just
rustc or cargo. This can be used for testing arbitrary toolchains
Expand All @@ -147,14 +147,14 @@ pub(crate) static RUN_HELP: &str = r"DISCUSSION:

$ rustup run nightly cargo build";

pub(crate) static DOC_HELP: &str = r"DISCUSSION:
pub(crate) static DOC_HELP: &str = r"Discussion:
Opens the documentation for the currently active toolchain with
the default browser.

By default, it opens the documentation index. Use the various
flags to open specific pieces of documentation.";

pub(crate) static COMPLETIONS_HELP: &str = r"DISCUSSION:
pub(crate) static COMPLETIONS_HELP: &str = r"Discussion:
Enable tab completion for Bash, Fish, Zsh, or PowerShell
The script is output on `stdout`, allowing one to re-direct the
output to the file of their choosing. Where you place the file
Expand Down

0 comments on commit 25fd0aa

Please sign in to comment.