From 1127c3f52fcb2bf74f3a48b10170a2b3c83339ba Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 15 Nov 2010 06:48:49 +0000 Subject: [PATCH] flatten modules a little --- hledger-chart/Hledger/Chart.hs | 2 +- hledger-chart/Main.hs | 2 +- hledger-vty/Hledger/Vty.hs | 6 +-- hledger-web/Hledger/Web/App.hs | 8 ++-- hledger/Hledger/Cli/{Commands => }/Add.hs | 4 +- hledger/Hledger/Cli/{Commands => }/Balance.hs | 2 +- hledger/Hledger/Cli/Commands.hs | 40 +++++++++++++++++++ hledger/Hledger/Cli/Commands/All.hs | 40 ------------------- hledger/Hledger/Cli/{Commands => }/Convert.hs | 2 +- .../Hledger/Cli/{Commands => }/Histogram.hs | 2 +- hledger/Hledger/Cli/Main.hs | 2 +- hledger/Hledger/Cli/{Commands => }/Print.hs | 2 +- .../Hledger/Cli/{Commands => }/Register.hs | 2 +- hledger/Hledger/Cli/{Commands => }/Stats.hs | 2 +- hledger/Hledger/Cli/Tests.hs | 2 +- hledger/hledger.cabal | 32 +++++++-------- 16 files changed, 75 insertions(+), 75 deletions(-) rename hledger/Hledger/Cli/{Commands => }/Add.hs (99%) rename hledger/Hledger/Cli/{Commands => }/Balance.hs (99%) create mode 100644 hledger/Hledger/Cli/Commands.hs delete mode 100644 hledger/Hledger/Cli/Commands/All.hs rename hledger/Hledger/Cli/{Commands => }/Convert.hs (99%) rename hledger/Hledger/Cli/{Commands => }/Histogram.hs (97%) rename hledger/Hledger/Cli/{Commands => }/Print.hs (97%) rename hledger/Hledger/Cli/{Commands => }/Register.hs (99%) rename hledger/Hledger/Cli/{Commands => }/Stats.hs (99%) diff --git a/hledger-chart/Hledger/Chart.hs b/hledger-chart/Hledger/Chart.hs index 40b193b0f..9941e058f 100644 --- a/hledger-chart/Hledger/Chart.hs +++ b/hledger-chart/Hledger/Chart.hs @@ -4,7 +4,7 @@ Generate balances pie chart -} -module Hledger.Cli.Commands.Chart +module Hledger.Cli.Chart where import Hledger.Data.Utils import Hledger.Data.Types diff --git a/hledger-chart/Main.hs b/hledger-chart/Main.hs index 3bf24a65d..2f6d6e90d 100644 --- a/hledger-chart/Main.hs +++ b/hledger-chart/Main.hs @@ -13,7 +13,7 @@ import System.IO.UTF8 (putStr, putStrLn) #endif import Hledger.Chart -import Hledger.Cli.Commands.All +import Hledger.Cli.Commands import Hledger.Cli.Options import Hledger.Cli.Tests import Hledger.Cli.Utils (withJournalDo) diff --git a/hledger-vty/Hledger/Vty.hs b/hledger-vty/Hledger/Vty.hs index df43b99ab..f7d34c225 100644 --- a/hledger-vty/Hledger/Vty.hs +++ b/hledger-vty/Hledger/Vty.hs @@ -10,9 +10,9 @@ import Safe (headDef) import Graphics.Vty import Hledger.Data import Hledger.Cli.Options -import Hledger.Cli.Commands.Balance -import Hledger.Cli.Commands.Register -import Hledger.Cli.Commands.Print +import Hledger.Cli.Balance +import Hledger.Cli.Register +import Hledger.Cli.Print helpmsg = "(b)alance, (r)egister, (p)rint, (right) to drill down, (left) to back up, (q)uit" diff --git a/hledger-web/Hledger/Web/App.hs b/hledger-web/Hledger/Web/App.hs index 76e4c9c3e..0d72f04f8 100644 --- a/hledger-web/Hledger/Web/App.hs +++ b/hledger-web/Hledger/Web/App.hs @@ -27,10 +27,10 @@ import Yesod.Helpers.Static import Text.Hamlet (defaultHamletSettings) import Text.Hamlet.RT -import Hledger.Cli.Commands.Add (appendToJournalFile) -import Hledger.Cli.Commands.Balance -import Hledger.Cli.Commands.Print -import Hledger.Cli.Commands.Register +import Hledger.Cli.Add (appendToJournalFile) +import Hledger.Cli.Balance +import Hledger.Cli.Print +import Hledger.Cli.Register import Hledger.Cli.Options hiding (value) import Hledger.Cli.Utils import Hledger.Cli.Version (version) diff --git a/hledger/Hledger/Cli/Commands/Add.hs b/hledger/Hledger/Cli/Add.hs similarity index 99% rename from hledger/Hledger/Cli/Commands/Add.hs rename to hledger/Hledger/Cli/Add.hs index 83d037df0..3bdf9c6cc 100644 --- a/hledger/Hledger/Cli/Commands/Add.hs +++ b/hledger/Hledger/Cli/Add.hs @@ -5,12 +5,12 @@ A history-aware add command to help with data entry. -} -module Hledger.Cli.Commands.Add +module Hledger.Cli.Add where import Hledger.Data import Hledger.Read.Journal (someamount) import Hledger.Cli.Options -import Hledger.Cli.Commands.Register (registerReport, registerReportAsText) +import Hledger.Cli.Register (registerReport, registerReportAsText) #if __GLASGOW_HASKELL__ <= 610 import Prelude hiding (putStr, putStrLn, getLine, appendFile) import System.IO.UTF8 diff --git a/hledger/Hledger/Cli/Commands/Balance.hs b/hledger/Hledger/Cli/Balance.hs similarity index 99% rename from hledger/Hledger/Cli/Commands/Balance.hs rename to hledger/Hledger/Cli/Balance.hs index f27491cd6..328c4b47d 100644 --- a/hledger/Hledger/Cli/Commands/Balance.hs +++ b/hledger/Hledger/Cli/Balance.hs @@ -95,7 +95,7 @@ balance report: -} -module Hledger.Cli.Commands.Balance ( +module Hledger.Cli.Balance ( BalanceReport ,BalanceReportItem ,balance diff --git a/hledger/Hledger/Cli/Commands.hs b/hledger/Hledger/Cli/Commands.hs new file mode 100644 index 000000000..f6209a990 --- /dev/null +++ b/hledger/Hledger/Cli/Commands.hs @@ -0,0 +1,40 @@ +{-# LANGUAGE CPP #-} +{-| + +The Commands package defines all the commands offered by the hledger +application, like \"register\" and \"balance\". This module exports all +the commands; you can also import individual modules if you prefer. + +-} + +module Hledger.Cli.Commands ( + module Hledger.Cli.Add, + module Hledger.Cli.Balance, + module Hledger.Cli.Convert, + module Hledger.Cli.Histogram, + module Hledger.Cli.Print, + module Hledger.Cli.Register, + module Hledger.Cli.Stats, + tests_Hledger_Commands + ) +where +import Hledger.Cli.Add +import Hledger.Cli.Balance +import Hledger.Cli.Convert +import Hledger.Cli.Histogram +import Hledger.Cli.Print +import Hledger.Cli.Register +import Hledger.Cli.Stats +import Test.HUnit (Test(TestList)) + + +tests_Hledger_Commands = TestList + [ +-- Hledger.Cli.Add.tests_Add +-- ,Hledger.Cli.Balance.tests_Balance + Hledger.Cli.Convert.tests_Convert +-- ,Hledger.Cli.Histogram.tests_Histogram +-- ,Hledger.Cli.Print.tests_Print + ,Hledger.Cli.Register.tests_Register +-- ,Hledger.Cli.Stats.tests_Stats + ] diff --git a/hledger/Hledger/Cli/Commands/All.hs b/hledger/Hledger/Cli/Commands/All.hs deleted file mode 100644 index 14e8ffdb4..000000000 --- a/hledger/Hledger/Cli/Commands/All.hs +++ /dev/null @@ -1,40 +0,0 @@ -{-# LANGUAGE CPP #-} -{-| - -The Commands package defines all the commands offered by the hledger -application, like \"register\" and \"balance\". This module exports all -the commands; you can also import individual modules if you prefer. - --} - -module Hledger.Cli.Commands.All ( - module Hledger.Cli.Commands.Add, - module Hledger.Cli.Commands.Balance, - module Hledger.Cli.Commands.Convert, - module Hledger.Cli.Commands.Histogram, - module Hledger.Cli.Commands.Print, - module Hledger.Cli.Commands.Register, - module Hledger.Cli.Commands.Stats, - tests_Hledger_Commands - ) -where -import Hledger.Cli.Commands.Add -import Hledger.Cli.Commands.Balance -import Hledger.Cli.Commands.Convert -import Hledger.Cli.Commands.Histogram -import Hledger.Cli.Commands.Print -import Hledger.Cli.Commands.Register -import Hledger.Cli.Commands.Stats -import Test.HUnit (Test(TestList)) - - -tests_Hledger_Commands = TestList - [ --- Hledger.Cli.Commands.Add.tests_Add --- ,Hledger.Cli.Commands.Balance.tests_Balance - Hledger.Cli.Commands.Convert.tests_Convert --- ,Hledger.Cli.Commands.Histogram.tests_Histogram --- ,Hledger.Cli.Commands.Print.tests_Print - ,Hledger.Cli.Commands.Register.tests_Register --- ,Hledger.Cli.Commands.Stats.tests_Stats - ] diff --git a/hledger/Hledger/Cli/Commands/Convert.hs b/hledger/Hledger/Cli/Convert.hs similarity index 99% rename from hledger/Hledger/Cli/Commands/Convert.hs rename to hledger/Hledger/Cli/Convert.hs index 5c892f256..bb7986179 100644 --- a/hledger/Hledger/Cli/Commands/Convert.hs +++ b/hledger/Hledger/Cli/Convert.hs @@ -3,7 +3,7 @@ Convert account data in CSV format (eg downloaded from a bank) to journal format, and print it on stdout. See the manual for more details. -} -module Hledger.Cli.Commands.Convert where +module Hledger.Cli.Convert where import Hledger.Cli.Options (Opt(Debug)) import Hledger.Cli.Version (versionstr) import Hledger.Data.Types (Journal,AccountName,Transaction(..),Posting(..),PostingType(..)) diff --git a/hledger/Hledger/Cli/Commands/Histogram.hs b/hledger/Hledger/Cli/Histogram.hs similarity index 97% rename from hledger/Hledger/Cli/Commands/Histogram.hs rename to hledger/Hledger/Cli/Histogram.hs index 62e740702..2867c92c8 100644 --- a/hledger/Hledger/Cli/Commands/Histogram.hs +++ b/hledger/Hledger/Cli/Histogram.hs @@ -5,7 +5,7 @@ Print a histogram report. -} -module Hledger.Cli.Commands.Histogram +module Hledger.Cli.Histogram where import Hledger.Data import Hledger.Cli.Options diff --git a/hledger/Hledger/Cli/Main.hs b/hledger/Hledger/Cli/Main.hs index d8a453703..40603eb1d 100644 --- a/hledger/Hledger/Cli/Main.hs +++ b/hledger/Hledger/Cli/Main.hs @@ -45,8 +45,8 @@ import Prelude hiding (putStr, putStrLn) import System.IO.UTF8 #endif -import Hledger.Cli.Commands.All import Hledger.Data +import Hledger.Cli.Commands import Hledger.Cli.Options import Hledger.Cli.Tests import Hledger.Cli.Utils (withJournalDo) diff --git a/hledger/Hledger/Cli/Commands/Print.hs b/hledger/Hledger/Cli/Print.hs similarity index 97% rename from hledger/Hledger/Cli/Commands/Print.hs rename to hledger/Hledger/Cli/Print.hs index e1c8f3032..a91e08ba7 100644 --- a/hledger/Hledger/Cli/Commands/Print.hs +++ b/hledger/Hledger/Cli/Print.hs @@ -5,7 +5,7 @@ A ledger-compatible @print@ command. -} -module Hledger.Cli.Commands.Print ( +module Hledger.Cli.Print ( JournalReport ,JournalReportItem ,print' diff --git a/hledger/Hledger/Cli/Commands/Register.hs b/hledger/Hledger/Cli/Register.hs similarity index 99% rename from hledger/Hledger/Cli/Commands/Register.hs rename to hledger/Hledger/Cli/Register.hs index e3fde1019..db2b09cd7 100644 --- a/hledger/Hledger/Cli/Commands/Register.hs +++ b/hledger/Hledger/Cli/Register.hs @@ -5,7 +5,7 @@ A ledger-compatible @register@ command. -} -module Hledger.Cli.Commands.Register ( +module Hledger.Cli.Register ( RegisterReport ,RegisterReportItem ,register diff --git a/hledger/Hledger/Cli/Commands/Stats.hs b/hledger/Hledger/Cli/Stats.hs similarity index 99% rename from hledger/Hledger/Cli/Commands/Stats.hs rename to hledger/Hledger/Cli/Stats.hs index 813dbec75..57638ec95 100644 --- a/hledger/Hledger/Cli/Commands/Stats.hs +++ b/hledger/Hledger/Cli/Stats.hs @@ -5,7 +5,7 @@ Print some statistics for the journal. -} -module Hledger.Cli.Commands.Stats +module Hledger.Cli.Stats where import Hledger.Data import Hledger.Cli.Options diff --git a/hledger/Hledger/Cli/Tests.hs b/hledger/Hledger/Cli/Tests.hs index d3b617159..e20bd469f 100644 --- a/hledger/Hledger/Cli/Tests.hs +++ b/hledger/Hledger/Cli/Tests.hs @@ -32,10 +32,10 @@ import qualified Data.Map as Map import System.Exit (exitFailure, exitWith, ExitCode(ExitSuccess)) -- base 3 compatible import System.Time (ClockTime(TOD)) -import Hledger.Cli.Commands.All import Hledger.Data -- including testing utils in Hledger.Data.Utils import Hledger.Read (readJournal) import Hledger.Read.Journal (someamount) +import Hledger.Cli.Commands import Hledger.Cli.Options import Hledger.Cli.Utils diff --git a/hledger/hledger.cabal b/hledger/hledger.cabal index a6b0d1eeb..c1e64b1d6 100644 --- a/hledger/hledger.cabal +++ b/hledger/hledger.cabal @@ -41,14 +41,14 @@ executable hledger Hledger.Cli.Tests Hledger.Cli.Utils Hledger.Cli.Version - Hledger.Cli.Commands.Add - Hledger.Cli.Commands.All - Hledger.Cli.Commands.Balance - Hledger.Cli.Commands.Convert - Hledger.Cli.Commands.Histogram - Hledger.Cli.Commands.Print - Hledger.Cli.Commands.Register - Hledger.Cli.Commands.Stats + Hledger.Cli.Commands + Hledger.Cli.Add + Hledger.Cli.Balance + Hledger.Cli.Convert + Hledger.Cli.Histogram + Hledger.Cli.Print + Hledger.Cli.Register + Hledger.Cli.Stats build-depends: hledger-lib == 0.13 ,HUnit @@ -80,14 +80,14 @@ library Hledger.Cli.Tests Hledger.Cli.Utils Hledger.Cli.Version - Hledger.Cli.Commands.Add - Hledger.Cli.Commands.All - Hledger.Cli.Commands.Balance - Hledger.Cli.Commands.Convert - Hledger.Cli.Commands.Histogram - Hledger.Cli.Commands.Print - Hledger.Cli.Commands.Register - Hledger.Cli.Commands.Stats + Hledger.Cli.Commands + Hledger.Cli.Add + Hledger.Cli.Balance + Hledger.Cli.Convert + Hledger.Cli.Histogram + Hledger.Cli.Print + Hledger.Cli.Register + Hledger.Cli.Stats build-depends: hledger-lib == 0.13 ,HUnit