aboutsummaryrefslogtreecommitdiff
path: root/Main.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-06-17 18:55:42 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-06-17 18:55:42 +0000
commita8920f47aaf5bb01e5730ccd03cbafdcc4e3ba25 (patch)
tree09be125eadeb64835b4b764b134ab5cb55dec5ec /Main.hs
parent5eb204c86c3ab3bd413a89a7f29564498c846567 (diff)
downloadpandoc-a8920f47aaf5bb01e5730ccd03cbafdcc4e3ba25.tar.gz
Cleaned up Main.hs to eliminate -Wall warnings.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1287 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs15
1 files changed, 8 insertions, 7 deletions
diff --git a/Main.hs b/Main.hs
index f38cd2838..a1871106c 100644
--- a/Main.hs
+++ b/Main.hs
@@ -73,7 +73,7 @@ readers = [("native" , readPandoc)
-- | Reader for native Pandoc format.
readPandoc :: ParserState -> String -> Pandoc
-readPandoc state input = read input
+readPandoc _ input = read input
-- | Association list of formats and pairs of writers and default headers.
writers :: [ ( String, ( WriterOptions -> Pandoc -> String, String ) ) ]
@@ -93,7 +93,7 @@ writers = [("native" , (writeDoc, ""))
-- | Writer for Pandoc native format.
writeDoc :: WriterOptions -> Pandoc -> String
-writeDoc options = prettyPandoc
+writeDoc _ = prettyPandoc
-- | Data structure for command line options.
data Opt = Opt
@@ -309,9 +309,9 @@ options =
, Option "D" ["print-default-header"]
(ReqArg
- (\arg opt -> do
+ (\arg _ -> do
let header = case (lookup arg writers) of
- Just (writer, head) -> head
+ Just (_, h) -> h
Nothing -> error ("Unknown reader: " ++ arg)
hPutStr stdout header
exitWith ExitSuccess)
@@ -348,11 +348,11 @@ options =
-- Returns usage message
usageMessage :: String -> [OptDescr (Opt -> IO Opt)] -> String
-usageMessage programName options = usageInfo
+usageMessage programName opts = usageInfo
(programName ++ " [OPTIONS] [FILES]" ++ "\nInput formats: " ++
(joinWithSep ", " $ map fst readers) ++ "\nOutput formats: " ++
(joinWithSep ", " $ map fst writers) ++ "\nOptions:")
- options
+ opts
-- Determine default reader based on source file extensions
defaultReaderName :: [FilePath] -> String
@@ -393,9 +393,10 @@ defaultWriterName x =
".db" -> "docbook"
".xml" -> "docbook"
".sgml" -> "docbook"
- ['.',x] | x `elem` ['1'..'9'] -> "man"
+ ['.',y] | y `elem` ['1'..'9'] -> "man"
_ -> "html"
+main :: IO ()
main = do
rawArgs <- getArgs