summaryrefslogtreecommitdiff
path: root/makima/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/bin')
-rw-r--r--makima/src/bin/makima.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/makima/src/bin/makima.rs b/makima/src/bin/makima.rs
index 070e28e..aaf5a08 100644
--- a/makima/src/bin/makima.rs
+++ b/makima/src/bin/makima.rs
@@ -800,6 +800,18 @@ async fn run_directive(
.await?;
println!("{}", serde_json::to_string(&result.0)?);
}
+ DirectiveCommand::Ask(args) => {
+ let client = ApiClient::new(args.common.api_url.clone(), args.common.api_key.clone())?;
+ eprintln!("Asking user: {}...", args.question);
+ let choices = args
+ .choices
+ .map(|c| c.split(',').map(|s| s.trim().to_string()).collect())
+ .unwrap_or_default();
+ let result = client
+ .supervisor_ask(&args.question, choices, args.context, args.timeout, args.phaseguard, args.multi_select, args.non_blocking, args.question_type)
+ .await?;
+ println!("{}", serde_json::to_string(&result.0)?);
+ }
}
Ok(())