From b67cb97fff4eb5c17e603a79070e0c3ccf1c1d3a Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 9 Nov 2022 09:06:38 -1000 Subject: [PATCH] ;doc: print: mention "fuzzy" for discoverability --- hledger/Hledger/Cli/Commands/Print.hs | 4 ++-- hledger/Hledger/Cli/Commands/Print.md | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/hledger/Hledger/Cli/Commands/Print.hs b/hledger/Hledger/Cli/Commands/Print.hs index 8f4e274b1..b3d2b4633 100644 --- a/hledger/Hledger/Cli/Commands/Print.hs +++ b/hledger/Hledger/Cli/Commands/Print.hs @@ -33,9 +33,9 @@ import System.Exit (exitFailure) printmode = hledgerCommandMode $(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 - ("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") "show all amounts explicitly" ,flagNone ["show-costs"] (setboolopt "show-costs") diff --git a/hledger/Hledger/Cli/Commands/Print.md b/hledger/Hledger/Cli/Commands/Print.md index ebe7f30ea..6a9193dbb 100644 --- a/hledger/Hledger/Cli/Commands/Print.md +++ b/hledger/Hledger/Cli/Commands/Print.md @@ -76,10 +76,11 @@ keeping the output parseable. 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. -With `-m`/`--match` and a STR argument, print will show at most one transaction: the one -one whose description is most similar to STR, and is most recent. STR should contain at -least two characters. If there is no similar-enough match, no transaction will be shown -(and command's exit code will be non-zero). +With `-m DESC`/`--match=DESC`, print does a fuzzy search for the one transaction +whose description is most similar to DESC, also preferring recent tranactions. +DESC should contain at least two characters. +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. This uses the same deduplication system as the [`import`](#import) command.