-
Notifications
You must be signed in to change notification settings - Fork 713
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new: Add default priority variable TODOTXT_PRIORITY_ON_ADD. (#246)
Adds the config / env variable `TODOTXT_PRIORITY_ON_ADD`, which when set to one of the capital letters `A` to `Z` is given as a priority to a new task, if a priority is not given on command line.
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
test_description='test the priority on add feature' | ||
. ./test-lib.sh | ||
|
||
## Normal use case | ||
echo "export TODOTXT_PRIORITY_ON_ADD=A" >> todo.cfg | ||
|
||
test_todo_session 'config file priority' <<EOF | ||
>>> todo.sh add take out the trash | ||
1 (A) take out the trash | ||
TODO: 1 added. | ||
>>> todo.sh -p list | ||
1 (A) take out the trash | ||
-- | ||
TODO: 1 of 1 tasks shown | ||
EOF | ||
|
||
## Wrong value in config var | ||
echo "export TODOTXT_PRIORITY_ON_ADD=1" >> todo.cfg | ||
|
||
test_todo_session 'config file wrong priority' <<EOF | ||
>>> todo.sh add fail to take out the trash | ||
=== 1 | ||
TODOTXT_PRIORITY_ON_ADD should be a capital letter from A to Z (it is now "1"). | ||
>>> todo.sh -p list | ||
=== 1 | ||
TODOTXT_PRIORITY_ON_ADD should be a capital letter from A to Z (it is now "1"). | ||
EOF | ||
|
||
test_done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters