36 lines
1.2 KiB
Haskell
36 lines
1.2 KiB
Haskell
module ArgParser where
|
|
|
|
import Options.Applicative
|
|
|
|
data Args = Args
|
|
{ argAdd :: Maybe String
|
|
, argDelete :: Maybe String
|
|
, argCheck :: Maybe String
|
|
, argTui :: Bool
|
|
}
|
|
|
|
args :: Parser Args
|
|
args =
|
|
Args
|
|
<$> optional
|
|
( strOption
|
|
( long "add"
|
|
<> short 'a'
|
|
<> help "add a new item"
|
|
)
|
|
)
|
|
<*> optional
|
|
( strOption
|
|
( long "delete"
|
|
<> short 'd'
|
|
<> help "delete an item"
|
|
)
|
|
)
|
|
<*> optional
|
|
( strOption
|
|
( long "check"
|
|
<> short 'c'
|
|
<> help "check an item"
|
|
)
|
|
)
|
|
<*> switch (long "tui" <> short 't' <> help "launch a tui app powered by brick")
|