tangled
alpha
login
or
join now
ngp.computer
/
tsk
A file-based task manager
0
fork
atom
overview
issues
pulls
pipelines
WIP: completion command
ngp.computer
1 year ago
9c01bd41
21245697
+24
2 changed files
expand all
collapse all
unified
split
src
main.rs
workspace.rs
+16
src/main.rs
···
4
4
mod workspace;
5
5
use std::path::PathBuf;
6
6
use std::{env::current_dir, io::Read};
7
7
+
use clap_complete::Shell;
7
8
use workspace::Workspace;
8
9
9
10
//use smol;
···
55
56
},
56
57
57
58
Swap,
59
59
+
60
60
+
Edit {
61
61
+
#[arg(short = 't')]
62
62
+
task_id: u32
63
63
+
},
64
64
+
65
65
+
Completion {
66
66
+
#[arg(short = 's')]
67
67
+
shell: Shell
68
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
149
+
150
150
+
fn command_edit(dir: PathBuf) {
151
151
+
let workspace = Workspace::from_path(dir).expect("Unable to find .tsk dir");
152
152
+
let task = workspace.
153
153
+
}
+8
src/workspace.rs
···
104
104
})
105
105
}
106
106
107
107
+
pub fn task(&self, id: Id) -> Result<Task> {
108
108
+
let mut file = util::flopen(
109
109
+
self.path.join("tasks").join(format!("tsk-{}.tsk", id.0)),
110
110
+
FlockArg::LockExclusive,
111
111
+
)?;
112
112
+
113
113
+
}
114
114
+
107
115
pub fn read_stack(&self, count: Option<usize>) -> Result<TaskStack> {
108
116
TaskStack::from_tskdir(&self.path, count)
109
117
}