#conditional #parse #arguments #command-line-arguments #unconditional

clp-lib

一个用于解析任何类型条件和无条件命令行参数的单个函数

2个版本

0.1.1 2022年2月17日
0.1.0 2022年2月17日

#29 in #conditional

MIT/Apache

4KB

 #Example
 

 let Unconditionals = vec!["--Utestflag1","--Utestflag2"];
 let Conditionals = vec!["-utestflag3"];
 let args = parse(Conditionals, Unconditionals).expect("Arguments not properly formatted"); //Will return an error if unconditional arguments not given or input arguments not properly formatted.
 let conds = args.0; // hashmap of conditionals as keys and data as values
 let unconds = args.1; // same for unconditionals 

依赖项

~0–10MB
~53K SLoC