From 548bd322462a378edc9254de05141ab85349f458 Mon Sep 17 00:00:00 2001 From: Mikhail Tyuzin Date: Sat, 29 Nov 2025 13:36:05 +0300 Subject: [PATCH 1/2] Add proper Usage action handling to ensure the plugin display correctly in the todo.sh help --- view | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/view b/view index 0d98f8b..82c9be2 100755 --- a/view +++ b/view @@ -193,6 +193,14 @@ function date_check() { return 0 } +[ "$action" = "usage" ] && { + echo " View todos:" + echo " view" + echo " Groups and outputs tasks by various dimensions like projects, contextes, etc." + echo "" + exit +} + # Validate the input options re="^(help|project|context|date|nodate|future|past|today|tomorrow|yesterday|([+-][0-9]+|[0-9]+)(days|weeks|months|years))$" if [[ "$option" =~ $re ]]; then From 8b1aaa39d97ec1923d9f4dc563fbe67711e84d3f Mon Sep 17 00:00:00 2001 From: Mikhail Tyuzin Date: Fri, 12 Dec 2025 00:01:48 +0300 Subject: [PATCH 2/2] Add a fix to use gdate, though it should be dynamic based on current OS --- view | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/view b/view index 82c9be2..0b00fb2 100755 --- a/view +++ b/view @@ -114,7 +114,7 @@ function date_view() { option=$1 # Get today - today=$(date -d $(date +%Y-%m-%d) +%s) + today=$(gdate -d $(gdate +%Y-%m-%d) +%s) # For each date show header and the list of todo items for date in $DATES ; do @@ -150,7 +150,7 @@ function date_check() { # Assign variables threshold=$1 today=$2 - _date=$(date -d "$3" +%s) + _date=$(gdate -d "$3" +%s) # Check if the date is valid or not # return: @@ -217,7 +217,7 @@ if [[ "$option" =~ $re ]]; then *) re="^(date|nodate|future|past)$" if [[ ! ( "$option" =~ $re ) ]]; then - option=$(date -d $(date -d $option +%Y-%m-%d) +%s) + option=$(gdate -d $(gdate -d $option +%Y-%m-%d) +%s) fi date_view $option