Merge branch 'FND/disable_final_filter'
This commit is contained in:
@@ -54,7 +54,34 @@ TODO: 3 of 3 tasks shown from $HOME/todo.txt
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
#
|
#
|
||||||
# check the p command line option
|
# check the x command line option
|
||||||
|
#
|
||||||
|
TEST_TODO3_=todo3.cfg
|
||||||
|
sed -e "s%^.*export TODOTXT_FINAL_FILTER=.*$%export TODOTXT_FINAL_FILTER=\"grep -v xxx\"%" "${TEST_TODO_}" > "${TEST_TODO3_}"
|
||||||
|
|
||||||
|
cat > todo.txt <<EOF
|
||||||
|
foo
|
||||||
|
bar xxx
|
||||||
|
baz
|
||||||
|
EOF
|
||||||
|
|
||||||
|
test_todo_session 'final filter suppression' <<EOF
|
||||||
|
>>> todo.sh -d "$TEST_TODO3_" ls
|
||||||
|
3 baz
|
||||||
|
1 foo
|
||||||
|
--
|
||||||
|
TODO: 2 of 3 tasks shown from $HOME/todo.txt
|
||||||
|
|
||||||
|
>>> todo.sh -d "$TEST_TODO3_" -x ls
|
||||||
|
2 bar xxx
|
||||||
|
3 baz
|
||||||
|
1 foo
|
||||||
|
--
|
||||||
|
TODO: 3 of 3 tasks shown from $HOME/todo.txt
|
||||||
|
EOF
|
||||||
|
|
||||||
|
#
|
||||||
|
# check the p command line option
|
||||||
#
|
#
|
||||||
cat > todo.txt <<EOF
|
cat > todo.txt <<EOF
|
||||||
(A) @con01 +prj01 -- Some project 01 task, pri A
|
(A) @con01 +prj01 -- Some project 01 task, pri A
|
||||||
|
|||||||
10
todo.sh
10
todo.sh
@@ -196,6 +196,8 @@ help()
|
|||||||
Extra verbose mode prints some debugging information
|
Extra verbose mode prints some debugging information
|
||||||
-V
|
-V
|
||||||
Displays version, license and credits
|
Displays version, license and credits
|
||||||
|
-x
|
||||||
|
Disables TODOTXT_FINAL_FILTER
|
||||||
|
|
||||||
|
|
||||||
Environment variables:
|
Environment variables:
|
||||||
@@ -256,7 +258,7 @@ archive()
|
|||||||
|
|
||||||
|
|
||||||
# == PROCESS OPTIONS ==
|
# == PROCESS OPTIONS ==
|
||||||
while getopts ":fhpnatvV+@Pd:" Option
|
while getopts ":fhpnatvVx+@Pd:" Option
|
||||||
do
|
do
|
||||||
case $Option in
|
case $Option in
|
||||||
'@' )
|
'@' )
|
||||||
@@ -334,6 +336,9 @@ do
|
|||||||
V )
|
V )
|
||||||
version
|
version
|
||||||
;;
|
;;
|
||||||
|
x )
|
||||||
|
TODOTXT_DISABLE_FILTER=1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
shift $(($OPTIND - 1))
|
shift $(($OPTIND - 1))
|
||||||
@@ -497,6 +502,9 @@ _list() {
|
|||||||
|
|
||||||
## Number the file, then run the filter command,
|
## Number the file, then run the filter command,
|
||||||
## then sort and mangle output some more
|
## then sort and mangle output some more
|
||||||
|
if [[ $TODOTXT_DISABLE_FILTER = 1 ]]; then
|
||||||
|
TODOTXT_FINAL_FILTER="cat"
|
||||||
|
fi
|
||||||
items=$(
|
items=$(
|
||||||
sed = "$src" \
|
sed = "$src" \
|
||||||
| sed "N; s/^/ /; s/ *\(.\{$PADDING,\}\)\n/\1 /" \
|
| sed "N; s/^/ /; s/ *\(.\{$PADDING,\}\)\n/\1 /" \
|
||||||
|
|||||||
Reference in New Issue
Block a user