Skip to content

Commit

Permalink
optsParser -> rawOptsParser
Browse files Browse the repository at this point in the history
  • Loading branch information
9999years committed Sep 30, 2024
1 parent 9f5d90f commit a10a2a3
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions cabal-validate/src/Cli.hs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ resolveOpts opts = do
, steps = steps'
}

-- | Raw command-line options.
-- | Literate command-line options as supplied by the user, before resolving
-- defaults and other values from the environment.
data RawOpts = RawOpts
{ rawVerbose :: Bool
, rawJobs :: Maybe Int
Expand All @@ -290,9 +291,9 @@ data RawOpts = RawOpts

-- | `Parser` for `RawOpts`.
--
-- See: `fullOptsParser`
optsParser :: Parser RawOpts
optsParser =
-- See: `fullRawOptsParser`
rawOptsParser :: Parser RawOpts
rawOptsParser =
RawOpts
<$> ( flag'
True
Expand Down Expand Up @@ -419,15 +420,15 @@ boolOption defaultValue trueName =

-- | Full `Parser` for `RawOpts`, which includes a @--help@ argument and
-- information about the program.
fullOptsParser :: ParserInfo RawOpts
fullOptsParser =
fullRawOptsParser :: ParserInfo RawOpts
fullRawOptsParser =
info
(optsParser <**> helper)
(rawOptsParser <**> helper)
( fullDesc
<> progDesc "Test suite runner for `Cabal` and `cabal-install` developers"
)

-- | Parse command-line arguments and resolve defaults from the environment,
-- producing `Opts`.
parseOpts :: IO Opts
parseOpts = execParser fullOptsParser >>= resolveOpts
parseOpts = execParser fullRawOptsParser >>= resolveOpts

0 comments on commit a10a2a3

Please sign in to comment.