diff options
Diffstat (limited to 'trivmix/Trivmix.hs')
-rw-r--r-- | trivmix/Trivmix.hs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/trivmix/Trivmix.hs b/trivmix/Trivmix.hs index b437abc..a13460f 100644 --- a/trivmix/Trivmix.hs +++ b/trivmix/Trivmix.hs | |||
@@ -30,6 +30,7 @@ import System.IO | |||
30 | import System.FileLock | 30 | import System.FileLock |
31 | import System.INotify | 31 | import System.INotify |
32 | 32 | ||
33 | import Data.Monoid | ||
33 | import Data.Char | 34 | import Data.Char |
34 | import Data.Function | 35 | import Data.Function |
35 | 36 | ||
@@ -41,6 +42,7 @@ data Options = Options | |||
41 | { input :: String | 42 | { input :: String |
42 | , output :: String | 43 | , output :: String |
43 | , client :: String | 44 | , client :: String |
45 | , initialLevel :: Level | ||
44 | , run :: Maybe String | 46 | , run :: Maybe String |
45 | , levelFiles :: [FilePath] | 47 | , levelFiles :: [FilePath] |
46 | } | 48 | } |
@@ -63,6 +65,12 @@ optionParser = Options | |||
63 | <> metavar "STRING" | 65 | <> metavar "STRING" |
64 | <> help "Client name to use in jack (the part before the colon in port names)" | 66 | <> help "Client name to use in jack (the part before the colon in port names)" |
65 | ) | 67 | ) |
68 | <*> option auto ( long "level" | ||
69 | <> metavar "LEVEL" | ||
70 | <> help "Initial value for level" | ||
71 | <> value def | ||
72 | <> showDefault | ||
73 | ) | ||
66 | <*> optional ( strOption ( long "run" | 74 | <*> optional ( strOption ( long "run" |
67 | <> metavar "FILE" | 75 | <> metavar "FILE" |
68 | <> help "Execute a file once setup of jacks is done (use this to autoconnect)\nThe executable gets passed the input port (including client name) as its first argument and the output as its second." | 76 | <> help "Execute a file once setup of jacks is done (use this to autoconnect)\nThe executable gets passed the input port (including client name) as its first argument and the output as its second." |
@@ -84,9 +92,6 @@ watchedAttrs = [ Modify | |||
84 | , DeleteSelf | 92 | , DeleteSelf |
85 | ] | 93 | ] |
86 | 94 | ||
87 | initialLevel :: Level | ||
88 | initialLevel = def | ||
89 | |||
90 | defFileMode :: FileMode | 95 | defFileMode :: FileMode |
91 | defFileMode = foldl unionFileModes nullFileMode [ ownerReadMode | 96 | defFileMode = foldl unionFileModes nullFileMode [ ownerReadMode |
92 | , ownerWriteMode | 97 | , ownerWriteMode |