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