【发布时间】:2021-04-28 19:35:26
【问题描述】:
我知道了:
let args: Vec::<String> = std::env::args().collect();
let matches = App::new("Rust grader")
.author("Arkadiusz Bulski <arek.bulski@gmail.com>")
.arg(Arg::with_name("noprofile")
.long("noprofile")
.takes_value(false)
.help("Disable profiling, save time"))
.get_matches();
let config = matches.value_of("noprofile");
还有一个用法:./binary-runner --noprofile -- tsp-arekbulski-*.rs
如何让这个拍手应用程序识别文件名?
错误:
error: Found argument 'tsp-arekbulski-01-trivial.rs' which wasn't expected, or isn't valid in this context
USAGE:
binary-runner --noprofile
【问题讨论】:
标签: rust command-line-arguments clap