;doc: print: mention "fuzzy" for discoverability

This commit is contained in:
Simon Michael 2022-11-09 09:06:38 -10:00
parent 7997007dcf
commit b67cb97fff
2 changed files with 7 additions and 6 deletions

View File

@ -33,9 +33,9 @@ import System.Exit (exitFailure)
printmode = hledgerCommandMode printmode = hledgerCommandMode
$(embedFileRelative "Hledger/Cli/Commands/Print.txt") $(embedFileRelative "Hledger/Cli/Commands/Print.txt")
([let arg = "STR" in ([let arg = "DESC" in
flagReq ["match","m"] (\s opts -> Right $ setopt "match" s opts) arg flagReq ["match","m"] (\s opts -> Right $ setopt "match" s opts) arg
("show the transaction whose description is most similar to "++arg++", and is most recent") ("fuzzy search for the transaction with description closest to "++arg++", and also most recent")
,flagNone ["explicit","x"] (setboolopt "explicit") ,flagNone ["explicit","x"] (setboolopt "explicit")
"show all amounts explicitly" "show all amounts explicitly"
,flagNone ["show-costs"] (setboolopt "show-costs") ,flagNone ["show-costs"] (setboolopt "show-costs")

View File

@ -76,10 +76,11 @@ keeping the output parseable.
With `-B`/`--cost`, amounts with [transaction prices](https://hledger.org/hledger.html#transaction-prices) With `-B`/`--cost`, amounts with [transaction prices](https://hledger.org/hledger.html#transaction-prices)
are converted to cost using that price. This can be used for troubleshooting. are converted to cost using that price. This can be used for troubleshooting.
With `-m`/`--match` and a STR argument, print will show at most one transaction: the one With `-m DESC`/`--match=DESC`, print does a fuzzy search for the one transaction
one whose description is most similar to STR, and is most recent. STR should contain at whose description is most similar to DESC, also preferring recent tranactions.
least two characters. If there is no similar-enough match, no transaction will be shown DESC should contain at least two characters.
(and command's exit code will be non-zero). If there is no similar-enough match,
no transaction will be shown and the program exit code will be non-zero.
With `--new`, hledger prints only transactions it has not seen on a previous run. With `--new`, hledger prints only transactions it has not seen on a previous run.
This uses the same deduplication system as the [`import`](#import) command. This uses the same deduplication system as the [`import`](#import) command.