Skip to content

CLI: Improve display of core API in --help - #6549

Merged
gerhard merged 6 commits into
dagger:mainfrom
helderco:helder/oss-22-cli-improve-display-of-core-api-in-help-and-dagger-functions
Feb 1, 2024
Merged

gerhard merged 6 commits into
dagger:mainfrom
helderco:helder/oss-22-cli-improve-display-of-core-api-in-help-and-dagger-functions

Conversation

@helderco

@helderco helderco commented Feb 1, 2024 •

Copy link
Copy Markdown
Contributor

Fixes #6358

Putting individual improvements in separate commits.

Notice in the example below that if we follow #6516 and keep the first line of API descriptions up to 50 chars, that'll be short of the end of the line below "EXPERIMENTAL". Meaning that it won't wrap on this screen size.

Todo

Not all of these are focused on the core API, most impactful is the wrapping on flags and commands. I’m submitting what I have now to be cut in next release but will continue in a separate PR for general --help improvements.

  • Group commands in dagger root (modules, execution, cloud, additional)
  • Group function commands in dagger call
  • Wrapping on flag usages
  • Wrapping on available command descriptions
  • Only use first line of a function’s description for cmd.Short
  • Move flags before sub commands
  • API: convention for short and long descriptions #6516
  • Conventionalize on <command> syntax instead of COMMAND in cmd.Use
  • Global flags only on root command and top level commands
    • Traverse children
    • Remove persistent flags from child commands after being parsed
      • TUI (--silent, --focus)
      • Modules (-m)
  • Add line break between error and usage
  • Style headings in BOLD UPPERCASE to help break sections visually
  • Help topics for dagger call to keep --help lean while still providing more documentation

Example

Taking an example of a function returning a dagger.Container which has a lot of functions.

@helderco helderco added this to the v0.9.8 milestone Feb 1, 2024
@helderco
helderco requested review from jedevc and sipsma February 1, 2024 11:59
@helderco
helderco force-pushed the helder/oss-22-cli-improve-display-of-core-api-in-help-and-dagger-functions branch from 2e79d6d to a8ae912 Compare February 1, 2024 12:00

@gerhard gerhard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can see that there are a bunch of open items left.

Are we OK to merge this and do a follow-up?

@helderco

helderco commented Feb 1, 2024

Copy link
Copy Markdown
Contributor Author

Yes, ok to merge. As I say in the description there’ll be a more generic follow up, not focused on core types in dagger call.

@gerhard
gerhard merged commit 7c0ee45 into dagger:main Feb 1, 2024
@helderco
helderco deleted the helder/oss-22-cli-improve-display-of-core-api-in-help-and-dagger-functions branch February 1, 2024 16:08
@helderco helderco mentioned this pull request Mar 26, 2024
12 tasks done
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.

CLI: improve display of core API in --help output

3 participants