Skip to content

Commit

Permalink
Improve walletNameArgument help text in CLI
Browse files Browse the repository at this point in the history
- Change metavar to from STRING to WALLET_NAME
- Add help text
  • Loading branch information
Anviking committed Mar 12, 2021
1 parent 1d15f42 commit 5385720
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/cli/src/Cardano/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,8 @@ transactionIdArgument = argumentT $ mempty
-- | <name=STRING>
walletNameArgument :: Parser WalletName
walletNameArgument = argumentT $ mempty
<> metavar "STRING"
<> metavar "WALLET_NAME"
<> help "Name of the wallet."

-- | <public-key=ACCOUNT_PUBLIC_KEY>
accPubKeyArgument :: Parser ApiAccountPublicKey
Expand Down
7 changes: 5 additions & 2 deletions lib/cli/test/unit/Cardano/CLISpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -180,20 +180,22 @@ spec = do
]

["wallet", "create", "from-recovery-phrase", "--help"] `shouldShowUsage`
[ "Usage: wallet create from-recovery-phrase [--port INT] STRING"
[ "Usage: wallet create from-recovery-phrase [--port INT]"
, " WALLET_NAME"
, " [--address-pool-gap INT]"
, " Create a new wallet using a recovery phrase."
, ""
, "Available options:"
, " -h,--help Show this help text"
, " --port INT port used for serving the wallet"
, " API. (default: 8090)"
, " WALLET_NAME Name of the wallet."
, " --address-pool-gap INT number of unused consecutive addresses"
, " to keep track of. (default: 20)"
]

["wallet", "create", "from-public-key", "--help"] `shouldShowUsage`
[ "Usage: wallet create from-public-key [--port INT] STRING"
[ "Usage: wallet create from-public-key [--port INT] WALLET_NAME"
, " [--address-pool-gap INT]"
, " ACCOUNT_PUBLIC_KEY"
, " Create a wallet using a public account key."
Expand All @@ -202,6 +204,7 @@ spec = do
, " -h,--help Show this help text"
, " --port INT port used for serving the wallet"
, " API. (default: 8090)"
, " WALLET_NAME Name of the wallet."
, " --address-pool-gap INT number of unused consecutive addresses"
, " to keep track of. (default: 20)"
, " ACCOUNT_PUBLIC_KEY 64-byte (128-character) hex-encoded"
Expand Down

0 comments on commit 5385720

Please sign in to comment.