todo: update config; refactor actions

This commit is contained in:
Oleksandr Smirnov 2025-06-25 00:05:39 +03:00
parent d5d6748eb3
commit b68db8cdc1
No known key found for this signature in database
5 changed files with 17 additions and 4 deletions

View file

@ -8,8 +8,13 @@ if [[ $action == "usage" ]]; then
fi
item=$1
if [[ $item == "" ]]; then
TODOTXT_VERBOSE=0 $TODO_FULL_SH ls @url
exit 0
fi
if [[ ! "$item" =~ ^[0-9]+$ ]]; then
echo "$item: invalid item number"
echo "provided [task_number] is invalid: $item"
exit 1
fi
@ -21,7 +26,7 @@ if [[ -z "$URL" ]]; then
exit 1
fi
if [[ ! "#URL" =~ ^(?!https?:\/\/) ]]; then
if [[ ! "$URL" =~ ^(?!https?:\/\/) ]]; then
URL="https://$URL"
fi