Add description
This commit is contained in:
parent
debeeb844b
commit
7549b83bfa
9
Main.hs
9
Main.hs
@ -6,6 +6,7 @@ import Data.Maybe (fromJust)
|
|||||||
import Data.HashMap.Strict (delete)
|
import Data.HashMap.Strict (delete)
|
||||||
import Control.Monad (when)
|
import Control.Monad (when)
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
|
import Control.Applicative
|
||||||
|
|
||||||
import qualified Data.ByteString.Lazy.Char8 as C
|
import qualified Data.ByteString.Lazy.Char8 as C
|
||||||
import System.Console.ArgParser
|
import System.Console.ArgParser
|
||||||
@ -30,6 +31,12 @@ parser = ProgArgs
|
|||||||
`andBy` boolFlag "block" `Descr` "Show blockchain data (require local connecton)"
|
`andBy` boolFlag "block" `Descr` "Show blockchain data (require local connecton)"
|
||||||
`andBy` boolFlag "raw" `Descr` "Print raw JSON data"
|
`andBy` boolFlag "raw" `Descr` "Print raw JSON data"
|
||||||
|
|
||||||
|
interface :: IO (CmdLnInterface ProgArgs)
|
||||||
|
interface =
|
||||||
|
(`setAppDescr` "Query the namecoin blockchain") <$>
|
||||||
|
(`setAppEpilog` "Stat rosa pristina nomine, nomina nuda tenemus.") <$>
|
||||||
|
mkApp parser
|
||||||
|
|
||||||
exec :: ProgArgs -> IO ()
|
exec :: ProgArgs -> IO ()
|
||||||
exec args@ProgArgs{..} =
|
exec args@ProgArgs{..} =
|
||||||
if local
|
if local
|
||||||
@ -54,4 +61,4 @@ exec args@ProgArgs{..} =
|
|||||||
Nothing -> "Error parsing data"
|
Nothing -> "Error parsing data"
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = mkApp parser >>= flip runApp exec
|
main = interface >>= flip runApp exec
|
Loading…
Reference in New Issue
Block a user