From 1899b430731cede192ee04901b8cd772e861ed69 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 25 Jan 2023 09:36:27 -1000 Subject: [PATCH] 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. --- doc/FILES.md | 1 - doc/ISSUES.md | 1 - hledger/Hledger/Cli/Commands.hs | 5 ---- hledger/Hledger/Cli/Commands/Printunique.hs | 26 -------------------- hledger/Hledger/Cli/Commands/Printunique.md | 18 -------------- hledger/Hledger/Cli/Commands/Printunique.txt | 16 ------------ hledger/Hledger/Cli/Commands/commands.m4 | 1 - hledger/hledger.cabal | 4 +-- hledger/hledger.m4.md | 2 -- hledger/package.yaml | 2 -- 10 files changed, 1 insertion(+), 75 deletions(-) delete mode 100755 hledger/Hledger/Cli/Commands/Printunique.hs delete mode 100644 hledger/Hledger/Cli/Commands/Printunique.md delete mode 100644 hledger/Hledger/Cli/Commands/Printunique.txt diff --git a/doc/FILES.md b/doc/FILES.md index 3097dd457..7333a1325 100644 --- a/doc/FILES.md +++ b/doc/FILES.md @@ -443,7 +443,6 @@ src/hledger/ Payees.md Prices.md Print.md - Printunique.md README.md Register.md Registermatch.md diff --git a/doc/ISSUES.md b/doc/ISSUES.md index 669405da2..91007e7e2 100644 --- a/doc/ISSUES.md +++ b/doc/ISSUES.md @@ -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) diff --git a/hledger/Hledger/Cli/Commands.hs b/hledger/Hledger/Cli/Commands.hs index 79a15d54a..74d2247de 100644 --- a/hledger/Hledger/Cli/Commands.hs +++ b/hledger/Hledger/Cli/Commands.hs @@ -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------------------------------------- diff --git a/hledger/Hledger/Cli/Commands/Printunique.hs b/hledger/Hledger/Cli/Commands/Printunique.hs deleted file mode 100755 index a0aba7939..000000000 --- a/hledger/Hledger/Cli/Commands/Printunique.hs +++ /dev/null @@ -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 diff --git a/hledger/Hledger/Cli/Commands/Printunique.md b/hledger/Hledger/Cli/Commands/Printunique.md deleted file mode 100644 index 64e5aa467..000000000 --- a/hledger/Hledger/Cli/Commands/Printunique.md +++ /dev/null @@ -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 -``` diff --git a/hledger/Hledger/Cli/Commands/Printunique.txt b/hledger/Hledger/Cli/Commands/Printunique.txt deleted file mode 100644 index ef9d0afeb..000000000 --- a/hledger/Hledger/Cli/Commands/Printunique.txt +++ /dev/null @@ -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 diff --git a/hledger/Hledger/Cli/Commands/commands.m4 b/hledger/Hledger/Cli/Commands/commands.m4 index 732c03af5..51ab5d224 100644 --- a/hledger/Hledger/Cli/Commands/commands.m4 +++ b/hledger/Hledger/Cli/Commands/commands.m4 @@ -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}}) diff --git a/hledger/hledger.cabal b/hledger/hledger.cabal index 4d670a48f..4a1049b33 100644 --- a/hledger/hledger.cabal +++ b/hledger/hledger.cabal @@ -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 diff --git a/hledger/hledger.m4.md b/hledger/hledger.m4.md index cef692958..80bf4f5db 100644 --- a/hledger/hledger.m4.md +++ b/hledger/hledger.m4.md @@ -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 diff --git a/hledger/package.yaml b/hledger/package.yaml index 01ac19920..b811223ee 100644 --- a/hledger/package.yaml +++ b/hledger/package.yaml @@ -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