From d3acf9b290cee0a3b820b048aafd1185657bfc70 Mon Sep 17 00:00:00 2001 From: Asa Venton Date: Wed, 23 Oct 2019 19:17:04 +0100 Subject: Tidy up comments --- livetimes.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/livetimes.sh b/livetimes.sh index 5bfe7a3..f949afd 100755 --- a/livetimes.sh +++ b/livetimes.sh @@ -1,4 +1,5 @@ #!/bin/bash +# TODO: add failure check for each cURL read stop @@ -129,24 +130,28 @@ elif [[ "$stop" =~ ^-?[0-9]+$ ]] && [ $(echo ${#stop} == 4) ]; then # checks if input is a valid bus route elif [[ ${services[@]} =~ ${stop^^} ]]; then _nextbus -# if input has one space and a valid time then the user is probably trying to search for the next bus leaving the station for a given route and time +# if input has one space and something resembling a time then the user is probably trying to search for the next bus leaving the station for a given route after the given time elif [[ $(echo $stop | tr -cd ' \t' | wc -c) == 1 ]] && [[ "$stop" =~ [0-9][0-9]:[0-9][0-9] ]]; then time=$(echo $stop | cut -d ' ' -f2) stop=$(echo $stop | cut -d ' ' -f1) if [[ ! "$time" =~ ^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$ ]]; then + # prepend help output with $error error="Invalid time, specify time with HH:MM '!bus