todo/app/ArgParser.hs
2025-05-13 20:21:30 +02:00

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")