diff --git a/src/main/Main.hs b/src/main/Main.hs index 2ea3e70ec1137bfe91e89e8f45a11760dd2cc874..9c56879bfb135da6d92f0b8360bb562278ab5a8a 100644 --- a/src/main/Main.hs +++ b/src/main/Main.hs @@ -352,22 +352,36 @@ outputPartition Nothing = printPartition outputPartition (Just "-") = printPartition outputPartition (Just file) = writePartition file +mainHelp :: Text -> Doc AnsiStyle +mainHelp argv0' = + reflow "The main command is" <> softline <> "'" <> argv0 <> " refine'." + <> line <> line + <> reflow "Please see the output of" <> softline <> "'" <> argv0 + <> " refine --help'" <> softline + <> "and" <> softline <> "'" <> argv0 <> " help'." + + where argv0 = pretty argv0' + ---------------------------------------------------------------------- -- Main ---------------------------------------------------------------------- main :: IO () main = do + argv0 <- T.pack <$> getProgName termColumns <- flip fmap (lookupEnv "COLUMNS") $ \case Nothing -> 120 Just val -> min (read val) 120 let optionParserPrefs = prefs (showHelpOnEmpty <> columns termColumns) params <- customExecParser optionParserPrefs - $ info (options <**> helper) fullDesc + $ info (options <**> helper) + (fullDesc + <> header "CoPaR - An Efficient Coalgebraic Partition Refiner" + <> footerDoc (Just (toAnsiWlPprint (mainHelp argv0))) + ) case optCommand params of (HelpCommand f) -> do - argv0 <- T.pack <$> getProgName printHelp argv0 f (RefineCommand r) -> do stats <- initStats (refineStats r) (refineStatsJson r)