Skip to content

Commit

Permalink
Updat manpage
Browse files Browse the repository at this point in the history
  • Loading branch information
nabijaczleweli committed Sep 30, 2017
1 parent 3894389 commit 42871e6
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 18 deletions.
65 changes: 57 additions & 8 deletions man/cargo-install-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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 <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 <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

Expand All @@ -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`
Expand Down Expand Up @@ -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`

Expand All @@ -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`
Expand Down Expand Up @@ -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`
Expand All @@ -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 &lt;<[email protected]>&gt;,
Expand Down
71 changes: 63 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 &lt;CARGO_DIR&gt;
//!
//! ```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 &lt;TEMP_DIR&gt;
//!
//! ```text
//! Set the directory in which to clone git repositories.
//!
//! Adjoined with "cargo-update" as last segment.
//!
//! Required. Default: system temp, otherwise manual.
//! ```
//!
//! ## EXAMPLES
Expand All @@ -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`
Expand Down Expand Up @@ -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`
Expand All @@ -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`
Expand All @@ -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`
Expand Down Expand Up @@ -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`
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ fn actual_main() -> Result<(), i32> {
if !packages.is_empty() {
let (success_n, errored, result): (usize, Vec<String>, Option<i32>) = 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());
Expand Down
2 changes: 1 addition & 1 deletion src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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("<PACKAGE>... 'Packages to update'")
.conflicts_with("all")
.empty_values(false)
Expand Down

0 comments on commit 42871e6

Please sign in to comment.