now/scripts/now.sh

66 lines
1.6 KiB
Bash
Raw Normal View History

2022-05-16 17:30:15 -04:00
#!/bin/sh
# now - a simple to-do list written in POSIX sh
# Preloading
source /etc/now.conf
source ~/.config/now/events.sh
while [[ $# -gt 0 ]]; do
case $1 in
-h|--help)
2022-08-30 17:07:31 -04:00
printf "$blue [ := ] now - a simple to-do list written in POSIX sh [ := ] $reset\n"
2022-05-16 18:58:17 -04:00
printf "now {-h --help} show this message\n"
2022-08-04 11:29:06 -04:00
#printf "now {-a --add} [name] [date] [time] add an event\n" # This flag is deprecated
2022-05-16 18:58:17 -04:00
printf "now {--version} show the current version of now\n"
printf "\n"
printf "Events can be added by editing ~/.config/now/events.sh\n"
printf "If you would like to manually export the events instead, remove 'source ~/.config/now/events.sh'\n"
printf "This program is free software: see the GNU GPL v3.0 for details\n"
2022-05-16 18:56:51 -04:00
exit 0
2022-05-16 17:30:15 -04:00
;;
--version)
2022-08-30 17:07:31 -04:00
printf "$blue now - v2.0 $reset \n"
2022-05-16 17:30:15 -04:00
exit 0
;;
-*|--*)
printf "$red Unknown option, use --help to see usage $reset"
exit 1
2022-08-04 11:44:57 -04:00
;;
2022-08-04 11:29:06 -04:00
*)
printf "$red Unknown option, use --help to see usage $reset"
2022-08-30 17:07:31 -04:00
exit 1
2022-05-16 17:30:15 -04:00
;;
esac
done
2022-08-30 17:07:31 -04:00
printf "$blue [ := ] To do for $now_current_date: $reset\n"
2022-05-16 17:30:15 -04:00
printf ""
2022-08-30 17:11:15 -04:00
printf "$now_event_1"
printf "$now_event_2"
printf "$now_event_3"
printf "$now_event_4"
printf "$now_event_5"
printf "$now_event_6"
printf "$now_event_7"
printf "$now_event_8"
printf "$now_event_9"
printf "$now_event_10"
printf "$now_event_11"
printf "$now_event_12"
printf "$now_event_13"
printf "$now_event_14"
printf "$now_event_15"
printf "$now_event_16"
printf "$now_event_17"
printf "$now_event_18"
printf "$now_event_19"
printf "$now_event_20"
printf "$now_event_21"
printf "$now_event_22"
printf "$now_event_23"
printf "$now_event_24"
printf "$now_event_25"
2022-05-16 17:30:15 -04:00
exit 0