mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-28 12:54:07 +03:00
dev: notes, debug output tweaks
This commit is contained in:
parent
c6bc020609
commit
b71634a4ee
@ -485,6 +485,9 @@ cmdargsParse desc m args0 = process m (ensureDebugFlagHasVal args0)
|
||||
-- and will be moved - but later rejected by cmdargs.
|
||||
-- Instead these should be written to the right of a "--" argument, which hides them.
|
||||
--
|
||||
-- - XXX Relative order of flags is mostly but not entirely preserved, currently:
|
||||
-- pre-command flags get moved to the end, after post-command flags.
|
||||
--
|
||||
moveFlagsAfterCommand :: [String] -> (String, [String], [String])
|
||||
moveFlagsAfterCommand args =
|
||||
case moveFlagAndVal (args, []) of
|
||||
|
@ -104,7 +104,7 @@ getConf rawopts = do
|
||||
exists <- doesFileExist f
|
||||
return $ if exists then Just f else Nothing
|
||||
case conffiles of
|
||||
f:_ -> dbg8IO "found config files" conffiles >> dbg1IO "using config file" f >> readConfFile f
|
||||
f:_ -> dbg8IO "found config files" conffiles >> dbg1IO "using nearest config file" f >> readConfFile f
|
||||
[] -> return $ traceAt 1 "no config file found" (nullconf, Nothing)
|
||||
|
||||
-- | Read this config file and parse its contents, or raise an error.
|
||||
@ -130,7 +130,7 @@ defaultConfFilePaths :: IO [FilePath]
|
||||
defaultConfFilePaths = do
|
||||
ds <- confDirs
|
||||
home <- getHomeDirectory
|
||||
return $ dbg8 "possible config files" $
|
||||
return $ dbg8 "possible config file paths" $
|
||||
flip map ds $ \d -> d </> if d==home then ".hledger.conf" else "hledger.conf"
|
||||
|
||||
-- | Get the directories to check for a hledger config file.
|
||||
|
Loading…
Reference in New Issue
Block a user