use std::process;
use crate::cli::Command;
use crate::commands;
pub(crate) fn dispatch(command: Command) {
match command {
Command::DumpHighlightKeywords(args) => {
commands::dump_highlight_keywords::run(
&args.output,
&args.json_output,
&args.wasm_json_output,
args.check,
);
}
Command::DumpPortableBenchmarkSchema(args) => {
commands::dump_portable_benchmark_schema::run(&args.output, args.check);
}
Command::DumpPromptGrammar(args) => {
commands::dump_prompt_grammar::run(&args.output, args.check);
}
Command::DumpTriggerQuickref(args) => {
commands::dump_trigger_quickref::run(&args.output, args.check);
}
Command::DumpCliSurface(args) => {
commands::argument_schema::dump_surface(&args.output, args.check);
}
Command::DumpConnectorMatrix(args) => {
commands::check::connector_matrix::run_docs(&args.output, &args.sources, args.check);
}
Command::DumpProtocolArtifacts(args) => {
commands::dump_protocol_artifacts::run(&args.output_dir, args.check);
}
Command::DumpHarnessMigrations(args) => {
let code = commands::harness_migration_codegen::run(&args);
if code != 0 {
process::exit(code);
}
}
Command::ConnectorSchemaCodegen(args) => {
let code = commands::connector_schema_codegen::run(&args);
if code != 0 {
process::exit(code);
}
}
other => unreachable!("not a generator command: {other:?}"),
}
}