A file-based task manager

WIP: completion command

+24
+16
src/main.rs
··· 4 4 mod workspace; 5 5 use std::path::PathBuf; 6 6 use std::{env::current_dir, io::Read}; 7 + use clap_complete::Shell; 7 8 use workspace::Workspace; 8 9 9 10 //use smol; ··· 55 56 }, 56 57 57 58 Swap, 59 + 60 + Edit { 61 + #[arg(short = 't')] 62 + task_id: u32 63 + }, 64 + 65 + Completion { 66 + #[arg(short = 's')] 67 + shell: Shell 68 + } 58 69 } 59 70 60 71 #[derive(Args)] ··· 135 146 let workspace = Workspace::from_path(dir).expect("Unable to find .tsk dir"); 136 147 workspace.swap_top().expect("swap to work"); 137 148 } 149 + 150 + fn command_edit(dir: PathBuf) { 151 + let workspace = Workspace::from_path(dir).expect("Unable to find .tsk dir"); 152 + let task = workspace. 153 + }
+8
src/workspace.rs
··· 104 104 }) 105 105 } 106 106 107 + pub fn task(&self, id: Id) -> Result<Task> { 108 + let mut file = util::flopen( 109 + self.path.join("tasks").join(format!("tsk-{}.tsk", id.0)), 110 + FlockArg::LockExclusive, 111 + )?; 112 + 113 + } 114 + 107 115 pub fn read_stack(&self, count: Option<usize>) -> Result<TaskStack> { 108 116 TaskStack::from_tskdir(&self.path, count) 109 117 }