Skip to content

Commit d571a1a

Browse files
authored
Enhance cli about info (#13)
* feat(cli): 增强命令行工具版本信息和描述 更新了 CLI 参数解析器的配置,添加了详细的版本信息和工具描述,使用环境变量获取包版本,并提供了更完整的关于信息。 Signed-off-by: longjin <longjin@DragonOS.org> * chore: 更新版本号至0.2.1 Signed-off-by: longjin <longjin@DragonOS.org> --------- Signed-off-by: longjin <longjin@DragonOS.org>
1 parent 84bc57d commit d571a1a

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fastcommit"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "AI-based command line tool to quickly generate standardized commit messages."
55
edition = "2021"
66
authors = ["longjin <fslongjin@vip.qq.com>"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can install `fastcommit` using the following method:
1010

1111
```bash
1212
# Install using cargo
13-
cargo install --git https://github.com/fslongjin/fastcommit --tag v0.2.0
13+
cargo install --git https://github.com/fslongjin/fastcommit --tag v0.2.1
1414
```
1515

1616
## Usage

README_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
```bash
1010
# 使用 cargo 安装
11-
cargo install --git https://github.com/fslongjin/fastcommit --tag v0.2.0
11+
cargo install --git https://github.com/fslongjin/fastcommit --tag v0.2.1
1212
```
1313

1414
## 使用

src/cli.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ use clap::Parser;
33
use crate::config::{CommitLanguage, Verbosity};
44

55
#[derive(Parser, Debug)]
6-
#[clap(version, about)]
6+
#[clap(
7+
version = env!("CARGO_PKG_VERSION"),
8+
about = concat!(
9+
"AI-based command line tool to quickly generate standardized commit messages.\n\n",
10+
"Version: ", env!("CARGO_PKG_VERSION")
11+
)
12+
)]
713
pub struct Args {
814
#[clap(short, long, help = "Path to the file containing the diff to analyze")]
915
pub diff_file: Option<String>,

0 commit comments

Comments
 (0)