Skip to content

Improve help presentation and usage#716

Open
ardnew wants to merge 3 commits into
danielpaulus:mainfrom
ardnew:prettier-help-clean
Open

Improve help presentation and usage#716
ardnew wants to merge 3 commits into
danielpaulus:mainfrom
ardnew:prettier-help-clean

Conversation

@ardnew
Copy link
Copy Markdown
Contributor

@ardnew ardnew commented May 8, 2026

I should preface this by stating danielpaulus/go-ios is fantastic. Very reliable with an amazing toolset. Kudos to all contributors.

That being said, the command-line help really is just awful. It is nearly impossible to find syntax for any given subcommand, and the egregiously long lines makes it a nightmare to follow in any terminal.

This sort of tedious work is exactly what I like to burden AI agents with.

The changes include tests against a pair of golden outputs you can quickly review to see how the top-level help and individual subcommand help is formatted.

See the commit message for a description of changes.

- move help handling to an embedded CLI help catalog
- support 'help cmd' and 'cmd --help' for each subcommand
- add internal/clihelp with embedded YAML definitions and renderer
- route help paths through clihelp before docopt parsing in main
- add CLI help coverage (resolver/renderer/loader tests + golden outputs)
- refresh README help section with generated current output and markers
- add `make readme-help` target to regenerate the README help block
- promote gopkg.in/yaml.v3 to a direct dependency in go.mod

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 8, 2026 00:44
Copy link
Copy Markdown

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 replaces the existing docopt-generated CLI help output with a curated, consistently formatted help renderer backed by an embedded YAML catalog, and adds golden tests to lock the output format in place. It also updates the README to present the new help output and adds a Makefile target to regenerate the README help block.

Changes:

  • Add internal/clihelp (embedded help.yaml) to resolve and render global/subcommand help with aligned formatting.
  • Intercept ios, --help/-h, and help <topic> invocations early in main.go to emit the new help output.
  • Add golden tests and fixtures for global and subcommand help; update README and add make readme-help to refresh the README help section.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
main.go Loads the new help catalog and handles help requests before docopt parsing.
internal/clihelp/help.go Implements YAML loading, help-topic resolution, and formatted rendering.
internal/clihelp/help.yaml Defines the canonical help catalog (usage, global options, commands).
internal/clihelp/*_test.go Adds unit tests for catalog loading, resolution, and rendering basics.
main_test.go Adds golden-based integration tests by running the CLI and comparing outputs.
testdata/help/global.golden Golden output for top-level help formatting.
testdata/help/apps.golden Golden output for apps subcommand help formatting.
README.md Replaces prior long help text with a bounded help block containing the new output.
Makefile Adds readme-help target to regenerate the README help block.
go.mod Promotes gopkg.in/yaml.v3 to a direct dependency and normalizes Go version line.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile Outdated
Comment thread internal/clihelp/help.go Outdated
ardnew and others added 2 commits May 8, 2026 10:28
Per Copilot, BSD/macOS `mktemp` requires a template or `-t`.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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