Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved usage messages for actions #402

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ todo.sh addto DEST "TEXT TO ADD"
```

### `append`
Adds TEXT TO APPEND to the end of the task on line ITEM#.
Adds TEXT TO APPEND to the end of the task on line NR.

Quotes optional.

```shell
todo.sh append ITEM# "TEXT TO APPEND"
todo.sh app ITEM# "TEXT TO APPEND"
todo.sh append NR "TEXT TO APPEND"
todo.sh app NR "TEXT TO APPEND"
```

### `archive`
Expand All @@ -71,26 +71,26 @@ todo.sh deduplicate
```

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

```shell
todo.sh del ITEM# [TERM]
todo.sh rm ITEM# [TERM]
todo.sh del NR [TERM]
todo.sh rm NR [TERM]
```

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

```shell
todo.sh depri ITEM#[, ITEM#, ITEM#, ...]
todo.sh dp ITEM#[, ITEM#, ITEM#, ...]
todo.sh depri NR [NR ...]
todo.sh dp NR [NR ...]
```

### `do`
Marks task(s) on line ITEM# as done in todo.txt.

```shell
todo.sh do ITEM#[, ITEM#, ITEM#, ...]
todo.sh do NR [NR ...]
```

### `help`
Expand Down Expand Up @@ -164,34 +164,34 @@ todo.sh lsprj [TERM...]
```

### `move`
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.
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.

```shell
todo.sh move ITEM# DEST [SRC]
todo.sh mv ITEM# DEST [SRC]
todo.sh move NR DEST [SRC]
todo.sh mv NR DEST [SRC]
```

### `prepend`
Adds TEXT TO PREPEND to the beginning of the task on line ITEM#. Quotes optional.
Adds TEXT TO PREPEND to the beginning of the task on line NR. Quotes optional.

```shell
todo.sh prepend ITEM# "TEXT TO PREPEND"
todo.sh prep ITEM# "TEXT TO PREPEND"
todo.sh prepend NR "TEXT TO PREPEND"
todo.sh prep NR"TEXT TO PREPEND"
```

### `pri`
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.
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.

```shell
todo.sh pri ITEM# PRIORITY
todo.sh p ITEM# PRIORITY
todo.sh pri NR PRIORITY
todo.sh p NR PRIORITY
```

### `replace`
Replaces task on line ITEM# with UPDATED TODO.
Replaces task on line NR with UPDATED TODO.

```shell
todo.sh replace ITEM# "UPDATED TODO"
todo.sh replace NR "UPDATED TODO"
```

### `report`
Expand Down
2 changes: 1 addition & 1 deletion tests/t1100-replace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ todo.sh add notice the daisies > /dev/null
test_todo_session 'replace usage' <<EOF
>>> todo.sh replace adf asdfa
=== 1
usage: todo.sh replace ITEM# "UPDATED ITEM"
usage: todo.sh replace NR "UPDATED ITEM"
EOF

test_todo_session 'basic replace' <<EOF
Expand Down
2 changes: 1 addition & 1 deletion tests/t1200-pri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_description='basic priority functionality

test_todo_session 'priority usage' <<EOF
>>> todo.sh pri B B
usage: todo.sh pri ITEM# PRIORITY[, ITEM# PRIORITY, ...]
usage: todo.sh pri NR PRIORITY [NR PRIORITY ...]
note: PRIORITY must be anywhere from A to Z.
=== 1
EOF
Expand Down
2 changes: 1 addition & 1 deletion tests/t1400-prepend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_description='basic prepend functionality

test_todo_session 'prepend usage' <<EOF
>>> todo.sh prepend B B
usage: todo.sh prepend ITEM# "TEXT TO PREPEND"
usage: todo.sh prepend NR "TEXT TO PREPEND"
=== 1
EOF

Expand Down
6 changes: 3 additions & 3 deletions tests/t1500-do.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ test_description='do functionality

test_todo_session 'do usage' <<EOF
>>> todo.sh do B B
usage: todo.sh do ITEM#[, ITEM#, ITEM#, ...]
usage: todo.sh do NR [NR ...]
=== 1
EOF

test_todo_session 'do missing ITEM#' <<EOF
test_todo_session 'do missing NR' <<EOF
>>> todo.sh do
usage: todo.sh do ITEM#[, ITEM#, ITEM#, ...]
usage: todo.sh do NR [NR ...]
=== 1
EOF

Expand Down
2 changes: 1 addition & 1 deletion tests/t1600-append.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ todo.sh add notice the daisies > /dev/null
test_todo_session 'append usage' <<EOF
>>> todo.sh append adf asdfa
=== 1
usage: todo.sh append ITEM# "TEXT TO APPEND"
usage: todo.sh append NR "TEXT TO APPEND"
EOF

test_todo_session 'append error' <<EOF
Expand Down
2 changes: 1 addition & 1 deletion tests/t1700-depri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_description='basic depriority functionality

test_todo_session 'depriority usage' <<EOF
>>> todo.sh depri B B
usage: todo.sh depri ITEM#[, ITEM#, ITEM#, ...]
usage: todo.sh depri NR [NR ...]
=== 1
EOF

Expand Down
2 changes: 1 addition & 1 deletion tests/t1800-del.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SPACE=' '

test_todo_session 'del usage' <<EOF
>>> todo.sh del B
usage: todo.sh del ITEM# [TERM]
usage: todo.sh del NR [TERM]
=== 1
EOF

Expand Down
16 changes: 8 additions & 8 deletions tests/t2110-help-action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@ test_todo_session 'multiple actions help' <<'EOF'
shorthelp
List the one-line usage of all built-in and add-on actions.
\
append ITEM# "TEXT TO APPEND"
app ITEM# "TEXT TO APPEND"
Adds TEXT TO APPEND to the end of the task on line ITEM#.
append NR "TEXT TO APPEND"
app NR "TEXT TO APPEND"
Adds TEXT TO APPEND to the end of the task on line NR.
Quotes optional.
\
EOF

test_todo_session 'short and long form of action help' <<'EOF'
>>> todo.sh help append
append ITEM# "TEXT TO APPEND"
app ITEM# "TEXT TO APPEND"
Adds TEXT TO APPEND to the end of the task on line ITEM#.
append NR "TEXT TO APPEND"
app NR "TEXT TO APPEND"
Adds TEXT TO APPEND to the end of the task on line NR.
Quotes optional.
\

>>> todo.sh help app
app ITEM# "TEXT TO APPEND"
Adds TEXT TO APPEND to the end of the task on line ITEM#.
app NR "TEXT TO APPEND"
Adds TEXT TO APPEND to the end of the task on line NR.
Quotes optional.
\
EOF
Expand Down
2 changes: 1 addition & 1 deletion tests/t9999-testsuite_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ TODO: $HOME/todo.txt archived.
TODO: Report file updated.

>>> todo.sh append g a
usage: todo.sh append ITEM# "TEXT TO APPEND"
usage: todo.sh append NR "TEXT TO APPEND"
=== 1

>>> todo.sh append 2 and think
Expand Down
Loading