- Time: Wait tasks sort by when the wait ends, earliest first. Limit reset tasks sort by when their wait ended, so the one that has been ready longest comes first. The time is kept when a wait expires, which is what makes the second sort possible. - Order: I put time before account for these two statuses, so the full order is status, then time, then account, then name. Other statuses still go status, account, name. If you'd rather have account before time, swap the two checks in taskLess in Display.cpp. - Manual limit reset: a task you set to limit-reset by hand has no wait time, so it sorts first among limit resets. Account status: an account takes the most taken level among its tasks. - Busy: it has a Testing, Limit reset or Wait task. The TASKS column lists those tasks. - Taken: it has a Prompt task and nothing Busy. The TASKS column lists the Prompt tasks. - Free: it only has Done, Frozen or Uploading tasks, or no tasks. The TASKS column shows Changes to be committed: modified: README.md modified: include/Display.h modified: include/Status.h modified: src/Completer.cpp modified: src/Display.cpp modified: src/Repl.cpp modified: src/Status.cpp
92 lines
4.1 KiB
Markdown
92 lines
4.1 KiB
Markdown
# LLS
|
|
|
|
Interactive C++17 / SQLite task + account tracker. Type commands at the `>` prompt.
|
|
|
|
## Build
|
|
|
|
Requires CMake >= 3.14 and a C++17 compiler. SQLite is taken from the system if
|
|
installed; otherwise CMake downloads the amalgamation (needs network once).
|
|
|
|
# optional, system SQLite:
|
|
# Debian/Ubuntu: sudo apt install libsqlite3-dev
|
|
# Fedora: sudo dnf install sqlite-devel
|
|
# Arch: sudo pacman -S sqlite
|
|
|
|
cmake -S . -B build
|
|
cmake --build build
|
|
./build/lls [database-file] # default: tasks.db
|
|
|
|
## Commands
|
|
|
|
acc add <name> tsk add <name> [acc] [status]
|
|
acc del <name> tsk del <name>
|
|
acc rename <name> <new> tsk rename <name> <new>
|
|
acc ls tsk reacc <name> <new|->
|
|
tsk restat <name> <new>
|
|
tsk notes <name> (opens your editor)
|
|
tsk ls
|
|
|
|
disp tsk (hide|show)
|
|
disp tsk level (hide|show) (prompt|limit-reset|testing|wait|uploading|frozen|done|all)
|
|
disp acc (hide|show)
|
|
disp acc level (hide|show) (busy|taken|free|all)
|
|
disp (show current settings)
|
|
|
|
db save | db backup [file] | db restore <file>
|
|
editor [command | default] (show / set the editor used by tsk notes)
|
|
help | quit
|
|
|
|
Names containing spaces go in double quotes: `tsk add "Breeze A" Acrux testing`.
|
|
|
|
## Statuses and times
|
|
|
|
`prompt` (free to accept prompts), `limit-reset`, `testing`, `wait <time>`,
|
|
`uploading`, `frozen`, `done`. `limit-reset` is normally computed: a `wait`
|
|
task shows as `Limit reset` once its time has passed (it can also be set by
|
|
hand; `limit reset` with a space works too). Old databases that say
|
|
`available` are converted to `prompt` on load.
|
|
|
|
Times may be 24-hour or 12-hour: `wait 16:30`, `wait 4:30pm`, `wait 4 pm`,
|
|
`wait 12:05am`. Without am/pm the time is read as 24-hour (`6:40` = 06:40).
|
|
A time that has already passed today is stored as tomorrow.
|
|
|
|
## Prompt keys
|
|
|
|
Up/Down history (saved between sessions), Left/Right/Home/End editing,
|
|
Ctrl-Left/Right word jump, Tab completion (commands, task and account names,
|
|
statuses, levels, editors, file paths; press Tab twice-ish to list options),
|
|
Ctrl-A/E, Ctrl-U/K/W, Ctrl-L clear, Ctrl-C cancel line, Ctrl-D quit.
|
|
Pressing Enter on an empty line redraws the panels (waits expire with time).
|
|
|
|
## Editor
|
|
|
|
`tsk notes <name>` opens the notes in an external editor. Use `editor nvim`
|
|
(or `vim`, `vi`, `nano`, `code --wait`, ...) to choose one; `editor default`
|
|
goes back to `$VISUAL` / `$EDITOR` / nano / vim / vi. The choice is stored in
|
|
`~/.config/task_tracker/config` (history is in the same folder).
|
|
|
|
## How it works
|
|
|
|
* Data lives in an in-memory SQLite database. `db save` writes it to the file,
|
|
`db backup` writes a copy, `db restore` loads a file. On `quit` you are asked
|
|
to save if there are unsaved changes.
|
|
* The stored status is never shown directly: a `wait` task displays as
|
|
`Wait HH:MM` until that time passes, then as `Limit reset`. Tasks are sorted
|
|
by computed status (Limit reset, Testing, Prompt, Wait, Uploading, Frozen,
|
|
Done); Wait and Limit reset tasks then sort by time (earliest first: when
|
|
the wait ends / ended), then account A-Z (unassigned last), then name. The panels are cleared and redrawn after changes.
|
|
* Account panel: one row per account, judged by its tasks: `Busy` if any is
|
|
Testing, Limit reset or Wait; else `Taken` if any is Prompt; else `Free`
|
|
(only Done, Frozen or Uploading tasks, or no tasks). The TASKS column lists
|
|
the tasks at that level. Rows are sorted most free first: Free, Taken, Busy,
|
|
fewer tasks first, ties by name (see `levelOf` in `Display.cpp` and
|
|
`StatusUtil::isBusy` / `isTaken` to change the rules).
|
|
* Deleting an account leaves its tasks unassigned (`-`).
|
|
* Names are case-insensitive; the original spelling is kept.
|
|
* Notes live in the database (SQLite TEXT, binary-safe, SQLite's default limit is ~1 GB). The task table shows `-` when a task has no notes, otherwise the number of lines (e.g. `3 lines`); open them with `tsk notes <name>`.
|
|
|
|
## Layout
|
|
|
|
include/ headers (declarations only, no inline definitions)
|
|
src/ implementations
|