Documentation
pub mod create;
pub mod install;
pub mod play;
pub mod uninstall;

use clap::{Parser, Subcommand};
use std::path::PathBuf;

pub use create::create_glyph;
pub use install::install;
pub use play::play_glyph;
pub use uninstall::uninstall;

#[derive(Parser)]
#[command(author, version, about, long_about = None)]
#[command(name = "glyph")]
pub struct Cli {
    #[command(subcommand)]
    pub command: Option<Commands>,

    /// Input Glyph file to play (when no subcommand is provided)
    #[arg(required = false)]
    pub input: Option<PathBuf>,

    /// Number of times to loop the animation (0 for infinite)
    #[arg(short, long, default_value = "1")]
    pub loops: u32,
}

#[derive(Subcommand)]
pub enum Commands {
    /// Create a new Glyph animation
    Create {
        /// First frame file or directory containing frame sequence
        #[arg(required = true)]
        input: PathBuf,

        /// Output Glyph file
        #[arg(short, long)]
        output: PathBuf,

        /// Default frame duration in milliseconds
        #[arg(short, long, default_value = "100")]
        duration: u32,
    },

    /// Install Glyph system-wide with file associations
    Install,

    /// Uninstall Glyph and remove all system configurations
    Uninstall,
}