File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ struct Options {
1515 #[ clap( flatten) ]
1616 flags : StandardOptions ,
1717
18+ #[ clap( long, short = 'm' ) ]
19+ model : Option < String > ,
20+
1821 input : Option < String > ,
1922 output : Option < String > ,
2023}
@@ -59,10 +62,12 @@ pub fn main() -> Result<SysexitsError, Box<dyn Error>> {
5962 else {
6063 return Ok ( EX_CONFIG ) ; // not configured
6164 } ;
62- let Ok ( model) = manifest
63- . variable ( "model" , None )
64- . inspect_err ( |e| eprintln ! ( "failed to read configured model: {e}" ) )
65- else {
65+ let Some ( model) = options. model . or_else ( || {
66+ manifest
67+ . variable ( "model" , None )
68+ . inspect_err ( |e| eprintln ! ( "failed to read configured model: {e}" ) )
69+ . ok ( )
70+ } ) else {
6671 return Ok ( EX_CONFIG ) ; // not configured
6772 } ;
6873
You can’t perform that action at this time.
0 commit comments