[bug] rustyface --help
bug
~~~bat
PS C:\Users\NiceBlueChai> rustyface --help
thread 'main' panicked at C:\Users\NiceBlueChai\.cargo\registry\src\rsproxy.cn-0dccff568467c15b\rustyface-0.1.1\src/main.rs:20:10:
Wrong arguments received: ErrorInner { kind: DisplayHelp, context: FlatMap { keys: [], values: [] }, message: Some(Formatted(StyledStr("A Huggingface downloading CLI tool written in Rust.\n\n\u{1b}[1m\u{1b}[4mUsage:\u{1b}[0m \u{1b}[1mrustyface.exe\u{1b}[0m [OPTIONS] \u{1b}[1m--repository\u{1b}[0m <REPOSITORY> [REPOSITORY_LOCAL_PATH]\n\n\u{1b}[1m\u{1b}[4mArguments:\u{1b}[0m\n [REPOSITORY_LOCAL_PATH] \n\n\u{1b}[1m\u{1b}[4mOptions:\u{1b}[0m\n \u{1b}[1m-r\u{1b}[0m, \u{1b}[1m--repository\u{1b}[0m <REPOSITORY> \n \u{1b}[1m-t\u{1b}[0m, \u{1b}[1m--tasks\u{1b}[0m <TASKS> [default: 4]\n \u{1b}[1m-h\u{1b}[0m, \u{1b}[1m--help\u{1b}[0m Print help\n \u{1b}[1m-V\u{1b}[0m, \u{1b}[1m--version\u{1b}[0m Print version\n"))), source: None, help_flag: Some("--help"), styles: Styles { header: Style { fg: None, bg: None, underline: None, effects: Effects(BOLD | UNDERLINE) }, error: Style { fg: Some(Ansi(Red)), bg: None, underline: None, effects: Effects(BOLD) }, usage: Style { fg: None, bg: None, underline: None, effects: Effects(BOLD | UNDERLINE) }, literal: Style { fg: None, bg: None, underline: None, effects: Effects(BOLD) }, placeholder: Style { fg: None, bg: None, underline: None, effects: Effects() }, valid: Style { fg: Some(Ansi(Green)), bg: None, underline: None, effects: Effects() }, invalid: Style { fg: Some(Ansi(Yellow)), bg: None, underline: None, effects: Effects() } }, color_when: Auto, color_help_when: Auto, backtrace: None }
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
~~~
main.rs第20行应该改成
~~~rust
let mut arguments = download::DownloadArguments::parse();
~~~
这样可以正确展示cli的帮助文本
关闭于 2024-08-09 2 条评论