dev:readJournal: assume default file name "-" rather than "(string)" [#2328]
"-" implies data from standard input so "string" is perhaps more correct, but I think this is a harmless simplification and it makes `files` output consistent when run by `run`.
This commit is contained in:
parent
3bfaa56dfb
commit
874771d47c
@ -651,7 +651,7 @@ data Journal = Journal {
|
||||
-- any included journal files. The main file is first,
|
||||
-- followed by any included files in the order encountered.
|
||||
-- TODO: FilePath is a sloppy type here, don't assume it's a
|
||||
-- real file; values like "", "-", "(string)" can be seen
|
||||
-- real file; values like "" or "-" can be seen
|
||||
,jlastreadtime :: POSIXTime -- ^ when this journal was last read from its file(s)
|
||||
-- NOTE: after adding new fields, eg involving account names, consider updating
|
||||
-- the Anon instance in Hleger.Cli.Anon
|
||||
|
||||
@ -224,7 +224,7 @@ readJournal :: InputOpts -> Maybe FilePath -> Handle -> ExceptT String IO Journa
|
||||
readJournal iopts@InputOpts{strict_, _defer} mpath hdl = do
|
||||
let r :: Reader IO = fromMaybe JournalReader.reader $ findReader (mformat_ iopts) mpath
|
||||
dbg6IO "readJournal: trying reader" (rFormat r)
|
||||
j <- rReadFn r iopts (fromMaybe "(string)" mpath) hdl
|
||||
j <- rReadFn r iopts (fromMaybe "-" mpath) hdl
|
||||
when (strict_ && not _defer) $ liftEither $ journalStrictChecks j
|
||||
return j
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user