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
|
where
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
import Data.Map ((!))
|
import Data.Map ((!))
|
||||||
@ -30,9 +30,9 @@ data AppState = AppState {
|
|||||||
|
|
||||||
tcpport = 5000
|
tcpport = 5000
|
||||||
|
|
||||||
happs :: [Opt] -> [String] -> Ledger -> IO ()
|
web :: [Opt] -> [String] -> Ledger -> IO ()
|
||||||
happs opts args l = do
|
web opts args l = do
|
||||||
putStrLn $ printf "starting hledger server on port %d" tcpport
|
putStrLn $ printf "starting hledger web server on port %d" tcpport
|
||||||
simpleHTTP nullConf{port=tcpport} [
|
simpleHTTP nullConf{port=tcpport} [
|
||||||
method GET $ ok $ toResponse $ output
|
method GET $ ok $ toResponse $ output
|
||||||
]
|
]
|
||||||
|
|||||||
@ -35,7 +35,7 @@ usagehdr = printf (
|
|||||||
" ansi - run a simple ansi-based text ui\n" ++
|
" ansi - run a simple ansi-based text ui\n" ++
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAPPS
|
#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
|
#endif
|
||||||
"\n" ++
|
"\n" ++
|
||||||
"PATTERNS are regular expressions which filter by account name.\n" ++
|
"PATTERNS are regular expressions which filter by account name.\n" ++
|
||||||
|
|||||||
@ -60,7 +60,7 @@ import qualified UICommand
|
|||||||
import qualified ANSICommand
|
import qualified ANSICommand
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAPPS
|
#ifdef HAPPS
|
||||||
import qualified HappsCommand
|
import qualified WebCommand
|
||||||
#endif
|
#endif
|
||||||
import Tests
|
import Tests
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ main = do
|
|||||||
| cmd `isPrefixOf` "ansi" = parseLedgerAndDo opts args ANSICommand.ansi
|
| cmd `isPrefixOf` "ansi" = parseLedgerAndDo opts args ANSICommand.ansi
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAPPS
|
#ifdef HAPPS
|
||||||
| cmd `isPrefixOf` "happs" = parseLedgerAndDo opts args HappsCommand.happs
|
| cmd `isPrefixOf` "web" = parseLedgerAndDo opts args WebCommand.web
|
||||||
#endif
|
#endif
|
||||||
| cmd `isPrefixOf` "test" = runtests opts args >> return ()
|
| cmd `isPrefixOf` "test" = runtests opts args >> return ()
|
||||||
| otherwise = putStr $ usage
|
| otherwise = putStr $ usage
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user