todotxt / todo.txt-cli

☑️ A simple and extensible shell script for managing your todo.txt file.
http://todotxt.org
GNU General Public License v3.0
5.56k stars 713 forks source link

Allow multiple priorities on single run fixes #281 #346

Closed the1ts closed 3 years ago

the1ts commented 3 years ago

Uses current priority logic and option tests just running multiple times until item and priority pairs are exhausted or stops on first error.

Tests for multiple priorities, multiple re-prioritisations and a couple of errors created. All tests pass.

fixes #281

Usage is: todo.sh pri 1 A 2 B 3 C which changes priority on lines 1, 2 and 3.

TomGranot commented 2 years ago

@the1ts / @inkarkat So, if this works as I understand it does, todo.sh pri 246 A 245 B should work if both items exist. Sorry for hijacking a PR, but context is important:)

I'm getting:

usage: todo.sh pri ITEM# PRIORITY
note: PRIORITY must be anywhere from A to Z.

Thoughts?

EDIT:

Ah, just realized this was merged after latest release. https://github.com/todotxt/todo.txt-cli/pull/346/files

Guess I'll grab the shell script myself:)

For anyone interested:

  1. Clone this repo locally
  2. Open the repo's folder, then run make install (Yay for makefiles!)
  3. Profit!
inkarkat commented 2 years ago

@TomGranot The error message tells me that you don't have the latest development version of todo.sh installed. If this feature were included, the error would look like this:

$ todo.sh command pri x x x
usage: todo.sh pri ITEM# PRIORITY[, ITEM# PRIORITY, ...]
note: PRIORITY must be anywhere from A to Z.

The last release is v2.12.0 from 12-Aug-2020; this change was introduced a year later. Ah, you've found that out already while I was typing this.

@karbassi How about a new release; it's been a while? Some PRs (#360 and #365 from me, and #375 for the Readme) would be ready for inclusion in that release.