2.0.7 |
|
---|---|
2.0.6 |
|
2.0.4 |
|
2.0.2 |
|
1.0.20 |
|
#6 in #rls
79 downloads per month
41KB
876 lines
cargo-rls-install
Purpose
Rust Language Server easy install
Every night, I look for a day when I can use RLS which may be broken.
In order to realize it, this program goes to see the page that mexus's scripts
updates everyday, and scrapes it.
If we had no mexus page in the first place, we would have never made Cargo subcommand,
nor did I feel like using Rust.
Installation
cargo install cargo-rls-install
Preparing for installation (Linux only)
For Linux, it is necessary to install OpenSSL for installation.
# Ubuntu or Debian
sudo apt install libssl-dev
# WSL(Windows Subsystem for Linux)
sudo apt install libssl-dev
sudo apt install build-essential
sudo apt install pkg-config
# RedHut
sudo yum install openssl-devel
# RedHut(Fedora etc.)
sudo dnf install openssl
Usage
cargo rls-install [FLAGS] [OPTIONS]
Example1
Three operations are executed by the above command.
- Rust Language(Nightly channel) install.
- Change default toolchain.
- RLS(Rust Language Server) install.
Before executing each operation, ask whether to execute it.
cargo rls-install -n # --nightly
Example2
All operations are done without approval until the end.
cargo rls-install -ny # --nightly --yes
Example3
Install Stable Rust, RLS and change the default toolchain.
cargo rls-install -s # --stable
Example4
Install Beta Rust, RLS and change the default toolchain.
cargo rls-install -b # --beta
Example5
Install RLS on all Rust channels.
The default toolchain is Nightly Rust, as the last operation on Nightly Rust is done.
cargo rls-install -ysbn
Example6(v1.0.17-)
Check the build status of Rust and RLS.
This command is intended for use alone.
cargo rls-install -v # --view
# or
cargo rls-install view # v2.0.6-
Example7(v1.0.23-)
Installs the specified component. Use rustup component add
command.
# example: rustfmt
cargo rls-install -c rustfmt # --component-add rustfmt
Example8(v1.0.25-)
Note: Changes the selected Rust channel to the default toolchain. Use rustup default
command.
If you specify cargo rls-instrall -d n
, Nightly Rust with the most recent date will be specified as the default toolchain.
# Use stable
cargo rls-install -d s
# Use beta
cargo rls-install -d b
# Use target beta(v1.0.28-)
cargo rls-install -d beta-2019-05-19
# Use nightly
cargo rls-install -d nightly
# Use latest nightly rust toolchain
cargo rls-install -d n
# Use target nightly rust toolchain
cargo rls-install -d nightly-2019-05-21
Example9(v1.0.28-)
Uninstall the selected Rust channel. Use rustup uninstall
command.
Note: Latest nightly rust and default toolchain isn't eligible for uninstallation.
# Uninstall stable
cargo rls-install -u s
# Uninstall beta
cargo rls-install -u b
# Uninstall target beta
cargo rls-install -u beta-2019-05-19
# Uninstall nightly
cargo rls-install -u n
# Uninstall target nightly
cargo rls-install -u nightly-2019-5-21
# Uninstall all but the latest nightly rust dated
cargo rls-install -u a # a or all
Example10(v2.0.4-)
Nightly Rust will be installed on the date you choose.
cargo rls-install -i nightly-2020-03-19
Example11(v2.0.5-)
Show installed toolchains. Use rustup show
command.
cargo rls-install show
Example12(v2.0.5-)
Install formatter tools: clippy and rustfmt. Use rustup component add
command.
cargo rls-install formatter
Flags
USAGE:
cargo rls-install [FLAGS] [OPTIONS]
FLAGS:
-b, --beta Install beta channel Rust and RLS
-h, --help Prints help information
-i, --install Install user specified target nightly channel
-n, --nightly Install nightly channel Rust and RLS
-s, --stable Install stable channel Rust and RLS
-V, --version Prints version information
-v, --view RLS build status view
-y, --yes Pre-approval: Install Rust, RLS and change toolchain
OPTIONS:
-c, --component-add <component> Wrapper(rustup component add)
-d, --default-toolchain <default> Wrapper(rustup default)
-u, --uninstall-toolchain <uninstall> Wrapper(rustup uninstall)
SUBCOMMANDS:
formatter Install clippy and rustfmt
help Prints this message or the help of the given subcommand(s)
show Wrapper(rustup show)
view RLS build status view
Special thanks
Dependencies
~10–18MB
~222K SLoC