From b71634a4ee542fac8fa7de09f1c1163d9b69be7e Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 14 Oct 2024 08:26:51 -1000 Subject: [PATCH] dev: notes, debug output tweaks --- hledger/Hledger/Cli.hs | 3 +++ hledger/Hledger/Cli/Conf.hs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hledger/Hledger/Cli.hs b/hledger/Hledger/Cli.hs index 41766af43..fa436b8c0 100644 --- a/hledger/Hledger/Cli.hs +++ b/hledger/Hledger/Cli.hs @@ -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 diff --git a/hledger/Hledger/Cli/Conf.hs b/hledger/Hledger/Cli/Conf.hs index 3648505c7..b58fe1aac 100644 --- a/hledger/Hledger/Cli/Conf.hs +++ b/hledger/Hledger/Cli/Conf.hs @@ -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.