Skip to content

Commit 031b7e8

Browse files
committed
Hide experimental --spec-dijkstra parser from help output
1 parent 418d297 commit 031b7e8

File tree

5 files changed

+25
-21
lines changed

5 files changed

+25
-21
lines changed

cardano-cli/src/Cardano/CLI/EraBased/Common/Option.hs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,25 @@ bounded t = Opt.eitherReader $ \s -> do
8686
when (i > fromIntegral (maxBound @a)) $ Left $ t <> " must not greater than " <> show (maxBound @a)
8787
pure (fromIntegral i)
8888

89-
parseFilePath :: String -> String -> Parser FilePath
90-
parseFilePath optname desc =
89+
parseFilePathWithMod
90+
:: String
91+
-- ^ option name
92+
-> String
93+
-- ^ description
94+
-> Mod OptionFields FilePath
95+
-> Parser FilePath
96+
parseFilePathWithMod optname desc mod' =
9197
Opt.strOption
92-
( Opt.long optname
93-
<> Opt.metavar "FILEPATH"
94-
<> Opt.help desc
95-
<> Opt.completer (Opt.bashCompleter "file")
96-
)
98+
. mconcat
99+
$ [ Opt.long optname
100+
, Opt.metavar "FILEPATH"
101+
, Opt.help desc
102+
, Opt.completer (Opt.bashCompleter "file")
103+
, mod'
104+
]
105+
106+
parseFilePath :: String -> String -> Parser FilePath
107+
parseFilePath optname desc = parseFilePathWithMod optname desc mempty
97108

98109
pNetworkIdDeprecated :: Parser NetworkId
99110
pNetworkIdDeprecated =

cardano-cli/src/Cardano/CLI/EraBased/Genesis/Option.hs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ pGenesisCreateTestNetData :: forall era. Exp.IsEra era => EnvCli -> Parser (Gene
228228
pGenesisCreateTestNetData envCli =
229229
fmap GenesisCreateTestNetData $
230230
GenesisCreateTestNetDataCmdArgs (convert $ Exp.useEra @era)
231-
<$> optional (pSpecFile "shelley")
232-
<*> optional (pSpecFile "alonzo")
233-
<*> optional (pSpecFile "conway")
234-
<*> optional (pSpecFile "dijkstra")
231+
<$> optional (pSpecFile idm "shelley")
232+
<*> optional (pSpecFile idm "alonzo")
233+
<*> optional (pSpecFile idm "conway")
234+
<*> optional (pSpecFile Opt.internal "dijkstra")
235235
<*> pNumGenesisKeys
236236
<*> pNumPools
237237
<*> pNumStakeDelegs
@@ -246,10 +246,11 @@ pGenesisCreateTestNetData envCli =
246246
<*> pMaybeSystemStart
247247
<*> pOutputDir
248248
where
249-
pSpecFile eraStr =
250-
parseFilePath
249+
pSpecFile mod' eraStr =
250+
parseFilePathWithMod
251251
("spec-" <> eraStr)
252252
("The " <> eraStr <> " specification file to use as input. A default one is generated if omitted.")
253+
mod'
253254
pNumGenesisKeys =
254255
Opt.option integralReader $
255256
mconcat

cardano-cli/test/cardano-cli-golden/files/golden/help.cli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,6 @@ Usage: cardano-cli conway genesis create-staked
12321232
Usage: cardano-cli conway genesis create-testnet-data [--spec-shelley FILEPATH]
12331233
[--spec-alonzo FILEPATH]
12341234
[--spec-conway FILEPATH]
1235-
[--spec-dijkstra FILEPATH]
12361235
[--genesis-keys INT]
12371236
[--pools INT]
12381237
[ --stake-delegators INT
@@ -3530,7 +3529,6 @@ Usage: cardano-cli latest genesis create-staked
35303529
Usage: cardano-cli latest genesis create-testnet-data [--spec-shelley FILEPATH]
35313530
[--spec-alonzo FILEPATH]
35323531
[--spec-conway FILEPATH]
3533-
[--spec-dijkstra FILEPATH]
35343532
[--genesis-keys INT]
35353533
[--pools INT]
35363534
[ --stake-delegators INT

cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_create-testnet-data.cli

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
Usage: cardano-cli conway genesis create-testnet-data [--spec-shelley FILEPATH]
22
[--spec-alonzo FILEPATH]
33
[--spec-conway FILEPATH]
4-
[--spec-dijkstra FILEPATH]
54
[--genesis-keys INT]
65
[--pools INT]
76
[ --stake-delegators INT
@@ -29,8 +28,6 @@ Available options:
2928
default one is generated if omitted.
3029
--spec-conway FILEPATH The conway specification file to use as input. A
3130
default one is generated if omitted.
32-
--spec-dijkstra FILEPATH The dijkstra specification file to use as input. A
33-
default one is generated if omitted.
3431
--genesis-keys INT The number of genesis keys to make (default is 3).
3532
--pools INT The number of stake pool credential sets to make
3633
(default is 0).

cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_create-testnet-data.cli

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
Usage: cardano-cli latest genesis create-testnet-data [--spec-shelley FILEPATH]
22
[--spec-alonzo FILEPATH]
33
[--spec-conway FILEPATH]
4-
[--spec-dijkstra FILEPATH]
54
[--genesis-keys INT]
65
[--pools INT]
76
[ --stake-delegators INT
@@ -29,8 +28,6 @@ Available options:
2928
default one is generated if omitted.
3029
--spec-conway FILEPATH The conway specification file to use as input. A
3130
default one is generated if omitted.
32-
--spec-dijkstra FILEPATH The dijkstra specification file to use as input. A
33-
default one is generated if omitted.
3431
--genesis-keys INT The number of genesis keys to make (default is 3).
3532
--pools INT The number of stake pool credential sets to make
3633
(default is 0).

0 commit comments

Comments
 (0)