Skip to content

Commit

Permalink
Merge #2811
Browse files Browse the repository at this point in the history
2811: Fix the cli parser for the --redeemer-value --execution-units flags r=Jimbo4350 a=dcoutts

The cli parser apparently cannot cope with the same flag name being
reused in different contexts, so fix it by prefix these flags with the
context, so instead of just --redeemer-file or --redeemer-value, it's
--tx-in-redeemer-file or --tx-in-redeemer-value.

Similarly for --mint-redeemer-value --mint-execution-units etc.

Co-authored-by: Duncan Coutts <duncan@well-typed.com>
  • Loading branch information
iohk-bors[bot] and dcoutts authored Jun 10, 2021
2 parents 4655c6a + af10bc0 commit 501d3ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@ pScriptWitnessFiles witctx scriptFlagPrefix scriptFlagPrefixDeprecated help =

pScriptDataFile dataFlagPrefix =
Opt.strOption
( Opt.long (dataFlagPrefix ++ "-file")
( Opt.long (scriptFlagPrefix ++ "-" ++ dataFlagPrefix ++ "-file")
<> Opt.metavar "FILE"
<> Opt.help ("The file containing the script input "
++ dataFlagPrefix ++ ".")
)

pScriptDataValue dataFlagPrefix =
Opt.option readerScriptData
( Opt.long (dataFlagPrefix ++ "-value")
( Opt.long (scriptFlagPrefix ++ "-" ++ dataFlagPrefix ++ "-value")
<> Opt.metavar "JSON"
<> Opt.help ("The value for the script input " ++ dataFlagPrefix ++ ".")
)
Expand All @@ -290,7 +290,7 @@ pScriptWitnessFiles witctx scriptFlagPrefix scriptFlagPrefixDeprecated help =
pExecutionUnits =
uncurry ExecutionUnits <$>
Opt.option Opt.auto
( Opt.long "execution-units"
( Opt.long (scriptFlagPrefix ++ "-execution-units")
<> Opt.metavar "(INT, INT)"
<> Opt.help "The time and space units needed by the script."
)
Expand Down

0 comments on commit 501d3ae

Please sign in to comment.