aboutsummaryrefslogtreecommitdiff
path: root/video/Main.hs
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2021-04-13 14:46:18 +0300
committerAleksey Veresov <aleksey@veresov.pro>2023-12-06 19:47:22 +0300
commitfac5c4745fc0da0e9f8b6e0fa997c019a7c753e0 (patch)
tree2f5dbc689bc392569234812f573d22d8a188a86e /video/Main.hs
parentc1243463fbeced6b1f1765991b56d726f9e7d869 (diff)
downloadsuem-fac5c4745fc0da0e9f8b6e0fa997c019a7c753e0.tar
suem-fac5c4745fc0da0e9f8b6e0fa997c019a7c753e0.tar.xz
suem-fac5c4745fc0da0e9f8b6e0fa997c019a7c753e0.zip
Initial commit.
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" )