aboutsummaryrefslogtreecommitdiff
path: root/video/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'video/Main.hs')
-rw-r--r--video/Main.hs32
1 files changed, 32 insertions, 0 deletions
diff --git a/video/Main.hs b/video/Main.hs
new file mode 100644
index 0000000..627103b
--- /dev/null
+++ b/video/Main.hs
@@ -0,0 +1,32 @@
+-- This module parses config as passed in arguments and runs Emulator.
+module Main where
+
+import Options.Applicative
+import Video
+
+
+inet_socket :: Parser ConfigSocket
+inet_socket = ConfigInet <$> strOption
+ ( long "inet"
+ <> short 'i'
+ <> metavar "ADDR"
+ <> help "Port for internet socket" )
+
+unix_socket :: Parser ConfigSocket
+unix_socket = ConfigUnix <$> strOption
+ ( long "unix"
+ <> short 'u'
+ <> metavar "ADDR"
+ <> help "Address for UNIX socket" )
+
+socket :: Parser ConfigSocket
+socket = inet_socket <|> unix_socket
+
+
+main :: IO ()
+main = video =<< execParser opts
+ where
+ opts = info (socket <**> helper)
+ ( fullDesc
+ <> progDesc "The way to output your colorful pixels from Suem"
+ <> header "suem-video - Suem video device" )