Closed GianlucaGuarini closed 6 years ago
never mind i have found a simple solution:
import System.Console.CmdArgs (cmdArgsRun)
import System.Console.CmdArgs.Explicit(helpText, HelpFormat(..))
main :: IO()
main = do
args <- getArgs
if null args then exitWithHelp
else parse =<< cmdArgsRun mode
exitWithHelp :: IO a
exitWithHelp = do
putStr $ show $ helpText [] HelpFormatAll mode
exitSuccess
Would be really nice if this were somewhere in the library itself... Any chance of that?
Hi thank you for this awesome helper. I am struggling trying to get the help text as default command if no options were specified for example:
should generate the same output as
Do you have any hint to lead me to a possible solution? Thank you