From c50c66ff141224e72e3d47888a35852e5138c12f Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 19 May 2010 23:50:41 +0000 Subject: [PATCH] rename the ui command to vty for consistency --- Hledger/Cli/Commands/All.hs | 6 +++--- Hledger/Cli/Commands/{UI.hs => Vty.hs} | 10 +++++----- Hledger/Cli/Main.hs | 2 +- hledger.cabal | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) rename Hledger/Cli/Commands/{UI.hs => Vty.hs} (98%) diff --git a/Hledger/Cli/Commands/All.hs b/Hledger/Cli/Commands/All.hs index 595a66f20..95d5ebd3c 100644 --- a/Hledger/Cli/Commands/All.hs +++ b/Hledger/Cli/Commands/All.hs @@ -16,7 +16,7 @@ module Hledger.Cli.Commands.All ( module Hledger.Cli.Commands.Register, module Hledger.Cli.Commands.Stats, #ifdef VTY - module Hledger.Cli.Commands.UI, + module Hledger.Cli.Commands.Vty, #endif #if defined(WEB) || defined(WEBHAPPSTACK) module Hledger.Cli.Commands.Web, @@ -35,7 +35,7 @@ import Hledger.Cli.Commands.Print import Hledger.Cli.Commands.Register import Hledger.Cli.Commands.Stats #ifdef VTY -import Hledger.Cli.Commands.UI +import Hledger.Cli.Commands.Vty #endif #if defined(WEB) || defined(WEBHAPPSTACK) import Hledger.Cli.Commands.Web @@ -57,7 +57,7 @@ tests_Hledger_Commands = TestList -- ,Hledger.Cli.Commands.Stats.tests_Stats ] -- #ifdef VTY --- ,Hledger.Cli.Commands.UI.tests_UI +-- ,Hledger.Cli.Commands.Vty.tests_Vty -- #endif -- #if defined(WEB) || defined(WEBHAPPSTACK) -- ,Hledger.Cli.Commands.Web.tests_Web diff --git a/Hledger/Cli/Commands/UI.hs b/Hledger/Cli/Commands/Vty.hs similarity index 98% rename from Hledger/Cli/Commands/UI.hs rename to Hledger/Cli/Commands/Vty.hs index 2acfe18f1..5e97d4ff2 100644 --- a/Hledger/Cli/Commands/UI.hs +++ b/Hledger/Cli/Commands/Vty.hs @@ -4,7 +4,7 @@ A simple text UI for hledger, based on the vty library. -} -module Hledger.Cli.Commands.UI +module Hledger.Cli.Commands.Vty where import Safe (headDef) import Graphics.Vty @@ -19,7 +19,7 @@ helpmsg = "(b)alance, (r)egister, (p)rint, (right) to drill down, (left) to back instance Show Vty where show = const "a Vty" --- | The application state when running the ui command. +-- | The application state when running the vty command. data AppState = AppState { av :: Vty -- ^ the vty context ,aw :: Int -- ^ window width @@ -47,9 +47,9 @@ data Screen = BalanceScreen -- ^ like hledger balance, shows accounts -- | LedgerScreen -- ^ shows the raw ledger deriving (Eq,Show) --- | Run the interactive text ui. -ui :: [Opt] -> [String] -> Ledger -> IO () -ui opts args l = do +-- | Run the vty (curses-style) ui. +vty :: [Opt] -> [String] -> Ledger -> IO () +vty opts args l = do v <- mkVty DisplayRegion w h <- display_bounds $ terminal v let opts' = SubTotal:opts diff --git a/Hledger/Cli/Main.hs b/Hledger/Cli/Main.hs index 7630aa4ec..722e88e53 100644 --- a/Hledger/Cli/Main.hs +++ b/Hledger/Cli/Main.hs @@ -35,7 +35,7 @@ main = do | cmd `isPrefixOf` "add" = withLedgerDo opts args cmd add | cmd `isPrefixOf` "stats" = withLedgerDo opts args cmd stats #ifdef VTY - | cmd `isPrefixOf` "ui" = withLedgerDo opts args cmd ui + | cmd `isPrefixOf` "vty" = withLedgerDo opts args cmd vty #endif #if defined(WEB) || defined(WEBHAPPSTACK) | cmd `isPrefixOf` "web" = withLedgerDo opts args cmd web diff --git a/hledger.cabal b/hledger.cabal index ef40d6715..c25d7395f 100644 --- a/hledger.cabal +++ b/hledger.cabal @@ -88,7 +88,7 @@ executable hledger if flag(vty) cpp-options: -DVTY - other-modules:Hledger.Cli.Commands.UI + other-modules:Hledger.Cli.Commands.Vty build-depends: vty >= 4.0.0.1 @@ -153,7 +153,7 @@ library if flag(vty) cpp-options: -DVTY - exposed-modules:Hledger.Cli.Commands.UI + exposed-modules:Hledger.Cli.Commands.Vty build-depends: vty >= 4.0.0.1