diff --git a/app/Main.hs b/app/Main.hs index 7af805b..8944836 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -12,6 +12,7 @@ data Args = Args , directory :: FilePath , fileHead :: FilePath , verbose :: Bool + , cgi :: Bool } args :: Parser Args @@ -35,6 +36,9 @@ args = Args ( long "verbose" <> short 'v' <> help "Verbose mode") + <*> switch + ( long "cgi" + <> help "Output gemini file header") main :: IO () main = parseArgs =<< execParser opts @@ -45,7 +49,11 @@ main = parseArgs =<< execParser opts <> header "Generate a gemini page index") parseArgs :: Args -> IO() -parseArgs (Args t d h False) = do +parseArgs (Args t d h False False) = do + putStrLn $ "# " ++ t + putStrLn h + mkIndex =<< getDirectoryContents d +parseArgs (Args t d h False True) = do putStr success putStrLn $ "# " ++ t putStrLn h