mirror of
https://github.com/simonmichael/hledger.git
synced 2025-01-07 11:19:32 +03:00
rename the happs command to "web"
This commit is contained in:
parent
210d8f77fd
commit
7f18b50e50
@ -1,10 +1,10 @@
|
||||
{-|
|
||||
|
||||
A happs-based UI for hledger.
|
||||
A happs-based web UI for hledger.
|
||||
|
||||
-}
|
||||
|
||||
module HappsCommand
|
||||
module WebCommand
|
||||
where
|
||||
import qualified Data.Map as Map
|
||||
import Data.Map ((!))
|
||||
@ -30,9 +30,9 @@ data AppState = AppState {
|
||||
|
||||
tcpport = 5000
|
||||
|
||||
happs :: [Opt] -> [String] -> Ledger -> IO ()
|
||||
happs opts args l = do
|
||||
putStrLn $ printf "starting hledger server on port %d" tcpport
|
||||
web :: [Opt] -> [String] -> Ledger -> IO ()
|
||||
web opts args l = do
|
||||
putStrLn $ printf "starting hledger web server on port %d" tcpport
|
||||
simpleHTTP nullConf{port=tcpport} [
|
||||
method GET $ ok $ toResponse $ output
|
||||
]
|
||||
|
@ -35,7 +35,7 @@ usagehdr = printf (
|
||||
" ansi - run a simple ansi-based text ui\n" ++
|
||||
#endif
|
||||
#ifdef HAPPS
|
||||
" happs - run a web server providing a minimal web ui\n" ++
|
||||
" web - run a web server providing a simple web ui\n" ++
|
||||
#endif
|
||||
"\n" ++
|
||||
"PATTERNS are regular expressions which filter by account name.\n" ++
|
||||
|
@ -60,7 +60,7 @@ import qualified UICommand
|
||||
import qualified ANSICommand
|
||||
#endif
|
||||
#ifdef HAPPS
|
||||
import qualified HappsCommand
|
||||
import qualified WebCommand
|
||||
#endif
|
||||
import Tests
|
||||
|
||||
@ -83,7 +83,7 @@ main = do
|
||||
| cmd `isPrefixOf` "ansi" = parseLedgerAndDo opts args ANSICommand.ansi
|
||||
#endif
|
||||
#ifdef HAPPS
|
||||
| cmd `isPrefixOf` "happs" = parseLedgerAndDo opts args HappsCommand.happs
|
||||
| cmd `isPrefixOf` "web" = parseLedgerAndDo opts args WebCommand.web
|
||||
#endif
|
||||
| cmd `isPrefixOf` "test" = runtests opts args >> return ()
|
||||
| otherwise = putStr $ usage
|
||||
|
Loading…
Reference in New Issue
Block a user