Matthias Andreas Benkard | 262110d | 2021-08-24 06:35:55 +0200 | [diff] [blame] | 1 | {-# LANGUAGE TypeApplications #-} |
Matthias Andreas Benkard | 47eddb5 | 2024-08-30 18:47:33 +0200 | [diff] [blame^] | 2 | {-# LANGUAGE TypeOperators #-} |
Matthias Andreas Benkard | 262110d | 2021-08-24 06:35:55 +0200 | [diff] [blame] | 3 | {-# LANGUAGE UndecidableInstances #-} |
| 4 | |
| 5 | module Mulkup.Flags (Flags (..), flagParser) where |
| 6 | |
| 7 | import Mulkup.Prelude |
| 8 | import Optics.TH |
| 9 | import Options.Applicative |
| 10 | ( Parser, |
| 11 | help, |
| 12 | long, |
| 13 | short, |
| 14 | switch, |
| 15 | ) |
| 16 | |
| 17 | data Flags = Flags |
| 18 | {verbose :: Bool} |
| 19 | |
| 20 | makeFieldLabelsNoPrefix ''Flags |
| 21 | |
| 22 | flagParser :: Parser Flags |
| 23 | flagParser = |
| 24 | Flags <$> switch (long "verbose" <> short 'v' <> help "Log verbosely.") |