Skip to content

Commit

Permalink
Print a version with --version
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty committed Oct 12, 2024
1 parent a8b6cc2 commit 4ef39bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ All notable changes to insta and cargo-insta are documented here.

- Warnings are printed when any snapshot uses a legacy format. #599

- `cargo insta --version` now prints a version.

- `insta` now internally uses `INSTA_UPDATE=force` rather than
`INSTA_FORCE_UPDATE=1`. (This doesn't affect users of `cargo-insta`, which
handles this internally.) #482
Expand Down
10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ install-updater = false
installers = ["shell", "powershell"]
pr-run-mode = "plan"
precise-builds = true
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
targets = [
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
"x86_64-pc-windows-msvc",
]

[profile.dist]
inherits = "release"
lto = "thin"

[workspace.dependencies]
# Needs pinning in Cargo.lock because of MSRV
clap = {version = "4.1", features = ["derive", "env"]}
clap = { version = "4.1", features = ["derive", "env"] }
4 changes: 1 addition & 3 deletions cargo-insta/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ use clap::{Args, Parser, Subcommand, ValueEnum};
#[command(
bin_name = "cargo insta",
arg_required_else_help = true,
// TODO: do we want these?
disable_colored_help = true,
disable_version_flag = true,
next_line_help = true
)]
struct Opts {
Expand Down Expand Up @@ -61,6 +58,7 @@ impl fmt::Display for ColorWhen {

#[derive(Subcommand, Debug)]
#[command(
version,
after_help = "For the online documentation of the latest version, see https://insta.rs/docs/cli/."
)]
#[allow(clippy::large_enum_variant)]
Expand Down

0 comments on commit 4ef39bf

Please sign in to comment.