Skip to content

Commit

Permalink
wIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed Sep 19, 2024
1 parent 31dcc96 commit 75fc255
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 1 addition & 3 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ pAnyEraCommand envCli =
Opt.progDesc "Conway era commands"
, subParser "latest" $
Opt.info (AnyEraCommandOf ShelleyBasedEraConway <$> pCmds ShelleyBasedEraConway envCli) $
Opt.progDesc ("Latest era commands (Babbage)" <> deprecationText)
, -- Default to Conway era
AnyEraCommandOf ShelleyBasedEraConway <$> pCmds ShelleyBasedEraConway envCli
Opt.progDesc ("Latest era commands (Conway)" <> deprecationText)
]

pCmds :: ShelleyBasedEra era -> EnvCli -> Parser (Cmds era)
Expand Down
4 changes: 4 additions & 0 deletions cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@ subParser :: String -> ParserInfo a -> Parser a
subParser availableCommand pInfo =
Opt.hsubparser $ Opt.command availableCommand pInfo <> Opt.metavar availableCommand

subParserWithDefault :: a -> String -> ParserInfo a -> Parser a
subParserWithDefault def availableCommand pInfo =
subParser availableCommand pInfo <|> pure def

subInfoParser :: String -> InfoMod a -> [Maybe (Parser a)] -> Maybe (Parser a)
subInfoParser name i mps = case catMaybes mps of
[] -> Nothing
Expand Down
6 changes: 6 additions & 0 deletions cardano-cli/src/Cardano/CLI/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module Cardano.CLI.Options
)
where

import Cardano.Api (ShelleyBasedEra (..))

import Cardano.CLI.Byron.Parsers (backwardsCompatibilityCommands, parseByronCommands)
import Cardano.CLI.Environment (EnvCli)
import Cardano.CLI.EraBased.Commands
Expand Down Expand Up @@ -62,6 +64,10 @@ parseClientCommand envCli =
, backwardsCompatibilityCommands envCli
, parseDisplayVersion (opts envCli)
]
<|> defaultParser envCli

defaultParser :: EnvCli -> Parser ClientCommand
defaultParser envCli = fmap (AnyEraCommand . AnyEraCommandOf ShelleyBasedEraConway) (pCmds ShelleyBasedEraConway envCli)

parseByron :: EnvCli -> Parser ClientCommand
parseByron mNetworkId =
Expand Down

0 comments on commit 75fc255

Please sign in to comment.