[hs] Display available commands when ran without arguments

This commit is contained in:
Joscha 2020-11-02 22:38:03 +00:00
parent fa5ac0b66e
commit a7fa8d4f40

View file

@ -11,7 +11,7 @@ data Settings = Settings
solutions :: Parser (FilePath -> IO ())
solutions = subparser $ mconcat $ map (\(name, func) -> command name (info (pure func) mempty))
[ ("201901", solve201901)
[ ("2019_01", solve201901)
]
parser :: Parser Settings
@ -24,5 +24,5 @@ opts = info (helper <*> parser) $ fullDesc <> failureCode 1
main :: IO ()
main = do
settings <- execParser opts
settings <- customExecParser (prefs showHelpOnEmpty) opts
function settings $ filename settings