File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -800,6 +800,7 @@ macro_rules! options {
800800 pub const parse_opt_pathbuf: Option <& str > = Some ( "a path" ) ;
801801 pub const parse_list: Option <& str > = Some ( "a space-separated list of strings" ) ;
802802 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" ) ;
803804 pub const parse_uint: Option <& str > = Some ( "a number" ) ;
804805 pub const parse_passes: Option <& str > =
805806 Some ( "a space-separated list of passes, or `all`" ) ;
@@ -926,6 +927,18 @@ macro_rules! options {
926927 }
927928 }
928929
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+
929942 fn parse_uint( slot: & mut usize , v: Option <& str >) -> bool {
930943 match v. and_then( |s| s. parse( ) . ok( ) ) {
931944 Some ( i) => { * slot = i; true } ,
You can’t perform that action at this time.
0 commit comments