linear_motion/cli/
commands.rs1use 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 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 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 Status,
56
57 Stop,
59
60 Tasks {
62 #[arg(short, long, help = "Output waybar JSON format (current + next task)")]
63 waybar: bool,
64 },
65
66 Complete {
68 #[arg(long, help = "Motion task ID to mark as completed", conflicts_with = "current")]
69 id: Option<String>,
70
71 #[arg(long, help = "Complete the current task (as last shown by `tasks --waybar`)", conflicts_with = "id")]
72 current: bool,
73 },
74
75 List {
77 #[arg(short, long, help = "Show detailed information for each entry")]
78 verbose: bool,
79
80 #[arg(short, long, help = "Filter by sync source name")]
81 source: Option<String>,
82 },
83}