summaryrefslogtreecommitdiff
path: root/Example.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Example.hs')
-rw-r--r--Example.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Example.hs b/Example.hs
index 6454fc7..fca8165 100644
--- a/Example.hs
+++ b/Example.hs
@@ -16,7 +16,7 @@ instance ToArgs RecTest
data Foo = Bar Int
| Baz Int
- | Qux (Maybe Int) (Maybe Int) RecTest (Maybe Double)
+ | Qux (Maybe Int) (Maybe String) RecTest (Maybe Double)
deriving (Generic, Show)
instance ArgParser Foo
@@ -30,8 +30,9 @@ instance ToArgs Wrap
main :: IO ()
main = do
- let val = Wrap (Just $ Qux Nothing (Just 1) (RecTest Nothing (Just 2.3) Nothing) Nothing) (Just 1)
- a = args defMod val
+ let val = Wrap (Just $ Qux Nothing (Just "foo bar")
+ (RecTest Nothing (Just 2.3) Nothing) Nothing) (Just 1)
+ a = toArgs defMod val
print val
- putStrLn a
+ print a
print $ parse (argParser defMod :: Parser Wrap) "test" a