File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -800,6 +800,7 @@ macro_rules! options {
800
800
pub const parse_opt_pathbuf: Option <& str > = Some ( "a path" ) ;
801
801
pub const parse_list: Option <& str > = Some ( "a space-separated list of strings" ) ;
802
802
pub const parse_opt_list: Option <& str > = Some ( "a space-separated list of strings" ) ;
803
+ pub const parse_opt_comma_list: Option <& str > = Some ( "a comma-separated list of strings" ) ;
803
804
pub const parse_uint: Option <& str > = Some ( "a number" ) ;
804
805
pub const parse_passes: Option <& str > =
805
806
Some ( "a space-separated list of passes, or `all`" ) ;
@@ -926,6 +927,18 @@ macro_rules! options {
926
927
}
927
928
}
928
929
930
+ fn parse_opt_comma_list( slot: & mut Option <Vec <String >>, v: Option <& str >)
931
+ -> bool {
932
+ match v {
933
+ Some ( s) => {
934
+ let v = s. split( ',' ) . map( |s| s. to_string( ) ) . collect( ) ;
935
+ * slot = Some ( v) ;
936
+ true
937
+ } ,
938
+ None => false ,
939
+ }
940
+ }
941
+
929
942
fn parse_uint( slot: & mut usize , v: Option <& str >) -> bool {
930
943
match v. and_then( |s| s. parse( ) . ok( ) ) {
931
944
Some ( i) => { * slot = i; true } ,
You can’t perform that action at this time.
0 commit comments