Skip to main content

rs_claude_bar/
cli.rs

1use clap::{Parser, Subcommand};
2
3#[derive(Parser)]
4#[command(name = "rs-claude-bar", about = "Track Claude usage", version)]
5pub struct Cli {
6    /// Force bypass cache and reprocess all files
7    #[arg(long, global = true)]
8    pub no_cache: bool,
9    
10    /// Don't save cache after processing
11    #[arg(long, global = true)]
12    pub no_save: bool,
13    
14    #[command(subcommand)]
15    pub command: Option<Commands>,
16}
17
18#[derive(Subcommand, Clone)]
19pub enum Commands {
20    /// Show basic usage information
21    Info,
22    /// Show detailed Help with examples
23    Help{        
24        #[command(subcommand)]
25        command: Option<HelpCommands>,
26    },
27    /// Show line prompt (basic use of the app)
28    Prompt,
29    /// Install command to configure Claude settings
30    Install,
31    /// Manage configuration settings
32    Config {
33        #[command(subcommand)]
34        command: Option<ConfigCommands>,
35    },
36    /// Display last 5-hour usage blocks
37    Blocks{        
38        #[command(subcommand)]
39        command: Option<BlocksCommands>,
40    },
41}
42
43#[derive(Subcommand, Clone)]
44pub enum BlocksCommands {
45    /// Configure Claude data path
46    #[command(name = "all")]
47    All,
48    /// Configure Claude data path
49    #[command(name = "limits")]
50    Limits,
51    /// Configure Claude data path
52    #[command(name = "gaps")]
53    Gap,  
54}
55
56#[derive(Subcommand, Clone)]
57pub enum HelpCommands {
58    /// Configure Claude data path
59    #[command(name = "config")]
60    Config,
61    /// Configure Claude data path
62    #[command(name = "prompt")]
63    Prompt,
64    /// Configure Claude data path
65    #[command(name = "install")]
66    Install,
67    /// Configure Claude data path
68    #[command(name = "blocks")]
69    Blocks,    
70}
71
72#[derive(Subcommand, Clone)]
73pub enum ConfigCommands {
74    /// Configure Claude data path
75    #[command(name = "claude-path")]
76    ClaudePath,
77    /// Configure display settings
78    #[command(name = "display")]
79    Display,
80}