Skip to main content

ralph_workflow/cli/handlers/template_mgmt/
dispatch.rs

1/// Handle all template commands.
2pub fn handle_template_commands(commands: &TemplateCommands, colors: Colors) -> anyhow::Result<()> {
3    if commands.init_templates_enabled() {
4        handle_template_init(commands.force, colors)?;
5    } else if commands.validate {
6        handle_template_validate(colors);
7    } else if let Some(ref name) = commands.show {
8        handle_template_show(name, colors)?;
9    } else if commands.list {
10        handle_template_list(colors);
11    } else if commands.list_all {
12        handle_template_list_all(colors);
13    } else if let Some(ref name) = commands.variables {
14        handle_template_variables(name, colors)?;
15    } else if let Some(ref name) = commands.render {
16        handle_template_render(name, colors)?;
17    }
18
19    Ok(())
20}