Optimization: Put grep -v empty task filter inside sed.
No need to spawn off another process for this; we can do this inside the sed command that joins the task numbers with the task text.
This commit is contained in:
4
todo.sh
4
todo.sh
@@ -779,8 +779,8 @@ _list() {
|
|||||||
N
|
N
|
||||||
s/^/ /
|
s/^/ /
|
||||||
s/ *\([ 0-9]\{'"$PADDING"',\}\)\n/\1 /
|
s/ *\([ 0-9]\{'"$PADDING"',\}\)\n/\1 /
|
||||||
''' \
|
/^[ 0-9]\+ *$/d
|
||||||
| grep -v "^[ 0-9]\+ *$"
|
'''
|
||||||
)
|
)
|
||||||
if [ "${filter_command}" ]; then
|
if [ "${filter_command}" ]; then
|
||||||
filtered_items=$(echo -n "$items" | eval "${filter_command}")
|
filtered_items=$(echo -n "$items" | eval "${filter_command}")
|
||||||
|
|||||||
Reference in New Issue
Block a user