summaryrefslogtreecommitdiff
path: root/examples/dhtd.hs
diff options
context:
space:
mode:
authorJames Crayne <jim.crayne@gmail.com>2018-05-29 03:43:29 +0000
committerJames Crayne <jim.crayne@gmail.com>2018-05-29 03:43:29 +0000
commit40c5a8aec30538cad0e43027aa6beec2ace8d0fc (patch)
tree3cced056bab3851e993ae12a514f8d261e3b68e8 /examples/dhtd.hs
parentbe48775177ac1d22f868b252b9517354f69a452d (diff)
quiet and verbose commands, feedback and more forgiving parse
Diffstat (limited to 'examples/dhtd.hs')
-rw-r--r--examples/dhtd.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs
index ba7b0fca..27e3c4ef 100644
--- a/examples/dhtd.hs
+++ b/examples/dhtd.hs
@@ -719,14 +719,16 @@ clientSession s@Session{..} sock cnum h = do
719 hPutClient h $ showReport frs 719 hPutClient h $ showReport frs
720 720
721 ("quiet",s) | s' <- strp s 721 ("quiet",s) | s' <- strp s
722 , Just (tag::DebugTag) <- readMaybe ('X':s') 722 , Just (tag::DebugTag) <- readMaybe ('X':map toUpper (take 1 s') ++ drop 1 s')
723 -> cmd0 $ do 723 -> cmd0 $ do
724 setQuiet tag 724 setQuiet tag
725 hPutClient h $ "Suppressing " ++ show tag ++ " messages."
725 726
726 ("verbose",s) | s' <- strp s 727 ("verbose",s) | s' <- strp s
727 , Just (tag::DebugTag) <- readMaybe ('X':s') 728 , Just (tag::DebugTag) <- readMaybe ('X':map toUpper (take 1 s') ++ drop 1 s')
728 -> cmd0 $ do 729 -> cmd0 $ do
729 setVerbose tag 730 setVerbose tag
731 hPutClient h $ "Showing " ++ show tag ++ " messages."
730 732
731 -- list information about current netcrypto sesssions 733 -- list information about current netcrypto sesssions
732 ("sessions", s) | "" <- strp s 734 ("sessions", s) | "" <- strp s