added option to disable final filter

The option marker was chosen as "-x" here.
Alternatives might be "-X" or "-*".
This commit is contained in:
FND
2009-08-30 09:48:44 +01:00
parent 266d9e1258
commit 490f5d34e8
2 changed files with 37 additions and 2 deletions

10
todo.sh
View File

@@ -196,6 +196,8 @@ help()
Extra verbose mode prints some debugging information
-V
Displays version, license and credits
-x
Disables TODOTXT_FINAL_FILTER
Environment variables:
@@ -256,7 +258,7 @@ archive()
# == PROCESS OPTIONS ==
while getopts ":fhpnatvV+@Pd:" Option
while getopts ":fhpnatvVx+@Pd:" Option
do
case $Option in
'@' )
@@ -334,6 +336,9 @@ do
V )
version
;;
x )
TODOTXT_DISABLE_FILTER=1
;;
esac
done
shift $(($OPTIND - 1))
@@ -497,6 +502,9 @@ _list() {
## Number the file, then run the filter command,
## then sort and mangle output some more
if [[ $TODOTXT_DISABLE_FILTER = 1 ]]; then
TODOTXT_FINAL_FILTER="cat"
fi
items=$(
sed = "$src" \
| sed "N; s/^/ /; s/ *\(.\{$PADDING,\}\)\n/\1 /" \