Skip to content

Conversation

@the1ts
Copy link
Contributor

@the1ts the1ts commented Jul 6, 2021

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.

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 reprioritizations and a couple
of errors.
Copy link
Member

@inkarkat inkarkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally can't think of a case where I would need to do multiple priorizations with different priorities, and would prefer a todo.sh pri PRIORITY ITEM# [, ITEM#, ...] syntax, but I understand that this is a matter of taste, and what you've chosen is universal and also rather simple in its implementation.

@karbassi karbassi merged commit 353db49 into todotxt:master Aug 3, 2021
@the1ts the1ts deleted the multi-pri branch August 3, 2021 23:30
wwalker pushed a commit to wwalker/todo.txt-cli that referenced this pull request Sep 19, 2021
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-prioritization and a couple of errors.
@TomGranot
Copy link

TomGranot commented Mar 21, 2022

@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
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prioritize multiple tasks in one command

4 participants