dev: journal: ignore CLI flags in journal

This commit is contained in:
Simon Michael 2022-12-21 23:38:27 -10:00
parent aa5323e6ed
commit 2357a7a750
4 changed files with 6 additions and 8 deletions

View File

@ -244,6 +244,7 @@ directivep = (do
,bucketdirectivep
,capturedirectivep
,checkdirectivep
,commandlineflagdirectivep
,commoditydirectivep
,commodityconversiondirectivep
,definedirectivep
@ -525,7 +526,7 @@ formatdirectivep expectedsym = do
-- More Ledger directives, ignore for now:
-- apply fixed, apply tag, assert, bucket, A, capture, check, define, expr
applyfixeddirectivep, applytagdirectivep, assertdirectivep, bucketdirectivep, capturedirectivep,
checkdirectivep, definedirectivep, exprdirectivep :: JournalParser m ()
checkdirectivep, definedirectivep, exprdirectivep, commandlineflagdirectivep :: JournalParser m ()
applyfixeddirectivep = do string "apply fixed" >> lift restofline >> return ()
applytagdirectivep = do string "apply tag" >> lift restofline >> return ()
assertdirectivep = do string "assert" >> lift restofline >> return ()
@ -534,6 +535,7 @@ capturedirectivep = do string "capture" >> lift restofline >> return ()
checkdirectivep = do string "check" >> lift restofline >> return ()
definedirectivep = do string "define" >> lift restofline >> return ()
exprdirectivep = do string "expr" >> lift restofline >> return ()
commandlineflagdirectivep = do string "--" >> lift restofline >> return ()
keywordp :: String -> JournalParser m ()
keywordp = void . string . fromString

View File

@ -2749,6 +2749,7 @@ capture ACCT REGEX
check EXPR
define VAR=EXPR
expr EXPR
--command-line-flag
```
# CSV

View File

@ -49,10 +49,3 @@ $ hledger -f- check
$ hledger -f- check
>2//
>=1
# command line options
<
--strict
$ hledger -f- check
>2//
>=1

View File

@ -55,4 +55,6 @@ check 1
define var_name=$100
expr 1
N USD
--command-line-flag
$ hledger -f- check