streamd/src/cli/args.rs

69 lines
1.5 KiB
Rust

use clap::{Parser, Subcommand};
use clap_complete::Shell;
#[derive(Parser)]
#[command(name = "streamd")]
#[command(
author,
version,
about = "Personal knowledge management and time-tracking CLI using @Tag annotations"
)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Commands>,
}
#[derive(Subcommand)]
pub enum TodoAction {
/// Edit a task by its number
Edit {
/// Task number to edit
number: usize,
},
/// Mark a task as done
Done {
/// Task number to mark as done
number: usize,
},
}
#[derive(Subcommand)]
pub enum Commands {
/// Create a new stream file
New,
/// Display open tasks
Todo {
/// Show tasks with dates in the future
#[arg(long)]
show_future: bool,
#[command(subcommand)]
action: Option<TodoAction>,
},
/// Edit a stream file by position
Edit {
/// Position of the file to edit (0 = most recent, negative = from oldest)
#[arg(default_value = "1")]
number: i32,
},
/// Display extracted timesheets
Timesheet {
/// Display time as minutes (HH:MM) instead of decimal hours (H.Hh)
#[arg(short, long)]
minutes: bool,
/// Show all timecards grouped by day instead of the summary report
#[arg(short, long)]
debug: bool,
},
/// Generate shell completions
Completions {
/// Shell to generate completions for
#[arg(value_enum)]
shell: Shell,
},
}