Skip to content

Commit

Permalink
bump version to v1.7.0
Browse files Browse the repository at this point in the history
and make the "daily hook" only for unix
  • Loading branch information
jfding committed Oct 4, 2024
1 parent 44ce3e3 commit 9f6db51
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "todor"
version = "1.6.0"
version = "1.7.0"
edition = "2021"
authors = ["JF Ding <[email protected]>"]
description = "yet another cli TODO in Rust"
Expand Down
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,54 @@
- commands:
- list(default), listall, add, mark, edit, count
- purge, browse, listbox
- sink, shift, collect, pool
- sink, shift, collect, pool(old: postp)
- import
- cleanup

- [ ] sync with iCloud
- [ ] sync with MS-TODO

## Usage
```
Usage: todor [OPTIONS] [COMMAND]
Commands:
add -> add todo item to inbox [aliases: a]
mark -> mark item as done [aliases: m]
list -> list all uncompeleted tasks in box [aliases: l, ls]
listall -> list all(including compeleted) tasks [aliases: la]
listbox -> list all todo box in working dir [aliases: lb]
edit -> edit todo inbox file [aliases: e, ed]
count -> count items in inbox [aliases: c]
browse -> show items in all inboxes [aliases: b]
purge -> purge all the duplicated lines
sink -> sink all outdated uncompeleted to "today"
shift -> shift all uncompeleted in "today" to "tomorrow"
collect -> collect all uncompeleted in INBOX(or --inbox <which>) to "today"
pool -> pooling all uncompeleted of today to INBOX
import -> import uncompeleted task in any markdown file to current
cleanup -> clean up all empty datetime taskbox
checkout -> checkout routine tasks to "today"(collect --inbox routine)
help Print this message or the help of the given subcommand(s)
Options:
-c, --config <CONF> config file
-d, --dir <FOLDER> working dir
-i, --inbox <FILE> inbox file
-h, --help Print help
-V, --version Print version
```
and with a trick:
```
ln -sf todor today
ln -sf todor tomorrow
ln -sf todor t.reading
ln -sf todor todo.coding
```
these symlinks(execuables) will help you to locate the corresponding task-box quickly. ("today", "tomorrow", "reading", "coding", respectively)

## How the tasks are moving around

These four commands: `sink`, `shift`, `collect`, `pool` are designed to move tasks around in the list. And below is a diagram to show how they work.
Expand Down
6 changes: 3 additions & 3 deletions src/taskbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ impl TaskBox {
fs::File::create(fpath).expect("Failed to create file");
fs::write(fpath, format!("# {}\n\n", title)).expect("Failed to write to file");

// if it's "today" box, run 'checkout' once
if self.title == Some(get_today()) {
// if it's "today" box, run 'checkout' once [only Unix]
if self.title == Some(get_today()) && cfg!(unix) {
use stdio_override::{StdoutOverride, StderrOverride};
let null = if cfg!(windows) { "nul" } else { "/dev/null" };
let null = "/dev/null";
let guard = StdoutOverride::override_file(null).unwrap();
let eguard = StderrOverride::override_file(null).unwrap();

Expand Down

0 comments on commit 9f6db51

Please sign in to comment.