rename the ui command to vty for consistency
This commit is contained in:
parent
70576e87d1
commit
c50c66ff14
@ -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
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user