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