diff --git a/man/cargo-install-update.md b/man/cargo-install-update.md index 20b057ad58..68ef85e49b 100644 --- a/man/cargo-install-update.md +++ b/man/cargo-install-update.md @@ -12,7 +12,7 @@ Cargo subcommand for checking and applying updates to installed executables. This was mostly built out of a frustration with periodically checking for updates for my cargo-installed executables, which was long and boring. -Only updates packages from the main repository. +Updates packages from the main repository and git repositories. See cargo-install-update-config(1) for further configuring updates. @@ -53,11 +53,25 @@ Exit values and possible errors: Off by default. + -g --git + + Also update git-originating packages. + + Off by default, because it's expensive. + -c --cargo-dir Set the directory containing cargo metadata. - Required. Default: "$CARGO_HOME", then $HOME/.cargo", otherwise manual. + Required. Default: "$CARGO_HOME", then "$HOME/.cargo", otherwise manual. + + -t --temp-dir + + Set the directory in which to clone git repositories. + + Adjoined with "cargo-update" as last segment. + + Required. Default: system temp, otherwise manual. ## EXAMPLES @@ -69,14 +83,14 @@ Exit values and possible errors: Updating registry `https://github.com/rust-lang/crates.io-index` Package Installed Latest Needs update + checksums v0.5.0 v0.5.2 Yes + treesize v0.2.0 v0.2.1 Yes cargo-count v0.2.2 v0.2.2 No cargo-graph v0.3.0 v0.3.0 No cargo-outdated v0.2.0 v0.2.0 No - checksums v0.5.0 v0.5.2 Yes identicon v0.1.1 v0.1.1 No racer v1.2.10 v1.2.10 No rustfmt v0.6.2 v0.6.2 No - treesize v0.2.0 v0.2.1 Yes Updating checksums Updating registry `https://github.com/rust-lang/crates.io-index` @@ -126,14 +140,14 @@ Exit values and possible errors: Updating registry `https://github.com/rust-lang/crates.io-index` Package Installed Latest Needs update + checksums v0.5.0 v0.5.2 Yes + treesize v0.2.0 v0.2.1 Yes cargo-count v0.2.2 v0.2.2 No cargo-graph v0.3.0 v0.3.0 No cargo-outdated v0.2.0 v0.2.0 No - checksums v0.5.0 v0.5.2 Yes identicon v0.1.1 v0.1.1 No racer v1.2.10 v1.2.10 No rustfmt v0.6.2 v0.6.2 No - treesize v0.2.0 v0.2.1 Yes `cargo install-update -af` @@ -143,10 +157,10 @@ Exit values and possible errors: Updating registry `https://github.com/rust-lang/crates.io-index` Package Installed Latest Needs update - racer v1.2.10 v1.2.10 No treesize v0.2.0 v0.2.1 Yes clippy v0.0.1 v0.0.99 Yes clippy_lints v0.0.1 v0.0.99 Yes + racer v1.2.10 v1.2.10 No Updating racer Updating registry `https://github.com/rust-lang/crates.io-index` @@ -188,8 +202,8 @@ Exit values and possible errors: Package Installed Latest Needs update checksums v0.5.2 Yes - rustfmt v0.6.2 v0.6.2 No treesize v0.2.0 v0.2.1 Yes + rustfmt v0.6.2 v0.6.2 No Installing checksums Updating registry `https://github.com/rust-lang/crates.io-index` @@ -209,6 +223,41 @@ Exit values and possible errors: Updated 2 packages. + `cargo install-update -ag` + + Update all installed packages, including ones from git. + + Example output: + Updating registry `https://github.com/rust-lang/crates.io-index` + + Package Installed Latest Needs update + checksums v0.5.0 v0.5.2 Yes + cargo-count v0.2.2 v0.2.2 No + + Updating checksums + Updating registry `https://github.com/rust-lang/crates.io-index` + Downloading checksums v0.5.2 + [...] + Compiling checksums v0.5.2 + Finished release [optimized] target(s) in 95.2 secs + Replacing D:\Users\nabijaczleweli\.cargo\bin\checksums.exe + + Updated 1 package. + + Package Installed Latest Needs update + alacritty eb231b3 5f78857 Yes + chattium-oxide-client 108a7b9 108a7b9 No + + Updating alacritty from https://github.com/jwilm/alacritty + Updating git repository `https://github.com/jwilm/alacritty` + Installing alacritty v0.1.0 (https://github.com/jwilm/alacritty#5f788574) + [...] + Compiling alacritty v0.1.0 + Finished release [optimized] target(s) in 127.6 secs + Replacing D:\Users\nabijaczleweli\.cargo\bin\alacritty.exe + + Updated 1 package. + ## AUTHOR Written by nabijaczleweli <>, diff --git a/src/lib.rs b/src/lib.rs index 02831d54f2..cfe8eaa51e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -82,12 +82,30 @@ //! Off by default. //! ``` //! +//! -g --git +//! +//! ```text +//! Also update git-originating packages. +//! +//! Off by default, because it's expensive. +//! ``` +//! //! -c --cargo-dir <CARGO_DIR> //! //! ```text //! Set the directory containing cargo metadata. //! -//! Required. Default: "$CARGO_HOME", then $HOME/.cargo", otherwise manual. +//! Required. Default: "$CARGO_HOME", then "$HOME/.cargo", otherwise manual. +//! ``` +//! +//! -t --TEMP-dir <TEMP_DIR> +//! +//! ```text +//! Set the directory in which to clone git repositories. +//! +//! Adjoined with "cargo-update" as last segment. +//! +//! Required. Default: system temp, otherwise manual. //! ``` //! //! ## EXAMPLES @@ -101,14 +119,14 @@ //! Updating registry `https://github.com/rust-lang/crates.io-index` //! //! Package Installed Latest Needs update +//! checksums v0.5.0 v0.5.2 Yes +//! treesize v0.2.0 v0.2.1 Yes //! cargo-count v0.2.2 v0.2.2 No //! cargo-graph v0.3.0 v0.3.0 No //! cargo-outdated v0.2.0 v0.2.0 No -//! checksums v0.5.0 v0.5.2 Yes //! identicon v0.1.1 v0.1.1 No //! racer v1.2.10 v1.2.10 No //! rustfmt v0.6.2 v0.6.2 No -//! treesize v0.2.0 v0.2.1 Yes //! //! Updating checksums //! Updating registry `https://github.com/rust-lang/crates.io-index` @@ -139,8 +157,8 @@ //! Updating registry `https://github.com/rust-lang/crates.io-index` //! //! Package Installed Latest Needs update -//! racer v1.2.10 v1.2.10 No //! treesize v0.2.0 v0.2.1 Yes +//! racer v1.2.10 v1.2.10 No //! //! Updating treesize //! Updating registry `https://github.com/rust-lang/crates.io-index` @@ -162,14 +180,14 @@ //! Updating registry `https://github.com/rust-lang/crates.io-index` //! //! Package Installed Latest Needs update +//! checksums v0.5.0 v0.5.2 Yes +//! treesize v0.2.0 v0.2.1 Yes //! cargo-count v0.2.2 v0.2.2 No //! cargo-graph v0.3.0 v0.3.0 No //! cargo-outdated v0.2.0 v0.2.0 No -//! checksums v0.5.0 v0.5.2 Yes //! identicon v0.1.1 v0.1.1 No //! racer v1.2.10 v1.2.10 No //! rustfmt v0.6.2 v0.6.2 No -//! treesize v0.2.0 v0.2.1 Yes //! ``` //! //! `cargo install-update -af` @@ -180,8 +198,8 @@ //! Updating registry `https://github.com/rust-lang/crates.io-index` //! //! Package Installed Latest Needs update -//! racer v1.2.10 v1.2.10 No //! treesize v0.2.0 v0.2.1 Yes +//! racer v1.2.10 v1.2.10 No //! //! Updating racer //! Updating registry `https://github.com/rust-lang/crates.io-index` @@ -225,8 +243,8 @@ //! //! Package Installed Latest Needs update //! checksums v0.5.2 Yes -//! rustfmt v0.6.2 v0.6.2 No //! treesize v0.2.0 v0.2.1 Yes +//! rustfmt v0.6.2 v0.6.2 No //! //! Installing checksums //! Updating registry `https://github.com/rust-lang/crates.io-index` @@ -246,6 +264,43 @@ //! //! Updated 2 packages. //! ``` +//! +//! `cargo install-update -ag` +//! +//! ```text +//! Update all installed packages, including ones from git. +//! +//! Example output: +//! Updating registry `https://github.com/rust-lang/crates.io-index` +//! +//! Package Installed Latest Needs update +//! checksums v0.5.0 v0.5.2 Yes +//! cargo-count v0.2.2 v0.2.2 No +//! +//! Updating checksums +//! Updating registry `https://github.com/rust-lang/crates.io-index` +//! Downloading checksums v0.5.2 +//! [...] +//! Compiling checksums v0.5.2 +//! Finished release [optimized] target(s) in 95.2 secs +//! Replacing D:\Users\nabijaczleweli\.cargo\bin\checksums.exe +//! +//! Updated 1 package. +//! +//! Package Installed Latest Needs update +//! alacritty eb231b3 5f78857 Yes +//! chattium-oxide-client 108a7b9 108a7b9 No +//! +//! Updating alacritty from https://github.com/jwilm/alacritty +//! Updating git repository `https://github.com/jwilm/alacritty` +//! Installing alacritty v0.1.0 (https://github.com/jwilm/alacritty#5f788574) +//! [...] +//! Compiling alacritty v0.1.0 +//! Finished release [optimized] target(s) in 127.6 secs +//! Replacing D:\Users\nabijaczleweli\.cargo\bin\alacritty.exe +//! +//! Updated 1 package. +//! ``` #[macro_use] diff --git a/src/main.rs b/src/main.rs index 943b8799e4..5cad1ba73c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -183,7 +183,7 @@ fn actual_main() -> Result<(), i32> { if !packages.is_empty() { let (success_n, errored, result): (usize, Vec, Option) = packages.into_iter() .map(|package| -> Result<(), (i32, String)> { - println!("Installing {} from {}", package.name, package.url); + println!("Updating {} from {}", package.name, package.url); if cfg!(target_os = "windows") && package.name == "cargo-update" { save_cargo_update_exec(&package.id.to_string()); diff --git a/src/options.rs b/src/options.rs index 9858265b20..3de55bffd2 100644 --- a/src/options.rs +++ b/src/options.rs @@ -77,7 +77,7 @@ impl Options { Arg::from_usage("-l --list 'Don't update packages, only list and check if they need an update'"), Arg::from_usage("-f --force 'Update all packages regardless if they need updating'"), Arg::from_usage("-i --allow-no-update 'Allow for fresh-installing packages'"), - Arg::from_usage("-g --git 'Also update git packages as well'"), + Arg::from_usage("-g --git 'Also update git packages'"), Arg::from_usage("... 'Packages to update'") .conflicts_with("all") .empty_values(false)