systemprompt_cli/commands/web/sitemap/
mod.rs1mod generate;
10pub mod show;
11
12use anyhow::{Context, Result};
13use clap::Subcommand;
14
15use crate::CliConfig;
16use crate::shared::render_result;
17
18#[derive(Debug, Subcommand)]
19pub enum SitemapCommands {
20 #[command(about = "Show sitemap configuration", alias = "list")]
21 Show(show::ShowArgs),
22
23 #[command(about = "Generate sitemap.xml")]
24 Generate(generate::GenerateArgs),
25}
26
27pub fn execute(command: SitemapCommands, config: &CliConfig) -> Result<()> {
28 match command {
29 SitemapCommands::Show(args) => {
30 let result = show::execute(args, config).context("Failed to show sitemap")?;
31 render_result(&result, config);
32 Ok(())
33 },
34 SitemapCommands::Generate(args) => {
35 let result = generate::execute(&args, config).context("Failed to generate sitemap")?;
36 render_result(&result, config);
37 Ok(())
38 },
39 }
40}