-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
taissan
committed
Jun 30, 2023
1 parent
2a7e625
commit 7bc782c
Showing
10 changed files
with
314 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Changelog | ||
|
||
## [Unreleased] | ||
|
||
### Added | ||
- New feature A | ||
- New feature B | ||
|
||
### Changed | ||
- Improved feature C | ||
|
||
## [1.0.0] - 2023-06-30 | ||
|
||
### Added | ||
- 添加--proxy,--log-level参数 | ||
- 处理错误 | ||
- 发布完整版本 | ||
|
||
## [0.0.2] - 2023-06-25 | ||
|
||
### Init | ||
- 发布可用版本 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,65 @@ | ||
use std::str::FromStr; | ||
|
||
use clap::builder::TypedValueParser as _; | ||
use clap::Parser; | ||
/// Dependency-track 的cli程序 | ||
use reqwest::Url; | ||
/// Dependency-track 的命令行程序 | ||
#[derive(Parser, Debug, Clone)] | ||
#[command(author,version, about, long_about = None)] | ||
pub(crate) struct Dtrack { | ||
/// 设置dependencytrack的访问地址. eg. http://dtrack.abc.local:8080. | ||
/// 设置 Dependency-track 的访问地址. eg. http://dtrack.abc.local:8081. | ||
#[arg( | ||
short, | ||
long, | ||
value_name = "Url", | ||
default_value = "http://127.0.0.1:8081" | ||
)] | ||
pub(crate) url: Option<String>, | ||
/// 设置dependencytrack的apikey. eg. adfadfe343g. | ||
pub(crate) url: Option<Url>, | ||
/// 设置 Dependency-track 的apikey. eg. adfadfe343g. | ||
#[arg( | ||
short, | ||
long, | ||
value_name = "Apikey", | ||
default_value = "Oh9LHLfrLgk77e67DEZtiitOWZwvFVXI" | ||
)] | ||
pub(crate) key: Option<String>, | ||
/// 设置dependencytrack的项目名称. | ||
|
||
/// 设置 Dependency-track 的连接代理. eg. http://127.0.0.1:8080. | ||
#[arg( | ||
long, | ||
value_name = "Proxy", | ||
)] | ||
pub(crate) proxy: Option<Url>, | ||
/// 设置 Dependency-track 的项目名称. | ||
#[arg(short, long, value_name = "Project Name", default_value = "test")] | ||
pub(crate) project: Option<String>, | ||
/// 设置dependencytrack的项目版本. | ||
/// 设置 Dependency-track 的项目版本. | ||
#[arg(short, long, value_name = "Project Version", default_value = "default")] | ||
pub(crate) edition: Option<String>, | ||
/// 设置dependencytrack的文件. | ||
/// 设置 Dependency-track 的文件. | ||
#[arg(short, long, value_name = "Bom File")] | ||
pub(crate) file: Option<String>, | ||
/// 设置dependencytrack的规则. | ||
/// 设置 Dependency-track 的规则. | ||
#[arg(short, long, value_name = "Rule")] | ||
pub(crate) rule: Option<String>, | ||
/// 输出dependencytrack版本信息. | ||
#[arg( | ||
short, | ||
long, | ||
value_name = "Dependency-Track Version", | ||
default_value_t = false | ||
)] | ||
/// 输出 Dependency-track 版本信息. | ||
#[arg(short, long, default_value_t = false)] | ||
pub(crate) dversion: bool, | ||
/// 设置dependencytrack的扫描结果存储位置. | ||
/// 设置 Dependency-track 的扫描结果存储位置. | ||
#[arg( | ||
short, | ||
long, | ||
value_name = "Scan Result", | ||
default_value = "results.json" | ||
)] | ||
pub(crate) output: Option<String>, | ||
/// 设置输出日志的级别(选择off不输出日志) | ||
#[arg( | ||
short, | ||
long, | ||
default_value = "debug", | ||
value_parser = clap::builder::PossibleValuesParser::new(["off", "debug", "info", "warn", "error"]) | ||
.map(|s| log::LevelFilter::from_str(&s).unwrap()), | ||
)] | ||
pub(crate) log_level: log::LevelFilter, | ||
} |
Oops, something went wrong.