From fac5c4745fc0da0e9f8b6e0fa997c019a7c753e0 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Tue, 13 Apr 2021 14:46:18 +0300 Subject: Initial commit. --- video/Main.hs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 video/Main.hs (limited to 'video/Main.hs') 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" ) -- cgit v1.2.3