Skip to main content

wekan_cli/commands/
skill.rs

1mod list;
2mod show;
3mod topics;
4
5use clap::{Args, Subcommand};
6
7use crate::{command_result::CommandSuccess, error::AppError};
8
9pub use self::{list::ListArgs, show::ShowArgs};
10
11#[derive(Debug, Args)]
12pub struct SkillArgs {
13    #[command(subcommand)]
14    pub command: SkillCommand,
15}
16
17#[derive(Debug, Subcommand)]
18pub enum SkillCommand {
19    /// List the available embedded guidance topics alphabetically.
20    List(ListArgs),
21    /// Print an embedded Markdown guide; defaults to core.
22    Show(ShowArgs),
23}
24
25pub(crate) fn dispatch(command: SkillCommand) -> Result<CommandSuccess, AppError> {
26    match command {
27        SkillCommand::List(args) => Ok(list::execute(args)),
28        SkillCommand::Show(args) => show::execute(args),
29    }
30}