mirror of
https://github.com/zoriya/applicative-getopt.git
synced 2025-12-06 05:36:09 +00:00
38 lines
739 B
Haskell
38 lines
739 B
Haskell
module Main where
|
|
|
|
import GetOpt
|
|
import System.Environment (getArgs)
|
|
|
|
main :: IO()
|
|
main = do
|
|
args <- getArgs
|
|
print $ getOpt getParser args
|
|
|
|
|
|
getParser :: Parser Configuration
|
|
getParser = Configuration
|
|
<$> option auto (
|
|
long "rule"
|
|
<> short 'r'
|
|
<> meta "RULE"
|
|
<> help "The rulset used."
|
|
)
|
|
-- <*> option (
|
|
-- long "start"
|
|
-- <> short 's'
|
|
-- <> meta "START"
|
|
-- <> help "At witch line should we start"
|
|
-- <> value 0
|
|
-- )
|
|
|
|
|
|
|
|
data Configuration = Configuration {
|
|
rule :: Int
|
|
-- start :: Int,
|
|
-- lines :: Maybe Int,
|
|
-- window :: Int,
|
|
-- move :: Int
|
|
} deriving Show
|
|
|