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.55k stars 712 forks source link

Todo.sh [archive] won't work #398

Closed chrysle closed 1 year ago

chrysle commented 1 year ago

Do you want to request a feature or report a bug?

bug

What is the current behavior?

todo.sh won't archive tasks by moving them to done.txt as described here.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

user@penguin:~/todo.txt_cli-2.12.0$ todo.sh ls 
2 (A) Very important task @github 
1 (A) Very important task @home
--
TODO: 2 of 2 tasks shown
user@penguin:~/todo.txt_cli-2.12.0$ todo.sh archive
TODO: ./todo.txt archived.
user@penguin:~/todo.txt_cli-2.12.0$ cat done.txt 
user@penguin:~/todo.txt_cli-2.12.0$ todo.sh ls
2 (A) Very important task @github 
1 (A) Very important task @home
--
TODO: 2 of 2 tasks shown
user@penguin:~/todo.txt_cli-2.12.0$ ls
total 68K
-rw-rw-r-- 1 user user    0 Dec  9 15:04 done.txt
-rw-rw-r-- 1 user user    0 Dec  9 15:04 report.txt
-rw-r--r-- 1 user user 2.9K Aug 12  2020 todo.cfg
-rwxr-xr-x 1 user user 6.1K Aug 12  2020 todo_completion
-rwxr-xr-x 1 user user  48K Aug 12  2020 todo.sh
-rw-rw-r-- 1 user user   94 Dec  9 15:20 todo.txt
-rw-rw-r-- 1 user user   94 Dec  9 15:20 todo.txt.bak

What is the expected behavior?

All tasks are moved to done.txt in the same directory.

Which versions todo.sh are you using?

Run todo.sh -V

v2.12.0

Which Operating System are you using?

Ubuntu 20.04 LTS

Which version of bash are you using?

Run bash --version

GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)

inkarkat commented 1 year ago

Read closely:

Moves all done tasks

Your tasks are still open, and you don't have any empty lines in the todo file, so nothing happens.

Once you todo.sh do 1, that (now done) task should be moved by todo.sh archive. The archive is meant as a long-term record of accomplished things, so tasks that are still open certainly don't belong there.

chrysle commented 1 year ago

Thank you! Shouldn't then be described in the documentation that tasks marked by do are automatically archived? Or that archive only needs to be used when tasks are marked manually as completed?

inkarkat commented 1 year ago

The occasion when archiving happens can be influenced via the -a and -A command-line options, or in the config via the TODOTXT_AUTO_ARCHIVE variable.

chrysle commented 1 year ago

Thanks again! Next time I will study the documentation more closely.