From 3f0892556d3ddb68ea8ca626a11fd77b4fa669fe Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 23 Nov 2019 13:03:26 -0800 Subject: [PATCH] ;lib: clarify choiceopt doc --- hledger-lib/Hledger/Data/RawOptions.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hledger-lib/Hledger/Data/RawOptions.hs b/hledger-lib/Hledger/Data/RawOptions.hs index 0e123bd6a..674ae7cff 100644 --- a/hledger-lib/Hledger/Data/RawOptions.hs +++ b/hledger-lib/Hledger/Data/RawOptions.hs @@ -55,9 +55,9 @@ inRawOpts name = isJust . lookup name . unRawOpts boolopt :: String -> RawOpts -> Bool boolopt = inRawOpts --- | Get latests successfully parsed flag. --- --- Expected to be used for exclusive choice flags like "--json" vs "--csv". +-- | From a list of RawOpts, get the last one (ie the right-most on the command line) +-- for which the given predicate returns a Just value. +-- Useful for exclusive choice flags like --daily|--weekly|--quarterly... -- -- >>> choiceopt Just (RawOpts [("a",""), ("b",""), ("c","")]) -- Just "c"