From cf6a23b83c42a03869ff30323dd4f367d4af0271 Mon Sep 17 00:00:00 2001 From: Harutaka Kawamura Date: Mon, 19 Sep 2022 00:15:15 +0900 Subject: [PATCH] Add `--version` flag (#222) --- README.md | 2 ++ src/main.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index a3fe0c26ba..77d7fb446b 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,8 @@ OPTIONS: List of error codes to enable -v, --verbose Enable verbose logging + -V, --version + Print version information -w, --watch Run in watch mode by re-running whenever files change ``` diff --git a/src/main.rs b/src/main.rs index aafb34c62f..33b9d8bb2a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,6 +29,7 @@ const CARGO_PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); #[derive(Debug, Parser)] #[clap(name = format!("{CARGO_PKG_NAME} (v{CARGO_PKG_VERSION})"))] #[clap(about = "An extremely fast Python linter.", long_about = None)] +#[clap(version)] struct Cli { #[clap(parse(from_os_str), value_hint = ValueHint::AnyPath, required = true)] files: Vec,