@@ -82,7 +82,7 @@ import System.Posix.Terminal (queryTerminal)
8282import System.Posix.IO (stdOutput)
8383#endif
8484
85−parseOptions :: [OptDescr (Opt -> IO Opt)] -> Opt -> IO (Opt, [FilePath])
85+parseOptions :: [OptDescr (Opt -> IO Opt)] -> Opt -> IO Opt
8686parseOptions options' defaults = do
8787 rawArgs <- map UTF8.decodeArg <$> getArgs
8888 prg <- getProgName
@@ -98,10 +98,11 @@ parseOptions options' defaults = do
9898
9999 -- thread option data structure through all supplied option actions
100100 opts <- foldl (>>=) (return defaults) actions
101− return (opts, args)
101+ return (opts{ optInputFiles = args })
102102
103−convertWithOpts :: Opt -> [FilePath] -> IO ()
104−convertWithOpts opts args = do
103+convertWithOpts :: Opt -> IO ()
104+convertWithOpts opts = do
105+ let args = optInputFiles opts
105106 let outputFile = optOutputFile opts
106107 let filters = optFilters opts
107108 let verbosity = optVerbosity opts
@@ -469,6 +470,7 @@ data Opt = Opt
469470 , optVariables :: [(String,String)] -- ^ Template variables to set
470471 , optMetadata :: [(String, String)] -- ^ Metadata fields to set
471472 , optOutputFile :: FilePath -- ^ Name of output file
473+ , optInputFiles :: [FilePath] -- ^ Names of input files
472474 , optNumberSections :: Bool -- ^ Number sections in LaTeX
473475 , optNumberOffset :: [Int] -- ^ Starting number for sections
474476 , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
@@ -534,6 +536,7 @@ defaultOpts = Opt
534536 , optVariables = []
535537 , optMetadata = []
536538 , optOutputFile = "-" -- "-" means stdout
539+ , optInputFiles = []
537540 , optNumberSections = False
538541 , optNumberOffset = [0,0,0,0,0,0]
539542 , optSectionDivs = False