File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313- Update the resulting binary name (#62 )
1414
1515### Fixed
16+ - Verify the required options are provided (#65 )
1617
1718### Removed
1819
Original file line number Diff line number Diff line change @@ -83,6 +83,13 @@ impl GeneratorOptionItem {
8383 GeneratorOptionItem :: Option ( option) => option. chips ,
8484 }
8585 }
86+
87+ fn enables ( & self ) -> & [ & str ] {
88+ match self {
89+ GeneratorOptionItem :: Category ( _) => & [ ] ,
90+ GeneratorOptionItem :: Option ( option) => option. enables ,
91+ }
92+ }
8693}
8794
8895static OPTIONS : & [ GeneratorOptionItem ] = & [
@@ -469,6 +476,18 @@ fn process_options(args: &Args) {
469476 ) ;
470477 process:: exit ( -1 ) ;
471478 }
479+ if !option_item
480+ . enables ( )
481+ . iter ( )
482+ . all ( |requirement| args. option . contains ( & requirement. to_string ( ) ) )
483+ {
484+ log:: error!(
485+ "Option '{}' requires {}" ,
486+ option_item. name( ) ,
487+ option_item. enables( ) . join( ", " )
488+ ) ;
489+ process:: exit ( -1 ) ;
490+ }
472491 }
473492 }
474493}
You can’t perform that action at this time.
0 commit comments