@@ -85,7 +85,7 @@ data Opt = Opt
85 , optMetadata :: Meta -- ^ Metadata fields to set
85 , optMetadata :: Meta -- ^ Metadata fields to set
86 , optMetadataFiles :: [FilePath] -- ^ Name of YAML metadata files
86 , optMetadataFiles :: [FilePath] -- ^ Name of YAML metadata files
87 , optOutputFile :: Maybe FilePath -- ^ Name of output file
87 , optOutputFile :: Maybe FilePath -- ^ Name of output file
88− , optInputFiles :: [FilePath] -- ^ Names of input files
88+ , optInputFiles :: Maybe [FilePath] -- ^ Names of input files
89 , optNumberSections :: Bool -- ^ Number sections in LaTeX
89 , optNumberSections :: Bool -- ^ Number sections in LaTeX
90 , optNumberOffset :: [Int] -- ^ Starting number for sections
90 , optNumberOffset :: [Int] -- ^ Starting number for sections
91 , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
91 , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
@@ -200,16 +200,17 @@ doOpt (k',v) = do
200 "output-file" ->
200 "output-file" ->
201 parseYAML v >>= \x -> return (\o -> o{ optOutputFile = unpack <$> x })
201 parseYAML v >>= \x -> return (\o -> o{ optOutputFile = unpack <$> x })
202 "input-files" ->
202 "input-files" ->
203− parseYAML v >>= \x -> return (\o -> o{ optInputFiles = optInputFiles o <>
203+ parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
204− map unpack x })
205+ Just (map unpack x) })
205 "input-file" -> -- allow either a list or a single value
206 "input-file" -> -- allow either a list or a single value
206 (parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
207 (parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
207 optInputFiles o <>
208 optInputFiles o <>
208− map unpack x }))
209+ Just (map unpack x) }))
210 (parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
211 (parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
211 optInputFiles o <>
212 optInputFiles o <>
212− [unpack x] }))
213+ Just [unpack x] }))
213 "number-sections" ->
214 "number-sections" ->
214 parseYAML v >>= \x -> return (\o -> o{ optNumberSections = x })
215 parseYAML v >>= \x -> return (\o -> o{ optNumberSections = x })
215 "number-offset" ->
216 "number-offset" ->
@@ -390,7 +391,7 @@ defaultOpts = Opt
390 , optMetadata = mempty
391 , optMetadata = mempty
391 , optMetadataFiles = []
392 , optMetadataFiles = []
392 , optOutputFile = Nothing
393 , optOutputFile = Nothing
393− , optInputFiles = []
394+ , optInputFiles = Nothing
394 , optNumberSections = False
395 , optNumberSections = False
395 , optNumberOffset = [0,0,0,0,0,0]
396 , optNumberOffset = [0,0,0,0,0,0]
396 , optSectionDivs = False
397 , optSectionDivs = False