Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organise hash and ping commands #1048

Merged
merged 4 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions cardano-cli/test/cardano-cli-golden/Test/Golden/Help.hs
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,18 @@ hprop_golden_HelpCmds =
[ "help"
]

let lines = Text.lines $ Text.pack help
let usages = List.filter (not . null) $ fmap extractCmd $ maybeToList . selectCmd =<< lines
let lines = Text.lines (Text.pack help)
let usages = [] : List.filter (not . null) (fmap extractCmd $ maybeToList . selectCmd =<< lines)

forM_ usages $ \usage -> do
H.noteShow_ usage
let expectedCmdHelpFp =
"test/cardano-cli-golden/files/golden/help" </> Text.unpack (Text.intercalate "_" usage) <> ".cli"
"test/cardano-cli-golden/files/golden" </> subPath usage

cmdHelp <- filterAnsi . third <$> H.execDetailCardanoCLI (fmap Text.unpack usage)

H.diffVsGoldenFile cmdHelp expectedCmdHelpFp
where
subPath :: [Text] -> FilePath
palas marked this conversation as resolved.
Show resolved Hide resolved
subPath [] = "base_help.cli"
subPath usage = "help" </> Text.unpack (Text.intercalate "_" usage) <> ".cli"
67 changes: 67 additions & 0 deletions cardano-cli/test/cardano-cli-golden/files/golden/base_help.cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
cardano-cli - General purpose command-line utility to interact with
cardano-node. Provides specific commands to manage keys, addresses, build &
submit transactions, certificates, etc.

Usage: cardano-cli
( address
| key
| node
| hash
| query
| legacy
| byron
| shelley
| allegra
| mary
| alonzo
| babbage
| conway
| latest
| debug commands
| version
| compatible
)

Available options:
--version Show the cardano-cli version
-h,--help Show this help text

Available commands:
address Payment address commands.
key Key utility commands.
node Node operation commands.
hash Compute the hash to pass to the various --*-hash
arguments of commands.
query Node query commands. Will query the local node whose
Unix domain socket is obtained from the
CARDANO_NODE_SOCKET_PATH environment variable.
legacy Legacy commands

Byron specific commands
byron Byron specific commands

Available commands:
shelley Shelley era commands - DEPRECATED - will be removed
in the future
allegra Allegra era commands - DEPRECATED - will be removed
in the future
mary Mary era commands - DEPRECATED - will be removed in
the future
alonzo Alonzo era commands - DEPRECATED - will be removed in
the future
babbage Babbage era commands - DEPRECATED - will be removed
in the future
conway Conway era commands
latest Latest era commands (Conway)

debug commands
debug Debug commands

Miscellaneous commands
help Show all help
version Show the cardano-cli version
ping Ping a cardano node either using node-to-node or node-to-client protocol. It negotiates a handshake and keeps sending keep alive messages.

Available commands:
compatible Limited backward compatible commands for testing
only.
Loading