mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Hooks
- Added example of spelling correction via hook script.
This commit is contained in:
parent
8e9e544376
commit
ec0757b2c9
1 changed files with 19 additions and 0 deletions
19
scripts/hooks/on-add.the
Normal file
19
scripts/hooks/on-add.the
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
read new_task
|
||||
|
||||
re='(.*)([Tt])eh(.*)'
|
||||
if [[ $new_task =~ $re ]]
|
||||
then
|
||||
while [[ $new_task =~ $re ]]
|
||||
do
|
||||
new_task=${BASH_REMATCH[1]}${BASH_REMATCH[2]}he${BASH_REMATCH[3]}
|
||||
done
|
||||
|
||||
echo "Auto-corrected 'teh' --> 'the'"
|
||||
fi
|
||||
|
||||
echo $new_task
|
||||
exit 0
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue