Skip to main content

hardly_working/
cli.rs

1use clap::{Parser, Subcommand};
2
3#[derive(Parser)]
4#[clap(name = "hw", about = "Working hard or hardly working", version)]
5pub struct Cli {
6    #[clap(subcommand)]
7    pub command: Option<Commands>,
8}
9
10#[derive(Subcommand)]
11pub enum Commands {
12    Config {
13        #[clap(short, long, value_parser)]
14        file_path: Option<String>,
15
16        #[clap(long, action)]
17        show: bool,
18    },
19
20    Add {
21        #[clap(short, long, value_parser)]
22        group: Option<String>,
23
24        #[clap(value_parser)]
25        description: String,
26    },
27
28    #[clap(alias = "ls")]
29    List,
30
31    Toggle {
32        #[clap(value_parser)]
33        task_id: usize,
34    },
35
36    Remove {
37        #[clap(value_parser)]
38        task_id: usize,
39    },
40
41    Edit {
42        #[clap(value_parser)]
43        task_id: usize,
44
45        #[clap(value_parser)]
46        description: String,
47    },
48
49    Search {
50        #[clap(value_parser)]
51        partial_description: String,
52    },
53    #[clap(alias = "rm")]
54    Clear {},
55}