tangled
alpha
login
or
join now
ngp.computer
/
tsk
A file-based task manager
0
fork
atom
overview
issues
pulls
pipelines
FIX: -T command flag parsing
ngp.computer
1 year ago
449d4603
94db1885
+14
-5
7 changed files
expand all
collapse all
unified
split
.tsk
archive
tsk-26.tsk
index
next
tasks
tsk-26.tsk
Cargo.lock
src
main.rs
workspace.rs
+2
.tsk/archive/tsk-26.tsk
···
1
1
+
fix -T tsk-id parsing
2
2
+
+1
-1
.tsk/index
···
1
1
+
tsk-10 foreign workspaces
1
2
tsk-21 Add command to setup git stuff
2
3
tsk-8 IMAP4-based sync
3
4
tsk-17 Add reopen command
4
5
tsk-16 Add ability to search archived tasks with find command
5
6
tsk-15 Add link identification to tasks
6
7
tsk-9 fix timestamp storage and parsing
7
7
-
tsk-10 foreign workspaces
8
8
tsk-7 allow for creating tasks that don't go to top of stack
9
9
tsk-13 user-defined labels
10
10
tsk-18 Add reindex command
+1
-1
.tsk/next
···
1
1
-
26
1
1
+
27
+1
.tsk/tasks/tsk-26.tsk
···
1
1
+
../archive/tsk-26.tsk
+1
-1
Cargo.lock
···
590
590
]
591
591
592
592
[[package]]
593
593
-
name = "tsk"
593
593
+
name = "tsk-cli"
594
594
version = "0.2.3"
595
595
dependencies = [
596
596
"clap",
+7
-2
src/main.rs
···
10
10
use std::io::{self, Write};
11
11
use std::path::PathBuf;
12
12
use std::process::exit;
13
13
+
use std::str::FromStr as _;
13
14
use std::{env::current_dir, io::Read};
14
15
use task::ParsedLink;
15
16
use workspace::{Id, TaskIdentifier, Workspace};
16
17
17
18
//use smol;
18
19
//use iocraft::prelude::*;
19
19
-
use clap::{value_parser, Args, CommandFactory, Parser, Subcommand};
20
20
+
use clap::{Args, CommandFactory, Parser, Subcommand};
20
21
use edit::edit as open_editor;
21
22
22
23
fn default_dir() -> PathBuf {
23
24
current_dir().unwrap()
25
25
+
}
26
26
+
27
27
+
fn parse_id(s: &str) -> std::result::Result<Id, &'static str> {
28
28
+
Ok(Id::from_str(s).map_err(|_| "Unable to parse tsk- ID")?)
24
29
}
25
30
26
31
#[derive(Parser)]
···
170
175
id: Option<u32>,
171
176
172
177
/// The ID of the task to select with the 'tsk-' prefix.
173
173
-
#[arg(short = 'T', value_name = "TSK-ID", value_parser = value_parser!(String))]
178
178
+
#[arg(short = 'T', value_name = "TSK-ID", value_parser = parse_id)]
174
179
tsk_id: Option<Id>,
175
180
176
181
/// Selects a task relative to the top of the stack.
+1
src/workspace.rs
···
31
31
32
32
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
33
33
let s = s
34
34
+
.trim()
34
35
.strip_prefix("tsk-")
35
36
.ok_or(Self::Err::Parse(format!("expected tsk- prefix. Got {s}")))?;
36
37
Ok(Self(s.parse()?))