Skip to content

Wrap CLI help based on terminal width #1152

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

Merged
merged 1 commit into from
Apr 23, 2025

Conversation

newhoggy
Copy link
Contributor

@newhoggy newhoggy commented Apr 23, 2025

Changelog

- description: |
    Wrap CLI help based on terminal width
# uncomment types applicable to the change:
  type:
  - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

On a wide terminal, the help looks like this:

Usage: cardano-cli submit-tx --socket-path SOCKET_PATH (--mainnet | --testnet-magic NATURAL) --tx FILEPATH

  Submit a raw, signed transaction, in its on-wire representation.

Available options:
  --socket-path SOCKET_PATH
                           Path to the node socket. This overrides the CARDANO_NODE_SOCKET_PATH environment variable. The argument is optional if CARDANO_NODE_SOCKET_PATH is defined and mandatory otherwise.
  --mainnet                Use the mainnet magic id. This overrides the CARDANO_NODE_NETWORK_ID environment variable
  --testnet-magic NATURAL  Specify a testnet magic id. This overrides the CARDANO_NODE_NETWORK_ID environment variable
  --tx FILEPATH            File containing the signed transaction.
  -h,--help                Show this help text

And on a narrow terminal, the same help looks like this:

Usage: cardano-cli submit-tx --socket-path SOCKET_PATH
                               (--mainnet | --testnet-magic NATURAL)
                               --tx FILEPATH

  Submit a raw, signed transaction, in its on-wire representation.

Available options:
  --socket-path SOCKET_PATH
                           Path to the node socket. This overrides the
                           CARDANO_NODE_SOCKET_PATH environment variable. The argument is
                           optional if CARDANO_NODE_SOCKET_PATH is defined and mandatory
                           otherwise.
  --mainnet                Use the mainnet magic id. This overrides the
                           CARDANO_NODE_NETWORK_ID environment variable
  --testnet-magic NATURAL  Specify a testnet magic id. This overrides the
                           CARDANO_NODE_NETWORK_ID environment variable
  --tx FILEPATH            File containing the signed transaction.
  -h,--help                Show this help text

Context

Additional context for the PR goes here. If the PR fixes a particular issue please provide a link to the issue.

How to trust this PR

Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@newhoggy newhoggy added this pull request to the merge queue Apr 23, 2025
Merged via the queue into master with commit 104b6f4 Apr 23, 2025
26 checks passed
@newhoggy newhoggy deleted the newhoggy/resize-based-on-terminal-width branch April 23, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants