diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-06-07 22:39:05 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-06-07 22:39:05 +0200 |
commit | 83838ea952146a742b2cf5e97b287d9cbeef8c61 (patch) | |
tree | 81654899be0868978737b4b62de0060aa1799f65 /src | |
parent | 41111d7e0b05f5bd6f17a25ac2abd604944440c1 (diff) | |
download | trivmix-83838ea952146a742b2cf5e97b287d9cbeef8c61.tar trivmix-83838ea952146a742b2cf5e97b287d9cbeef8c61.tar.gz trivmix-83838ea952146a742b2cf5e97b287d9cbeef8c61.tar.bz2 trivmix-83838ea952146a742b2cf5e97b287d9cbeef8c61.tar.xz trivmix-83838ea952146a742b2cf5e97b287d9cbeef8c61.zip |
Made input & output optional
Diffstat (limited to 'src')
-rw-r--r-- | src/Trivmix.hs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Trivmix.hs b/src/Trivmix.hs index 2d6a50a..a754e76 100644 --- a/src/Trivmix.hs +++ b/src/Trivmix.hs | |||
@@ -37,12 +37,16 @@ data Options = Options | |||
37 | 37 | ||
38 | optionParser :: Parser Options | 38 | optionParser :: Parser Options |
39 | optionParser = Options <$> | 39 | optionParser = Options <$> |
40 | strOption ( long "input" | 40 | (fromMaybe "in" <$> optional (strOption ( long "input" |
41 | <> metavar "STRING" | 41 | <> metavar "STRING" |
42 | ) | 42 | ) |
43 | <*> strOption ( long "output" | 43 | ) |
44 | <> metavar "STRING" | 44 | ) |
45 | ) | 45 | <*> (fromMaybe "out" <$> optional (strOption ( long "output" |
46 | <> metavar "STRING" | ||
47 | ) | ||
48 | ) | ||
49 | ) | ||
46 | <*> strOption ( long "client" | 50 | <*> strOption ( long "client" |
47 | <> metavar "STRING" | 51 | <> metavar "STRING" |
48 | ) | 52 | ) |