From abfd6394eee858e5331aa2b722acc8f3b22bf400 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 28 Mar 2017 04:08:36 -0700 Subject: [PATCH] bin: name hledger-check-dupes like other validation commands --- bin/{hledger-dupes.hs => hledger-check-dupes.hs} | 8 ++++---- hledger/doc/addons.m4.md | 4 ++-- site/download.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) rename bin/{hledger-dupes.hs => hledger-check-dupes.hs} (91%) diff --git a/bin/hledger-dupes.hs b/bin/hledger-check-dupes.hs similarity index 91% rename from bin/hledger-dupes.hs rename to bin/hledger-check-dupes.hs index 4f9193405..1eba3ebb8 100755 --- a/bin/hledger-dupes.hs +++ b/bin/hledger-check-dupes.hs @@ -20,7 +20,7 @@ import qualified Data.Text as T ------------------------------------------------------------------------------ cmdmode = hledgerCommandMode - [here| dupes + [here| check-dupes Reports duplicates in the account tree: account names having the same leaf but different prefixes. In other words, two or more leaves that are categorized differently. @@ -37,7 +37,7 @@ http://stefanorodighiero.net/software/hledger-dupes.html main = do opts <- getHledgerCliOpts cmdmode withJournalDo opts $ \CliOpts{rawopts_=_opts,reportopts_=_ropts} j -> do - mapM_ render $ dupes $ accountsNames j + mapM_ render $ checkdupes $ accountsNames j accountsNames :: Journal -> [(String, AccountName)] accountsNames j = map leafAndAccountName as @@ -46,8 +46,8 @@ accountsNames j = map leafAndAccountName as as = nub $ sort $ map paccount ps -dupes :: (Ord k, Eq k) => [(k, v)] -> [(k, [v])] -dupes l = zip dupLeafs dupAccountNames +checkdupes :: (Ord k, Eq k) => [(k, v)] -> [(k, [v])] +checkdupes l = zip dupLeafs dupAccountNames where dupLeafs = map (fst . head) d dupAccountNames = map (map snd) d d = dupes' l diff --git a/hledger/doc/addons.m4.md b/hledger/doc/addons.m4.md index d21bd0f55..8292afabd 100644 --- a/hledger/doc/addons.m4.md +++ b/hledger/doc/addons.m4.md @@ -94,9 +94,9 @@ checks more powerful account balance assertions. [hledger-check-dates.hs](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check-dates.hs#L15) checks that journal entries are ordered by date. -### dupes +### check-dupes -[hledger-dupes.hs](https://github.com/simonmichael/hledger/blob/master/bin/hledger-dupes.hs#L21) +[hledger-check-dupes.hs](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check-dupes.hs#L21) checks for account names sharing the same leaf name. ### equity diff --git a/site/download.md b/site/download.md index 3a4bf0ac2..48a712eed 100644 --- a/site/download.md +++ b/site/download.md @@ -119,7 +119,7 @@ Some experimental commands are not built in to hledger, but [add-on commands](http://hledger.org/hledger.html#add-on-commands), such as:\ `chart`, `check-dates`, -`dupes`, +`check-dupes`, `equity`, `print-unique`, `register-match`,