ceresdb: Rust 实现的高性能时序数据库
Clap 发布 v3.2 版本
Arg::validatorArg::allow_invalid_utf8等 API,引入了更加开放和灵活的 API,例如:
Arg::value_parser ArgAction
/*
#[non_exhaustive]
pub enum ArgAction {
Set,
Append,
StoreValue,
IncOccurrence,
SetTrue,
SetFalse,
Count,
Help,
Version,
}
*/let cmd = Command::new("mycmd")
.arg(
Arg::new("quiet")
.long("quiet")
.action(clap::builder::ArgAction::SetTrue)
)
.arg(
Arg::new("verbose")
.long("verbose")
.action(clap::builder::ArgAction::Count)
);let matches = cmd.try_get_matches_from(
["mycmd", "--quiet", "--quiet", "--verbose", "--verbose", "--verbose"]
).unwrap();assert_eq!(
*matches.get_one::<bool>("quiet").expect("defaulted by clap"), Some(true)
);assert_eq!(
*matches.get_one::<u8>("verbose").expect("defaulted by clap"), Some(3)
);
GBemulator:Rust 实现的 GameBoy 模拟器


github地址:https://github.com/p4ddy1/gbemulator
Rust.cc 论坛: 支持 rss 微信公众号:Rust 语言中文社区
文章转载自Rust语言中文社区,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




