Skip to content

Commit 31d8772

Browse files
chrysleinkarkat
andauthored
Improved usage messages for actions (#402)
Co-authored-by: Ingo Karkat <[email protected]>
1 parent 639e574 commit 31d8772

17 files changed

+105
-103
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ For example, to add a todo item, you can do:
7474
todo.sh add "THING I NEED TO DO +project @context"
7575
```
7676
### `replace`
77-
Replaces task on line ITEM# with UPDATED TODO.
77+
Replaces task on line NR with UPDATED TODO.
7878

7979
```shell
80-
todo.sh replace ITEM# "UPDATED TODO"
80+
todo.sh replace NR "UPDATED TODO"
8181
```
8282
### `report`
8383
Adds the number of open tasks and done tasks to report.txt.

USAGE.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ todo.sh addto DEST "TEXT TO ADD"
3838
```
3939

4040
### `append`
41-
Adds TEXT TO APPEND to the end of the task on line ITEM#.
41+
Adds TEXT TO APPEND to the end of the task on line NR.
4242

4343
Quotes optional.
4444

4545
```shell
46-
todo.sh append ITEM# "TEXT TO APPEND"
47-
todo.sh app ITEM# "TEXT TO APPEND"
46+
todo.sh append NR "TEXT TO APPEND"
47+
todo.sh app NR "TEXT TO APPEND"
4848
```
4949

5050
### `archive`
@@ -71,26 +71,26 @@ todo.sh deduplicate
7171
```
7272

7373
### `del`
74-
Deletes the task on line ITEM# in todo.txt. If TERM specified, deletes only TERM from the task.
74+
Deletes the task on line NR in todo.txt. If TERM specified, deletes only TERM from the task.
7575

7676
```shell
77-
todo.sh del ITEM# [TERM]
78-
todo.sh rm ITEM# [TERM]
77+
todo.sh del NR [TERM]
78+
todo.sh rm NR [TERM]
7979
```
8080

8181
### `depri`
82-
Deprioritizes (removes the priority) from the task(s) on line ITEM# in todo.txt.
82+
Deprioritizes (removes the priority) from the task(s) on line NR in todo.txt.
8383

8484
```shell
85-
todo.sh depri ITEM#[, ITEM#, ITEM#, ...]
86-
todo.sh dp ITEM#[, ITEM#, ITEM#, ...]
85+
todo.sh depri NR [NR ...]
86+
todo.sh dp NR [NR ...]
8787
```
8888

8989
### `do`
90-
Marks task(s) on line ITEM# as done in todo.txt.
90+
Marks task(s) on line NR as done in todo.txt.
9191

9292
```shell
93-
todo.sh do ITEM#[, ITEM#, ITEM#, ...]
93+
todo.sh do NR [NR ...]
9494
```
9595

9696
### `help`
@@ -164,34 +164,34 @@ todo.sh lsprj [TERM...]
164164
```
165165
166166
### `move`
167-
Moves a line from source text file (SRC) to destination text file (DEST). Both source and destination file must be located in the directory defined in the configuration directory. When SRC is not defined it's by default todo.txt.
167+
Moves line NR from source text file (SRC) to destination text file (DEST). Both source and destination file must be located in the directory defined in the configuration directory. When SRC is not defined it's by default todo.txt.
168168
169169
```shell
170-
todo.sh move ITEM# DEST [SRC]
171-
todo.sh mv ITEM# DEST [SRC]
170+
todo.sh move NR DEST [SRC]
171+
todo.sh mv NR DEST [SRC]
172172
```
173173
174174
### `prepend`
175-
Adds TEXT TO PREPEND to the beginning of the task on line ITEM#. Quotes optional.
175+
Adds TEXT TO PREPEND to the beginning of the task on line NR. Quotes optional.
176176
177177
```shell
178-
todo.sh prepend ITEM# "TEXT TO PREPEND"
179-
todo.sh prep ITEM# "TEXT TO PREPEND"
178+
todo.sh prepend NR "TEXT TO PREPEND"
179+
todo.sh prep NR"TEXT TO PREPEND"
180180
```
181181
182182
### `pri`
183-
Adds PRIORITY to task on line ITEM#. If the task is already prioritized, replaces current priority with new PRIORITY. PRIORITY must be a letter between A and Z.
183+
Adds PRIORITY to task on line NR. If the task is already prioritized, replaces current priority with new PRIORITY. PRIORITY must be a letter between A and Z.
184184
185185
```shell
186-
todo.sh pri ITEM# PRIORITY
187-
todo.sh p ITEM# PRIORITY
186+
todo.sh pri NR PRIORITY
187+
todo.sh p NR PRIORITY
188188
```
189189
190190
### `replace`
191-
Replaces task on line ITEM# with UPDATED TODO.
191+
Replaces task on line NR with UPDATED TODO.
192192
193193
```shell
194-
todo.sh replace ITEM# "UPDATED TODO"
194+
todo.sh replace NR "UPDATED TODO"
195195
```
196196
197197
### `report`

tests/actions-test-lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ make_dummy_action()
66
cat > "$1" <<EOF
77
#!/bin/bash
88
[ "\$1" = "usage" ] && {
9-
echo " $actionName ITEM#[, ITEM#, ...] [TERM...]"
9+
echo " $actionName NR [NR ...] [TERM...]"
1010
echo " This custom action does $actionName."
1111
echo ""
1212
exit

tests/t1100-replace.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ todo.sh add notice the daisies > /dev/null
1414
test_todo_session 'replace usage' <<EOF
1515
>>> todo.sh replace adf asdfa
1616
=== 1
17-
usage: todo.sh replace ITEM# "UPDATED ITEM"
17+
usage: todo.sh replace NR "UPDATED ITEM"
1818
EOF
1919

2020
test_todo_session 'basic replace' <<EOF

tests/t1200-pri.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test_description='basic priority functionality
66

77
test_todo_session 'priority usage' <<EOF
88
>>> todo.sh pri B B
9-
usage: todo.sh pri ITEM# PRIORITY[, ITEM# PRIORITY, ...]
9+
usage: todo.sh pri NR PRIORITY [NR PRIORITY ...]
1010
note: PRIORITY must be anywhere from A to Z.
1111
=== 1
1212
EOF

tests/t1400-prepend.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test_description='basic prepend functionality
66

77
test_todo_session 'prepend usage' <<EOF
88
>>> todo.sh prepend B B
9-
usage: todo.sh prepend ITEM# "TEXT TO PREPEND"
9+
usage: todo.sh prepend NR "TEXT TO PREPEND"
1010
=== 1
1111
EOF
1212

tests/t1500-do.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ test_description='do functionality
88

99
test_todo_session 'do usage' <<EOF
1010
>>> todo.sh do B B
11-
usage: todo.sh do ITEM#[, ITEM#, ITEM#, ...]
11+
usage: todo.sh do NR [NR ...]
1212
=== 1
1313
EOF
1414

15-
test_todo_session 'do missing ITEM#' <<EOF
15+
test_todo_session 'do missing NR' <<EOF
1616
>>> todo.sh do
17-
usage: todo.sh do ITEM#[, ITEM#, ITEM#, ...]
17+
usage: todo.sh do NR [NR ...]
1818
=== 1
1919
EOF
2020

tests/t1600-append.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ todo.sh add notice the daisies > /dev/null
1414
test_todo_session 'append usage' <<EOF
1515
>>> todo.sh append adf asdfa
1616
=== 1
17-
usage: todo.sh append ITEM# "TEXT TO APPEND"
17+
usage: todo.sh append NR "TEXT TO APPEND"
1818
EOF
1919

2020
test_todo_session 'append error' <<EOF

tests/t1700-depri.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test_description='basic depriority functionality
66

77
test_todo_session 'depriority usage' <<EOF
88
>>> todo.sh depri B B
9-
usage: todo.sh depri ITEM#[, ITEM#, ITEM#, ...]
9+
usage: todo.sh depri NR [NR ...]
1010
=== 1
1111
EOF
1212

tests/t1800-del.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SPACE=' '
88

99
test_todo_session 'del usage' <<EOF
1010
>>> todo.sh del B
11-
usage: todo.sh del ITEM# [TERM]
11+
usage: todo.sh del NR [TERM]
1212
=== 1
1313
EOF
1414

0 commit comments

Comments
 (0)