imp: cli: drop the print-unique command

It disorders same-day transactions, doesn't support print's options,
and isn't useful enough to be always shown in the builtin commands
list. I don't know of any users, or a use for it, and it could easily
be recreated as an addon script, so I'm inclined to not bother
supporting it as a hidden command.
This commit is contained in:
Simon Michael 2023-01-25 09:36:27 -10:00
parent cce63e6816
commit 1899b43073
10 changed files with 1 additions and 75 deletions

View File

@ -443,7 +443,6 @@ src/hledger/
Payees.md
Prices.md
Print.md
Printunique.md
README.md
Register.md
Registermatch.md

View File

@ -61,7 +61,6 @@ Syntax: https://www.pandoc.org/MANUAL.html#tables -> pipe_tables
| [incomestatement](https://github.com/simonmichael/hledger/issues?q=is:open+label:incomestatement) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:incomestatement) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:incomestatement)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:incomestatement)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:incomestatement)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:incomestatement) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:incomestatement) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:incomestatement)
| [prices](https://github.com/simonmichael/hledger/issues?q=is:open+label:prices) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:prices) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:prices)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:prices)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:prices)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:prices) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:prices) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:prices)
| [print](https://github.com/simonmichael/hledger/issues?q=is:open+label:print) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:print) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:print)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:print)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:print)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:print) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:print) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:print)
| [printunique](https://github.com/simonmichael/hledger/issues?q=is:open+label:printunique) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:printunique) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:printunique)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:printunique)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:printunique)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:printunique) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:printunique) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:printunique)
| [register](https://github.com/simonmichael/hledger/issues?q=is:open+label:register) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:register) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:register)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:register)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:register)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:register) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:register) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:register)
| [registermatch](https://github.com/simonmichael/hledger/issues?q=is:open+label:registermatch) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:registermatch) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:registermatch)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:registermatch)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:registermatch)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:registermatch) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:registermatch) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:registermatch)
| [rewrite](https://github.com/simonmichael/hledger/issues?q=is:open+label:rewrite) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:rewrite) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:rewrite)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:rewrite)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:rewrite)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:rewrite) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:rewrite) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:rewrite)

View File

@ -36,7 +36,6 @@ module Hledger.Cli.Commands (
,module Hledger.Cli.Commands.Payees
,module Hledger.Cli.Commands.Prices
,module Hledger.Cli.Commands.Print
,module Hledger.Cli.Commands.Printunique
,module Hledger.Cli.Commands.Register
,module Hledger.Cli.Commands.Registermatch
,module Hledger.Cli.Commands.Rewrite
@ -79,7 +78,6 @@ import Hledger.Cli.Commands.Notes
import Hledger.Cli.Commands.Payees
import Hledger.Cli.Commands.Prices
import Hledger.Cli.Commands.Print
import Hledger.Cli.Commands.Printunique
import Hledger.Cli.Commands.Register
import Hledger.Cli.Commands.Registermatch
import Hledger.Cli.Commands.Rewrite
@ -116,7 +114,6 @@ builtinCommands = [
,(payeesmode , payees)
,(pricesmode , prices)
,(printmode , print')
,(printuniquemode , printunique)
,(registermatchmode , registermatch)
,(registermode , register)
,(rewritemode , rewrite)
@ -219,9 +216,7 @@ commandsList progversion othercmds =
," balance (bal) show balance changes, end balances, budgets, gains.."
,"+plot create charts from balance reports, in terminal or GUI"
," print show transactions or export journal data"
," print-unique show only transactions with new descriptions"
," register (reg) show postings in one or more accounts & running total"
," register-match show a recent posting that best matches a description"
," roi show return on investments"
,""
-----------------------------------------80-------------------------------------

View File

@ -1,26 +0,0 @@
{-# LANGUAGE TemplateHaskell #-}
module Hledger.Cli.Commands.Printunique (
printuniquemode
,printunique
)
where
import Data.List.Extra (nubSortOn)
import Hledger
import Hledger.Cli.CliOptions
import Hledger.Cli.Commands.Print
printuniquemode = hledgerCommandMode
$(embedFileRelative "Hledger/Cli/Commands/Printunique.txt")
[]
[generalflagsgroup1]
hiddenflags
([], Nothing)
printunique opts j@Journal{jtxns=ts} = do
print' opts j{jtxns=uniquify ts}
where
uniquify = nubSortOn thingToCompare
thingToCompare = tdescription
-- thingToCompare = tdate

View File

@ -1,18 +0,0 @@
print-unique\
Print transactions which do not reuse an already-seen description.
_FLAGS
Example:
```shell
$ cat unique.journal
1/1 test
(acct:one) 1
2/2 test
(acct:two) 2
$ LEDGER_FILE=unique.journal hledger print-unique
(-f option not supported)
2015/01/01 test
(acct:one) 1
```

View File

@ -1,16 +0,0 @@
print-unique
Print transactions which do not reuse an already-seen description.
_FLAGS
Example:
$ cat unique.journal
1/1 test
(acct:one) 1
2/2 test
(acct:two) 2
$ LEDGER_FILE=unique.journal hledger print-unique
(-f option not supported)
2015/01/01 test
(acct:one) 1

View File

@ -25,7 +25,6 @@ _command_({{$1 notes}} ,{{Notes}})
_command_({{$1 payees}} ,{{Payees}})
_command_({{$1 prices}} ,{{Prices}})
_command_({{$1 print}} ,{{Print}})
_command_({{$1 print-unique}} ,{{Printunique}})
_command_({{$1 register}} ,{{Register}})
_command_({{$1 register-match}} ,{{Registermatch}})
_command_({{$1 rewrite}} ,{{Rewrite}})

View File

@ -1,6 +1,6 @@
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.35.0.
-- This file has been generated from package.yaml by hpack version 0.35.1.
--
-- see: https://github.com/sol/hpack
@ -68,7 +68,6 @@ extra-source-files:
Hledger/Cli/Commands/Payees.txt
Hledger/Cli/Commands/Prices.txt
Hledger/Cli/Commands/Print.txt
Hledger/Cli/Commands/Printunique.txt
Hledger/Cli/Commands/Register.txt
Hledger/Cli/Commands/Registermatch.txt
Hledger/Cli/Commands/Rewrite.txt
@ -123,7 +122,6 @@ library
Hledger.Cli.Commands.Payees
Hledger.Cli.Commands.Prices
Hledger.Cli.Commands.Print
Hledger.Cli.Commands.Printunique
Hledger.Cli.Commands.Register
Hledger.Cli.Commands.Registermatch
Hledger.Cli.Commands.Rewrite

View File

@ -539,7 +539,6 @@ Here are those commands and the formats currently supported:
| notes | | | | | |
| payees | | | | | |
| prices | | | | | |
| print-unique | | | | | |
| register-match | | | | | |
| rewrite | | | | | |
| roi | | | | | |
@ -5745,7 +5744,6 @@ These data entry commands are the only ones which can modify your journal file.
- [payees](#payees) - show unique payee segments of transaction descriptions
- [prices](#prices) - show market price records
- **[print](#print)** - show transactions (journal entries)
- [print-unique](#print-unique) - show only transactions with unique descriptions
- **[register](#register) (reg)** - show postings in one or more accounts & running total
- [register-match](#register-match) - show a recent posting that best matches a description
- [stats](#stats) - show journal statistics

View File

@ -63,7 +63,6 @@ extra-source-files:
- Hledger/Cli/Commands/Payees.txt
- Hledger/Cli/Commands/Prices.txt
- Hledger/Cli/Commands/Print.txt
- Hledger/Cli/Commands/Printunique.txt
- Hledger/Cli/Commands/Register.txt
- Hledger/Cli/Commands/Registermatch.txt
- Hledger/Cli/Commands/Rewrite.txt
@ -171,7 +170,6 @@ library:
- Hledger.Cli.Commands.Payees
- Hledger.Cli.Commands.Prices
- Hledger.Cli.Commands.Print
- Hledger.Cli.Commands.Printunique
- Hledger.Cli.Commands.Register
- Hledger.Cli.Commands.Registermatch
- Hledger.Cli.Commands.Rewrite