Skip to content

Group help options into sections in command help#2567

Merged
fnando merged 2 commits intomainfrom
group-options
May 7, 2026
Merged

Group help options into sections in command help#2567
fnando merged 2 commits intomainfrom
group-options

Conversation

@fnando
Copy link
Copy Markdown
Member

@fnando fnando commented May 7, 2026

What

Group --help output into sections using clap's help_heading, so the shared signing, transaction, RPC, and global options no longer mix into the flat Options: list of every command.

The new layout (e.g. stellar tx new payment --help):

  • Options: — the command's primary options
  • RPC Options:--rpc-url, --rpc-header, --network-passphrase, --network
  • Transaction Options:--source-account, --fee, --inclusion-fee, --build-only
  • Global Options:--config-dir, --quiet, --verbose, --no-cache, …
  • Signing Options:--sign-with-key, --hd-path, --sign-with-lab, --sign-with-ledger

This affects ~53 commands at once: all 22 stellar tx new subcommands, all 22 stellar tx operation add subcommands, the 5 stellar contract subcommands (deploy, upload, extend, restore, invoke), stellar contract asset deploy, stellar tx sign, stellar tx simulate, and stellar message sign.

The existing Options (RPC) / Options (Archive) / Options (Global) headings were renamed to RPC Options / Archive Options / Global Options for a consistent style across all sections.

Closes #2454.

Why

Until now, every transaction-building command listed all signing, transaction, source-account, and command-specific options in a single flat Options: block. The 8 shared options effectively buried the 3–7 primary options of each command, making --help hard to scan.

Grouping centrally on config::Args, sign_with::Args, and tx::Args fixes all 53 affected commands with a small edit and no behavioral change.

Known limitations

N/A — purely a --help rendering change. No CLI flags or behavior change.

Copilot AI review requested due to automatic review settings May 7, 2026 18:36
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX May 7, 2026
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX May 7, 2026
@fnando fnando self-assigned this May 7, 2026
@fnando fnando requested review from leighmcculloch and mootz12 May 7, 2026 18:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors CLI --help output to group commonly-flattened flags (RPC, transaction-building, global, signing) into distinct sections via clap’s help_heading, and regenerates the full markdown help docs accordingly.

Changes:

  • Renamed existing help section headings (e.g., Options (RPC)RPC Options) and introduced new headings for Signing Options and Transaction Options.
  • Assigned help_heading to shared signing/transaction args (sign_with::Args, config::Args, tx::Args) so affected commands render grouped help.
  • Regenerated FULL_HELP_DOCS.md from clap-markdown to reflect the new headings/sections.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
FULL_HELP_DOCS.md Regenerated CLI help docs showing the new per-section headings across commands.
cmd/soroban-cli/src/config/sign_with.rs Adds help_heading = HEADING_SIGNING to signing-related flags.
cmd/soroban-cli/src/config/mod.rs Adds help_heading = HEADING_TRANSACTION to tx-related shared config flags.
cmd/soroban-cli/src/commands/tx/args.rs Moves --build-only into the Transaction Options help section.
cmd/soroban-cli/src/commands/mod.rs Renames heading constants and adds new constants for signing/transaction sections.
cmd/soroban-cli/src/commands/message/sign.rs Groups message signing flags under Signing Options.

Comment thread cmd/soroban-cli/src/commands/mod.rs
Copy link
Copy Markdown
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --build-only flag in the following places is technically owned by each individual command at the moment, but I think should be grouped in a separate section. Maybe under Transaction Options.

  • stellar contract extend
  • stellar contract upload
  • stellar contract deploy asset
  • stellar contract invoke
  • stellar contract restore
  • stellar contract deploy wasm

Otherwise, looks good to me.

@fnando fnando enabled auto-merge (squash) May 7, 2026 22:19
@fnando fnando merged commit fb1cd67 into main May 7, 2026
211 checks passed
@fnando fnando deleted the group-options branch May 7, 2026 22:30
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in DevX May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Group --help options into sections for commands with shared signing/transaction options

3 participants