streamd/src/cli/args.rs
Konstantin Fickel 124a5b7e2a
feat(todo): add numbered tasks, edit, done, and future filtering
Implement smoother todo editing with the following features:
- Display numbered tasks [1], [2], etc. in `streamd todo`
- Add `streamd todo N edit` to open editor at task line
- Add `streamd todo N done` to insert @Done after @Task
- Add `--show-future` flag to include future tasks (hidden by default)
2026-04-02 18:27:19 +02:00

61 lines
1.3 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,
/// Generate shell completions
Completions {
/// Shell to generate completions for
#[arg(value_enum)]
shell: Shell,
},
}