Skip to content

Commit 01d19b4

Browse files
committed
Add --model option
1 parent cb5e0b6 commit 01d19b4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/prompter/main.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)