From c1f572f3bd0b9655e5951817686ab155cfda8a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hurlin?= Date: Wed, 21 Aug 2024 10:39:25 +0200 Subject: [PATCH] Move away from Opt.auto in various places --- .../src/Cardano/CLI/EraBased/Options/Governance/Actions.hs | 4 ++-- cardano-cli/src/Cardano/CLI/EraBased/Options/Node.hs | 2 +- cardano-cli/src/Cardano/CLI/Options/Ping.hs | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs index 7ee4982d5e..5b949e641b 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs @@ -407,7 +407,7 @@ pNewProtVer = (,) <$> pProtMajor <*> pProtMinor where pProtMajor :: Parser Natural pProtMajor = - Opt.option Opt.auto $ + Opt.option integralReader $ mconcat [ Opt.long "protocol-major-version" , Opt.metavar "MAJOR" @@ -420,7 +420,7 @@ pNewProtVer = (,) <$> pProtMajor <*> pProtMinor pProtMinor :: Parser Natural pProtMinor = - Opt.option Opt.auto $ + Opt.option integralReader $ mconcat [ Opt.long "protocol-minor-version" , Opt.metavar "MINOR" diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Node.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Node.hs index 26d87265fd..ceaf247a20 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Node.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Node.hs @@ -115,7 +115,7 @@ pNewCounter = pCounterValue :: Parser Word pCounterValue = - Opt.option Opt.auto $ + Opt.option integralReader $ mconcat [ Opt.long "counter-value" , Opt.metavar "INT" diff --git a/cardano-cli/src/Cardano/CLI/Options/Ping.hs b/cardano-cli/src/Cardano/CLI/Options/Ping.hs index 55ff5ef1a4..f07570b136 100644 --- a/cardano-cli/src/Cardano/CLI/Options/Ping.hs +++ b/cardano-cli/src/Cardano/CLI/Options/Ping.hs @@ -8,6 +8,7 @@ module Cardano.CLI.Options.Ping where import Cardano.CLI.Commands.Ping +import Cardano.CLI.EraBased.Options.Common (integralReader) import qualified Cardano.Network.Ping as CNP import Control.Applicative ((<|>)) @@ -55,7 +56,7 @@ pEndPoint = fmap HostEndPoint pHost <|> fmap UnixSockEndPoint pUnixSocket pPing :: Opt.Parser PingCmd pPing = PingCmd - <$> ( Opt.option Opt.auto $ + <$> ( Opt.option integralReader $ mconcat [ Opt.long "count" , Opt.short 'c' @@ -78,7 +79,7 @@ pPing = , Opt.value "3001" ] ) - <*> ( Opt.option Opt.auto $ + <*> ( Opt.option integralReader $ mconcat [ Opt.long "magic" , Opt.short 'm'