linear_motion/cli/
commands.rs

1use clap::{Parser, Subcommand};
2
3#[derive(Parser)]
4#[command(name = "linear-motion")]
5#[command(about = "Linear-Motion sync tool for automating task synchronization")]
6#[command(version = "1.0")]
7pub struct Cli {
8    #[command(subcommand)]
9    pub command: Commands,
10
11    #[arg(short, long, help = "Enable verbose logging")]
12    pub verbose: bool,
13
14    #[arg(
15        short,
16        long,
17        help = "Path to configuration file (defaults to user config dir)"
18    )]
19    pub config: Option<String>,
20}
21
22#[derive(Subcommand)]
23pub enum Commands {
24    /// Initialize configuration file
25    Init {
26        #[arg(
27            short,
28            long,
29            help = "Output path for config file (defaults to user config dir)"
30        )]
31        output: Option<String>,
32
33        #[arg(short, long, help = "Force overwrite existing config")]
34        force: bool,
35    },
36
37    /// Run sync operation
38    Sync {
39        #[arg(short, long, help = "Run as daemon in watch mode")]
40        watch: bool,
41
42        #[arg(
43            short,
44            long,
45            help = "Daemon PID file path",
46            default_value = ".linear-motion.pid"
47        )]
48        pid_file: String,
49
50        #[arg(short, long, help = "Force update all tasks regardless of detected changes")]
51        force: bool,
52    },
53
54    /// Query daemon status
55    Status,
56
57    /// Stop running daemon
58    Stop,
59
60    /// List all tracked issues and metadata in local database
61    List {
62        #[arg(short, long, help = "Show detailed information for each entry")]
63        verbose: bool,
64
65        #[arg(short, long, help = "Filter by sync source name")]
66        source: Option<String>,
67    },
68}