Found some time to change the order of commands like I mentioned wanting to do last time.
After doing it I’ve realised I probably shouldn’t have, but seeing as how it took me a couple of months to find the time I’m not going to change it back.
It all came about because I had issues with this not scanning/reading well:
haskerdeux today moveto 2 2020-08-30
haskerdeux today 2 moveto 2020-08-30
But I should have probably just changed the wording:
haskerdeux today move 2 2020-08-30
Because it makes sense on all levels to have a consistent order of arguments of
haskerdeux date command [todo date]
But for craziness reasons I now am able to do:
haskerdeux today todos haskerdeux today 2 moveto 2020-08-30
By using some guards to flip the order of commands if needed:
main = do (date:number_or_command:argList) <- getArgs --[...] let command | isDigit $ head number_or_command = head argList | otherwise = number_or_command let args | isDigit $ head number_or_command = number_or_command : (tail argList) | otherwise = argList token <- login dispatch command (token, todos_date:args)
With no need to change the rest of the programme. Yay for more bad Haskell.