aboutsummaryrefslogtreecommitdiff
path: root/video/Main.hs
blob: 627103bd88eb3b9f3666e4e96dece6598aee054e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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" )