Skip to content

Add contextual help to Yay operations - #2921

Merged
Jguer merged 1 commit into
Jguer:nextfrom
jdholtz:contextual-help
Jul 30, 2026
Merged

Add contextual help to Yay operations#2921
Jguer merged 1 commit into
Jguer:nextfrom
jdholtz:contextual-help

Conversation

@jdholtz

@jdholtz jdholtz commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

This is a proposal to add #2780. I thought this would be a good addition to yay because it's exactly how pacman operates. Happy to discuss this further too.

Instead of yay -<op> --help printing the entire help message, it will now print a contextual help message based on the operation being performed.

The top-level help message shows available operations and global flags as before. It no longer shows operation-specific flags and pacman -S --help output. Like the pacman output, it shows that you can get operation-specific help by running yay -<op> --help.

The operation-specific help message shows the operation's flags and all pacman operation flags pass through to pacman.

Specifying -V and --version now always shows the version rather than having yay -V --help show the help message.

Instead of `yay -<op> --help` printing the entire help message, it will
now print a contextual help message based on the operation being
performed. The top-level help message shows available operations and
global flags as before. It no longer shows operation-specific flags and
`pacman -S --help` output. Like the pacman output, it shows that you can
get operation-specific help by running `yay -<op> --help`.

The operation-specific help message shows the operation's flags and all
pacman operation flags pass through to pacman.
@jdholtz
jdholtz requested a review from Jguer as a code owner July 19, 2026 20:30
@Jguer

Jguer commented Jul 30, 2026

Copy link
Copy Markdown
Owner

I agree @jdholtz , let's merge it.

Questions unanswered for the future:

  • How to ensure this is kept up to date
  • Does pacman support localization of these and should we do the same

@Jguer
Jguer merged commit 19a67d1 into Jguer:next Jul 30, 2026
16 checks passed
@jdholtz
jdholtz deleted the contextual-help branch July 30, 2026 18:17
@jdholtz

jdholtz commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Questions unanswered for the future:

  • How to ensure this is kept up to date
  • Does pacman support localization of these and should we do the same

For keeping up to date, I don't think the process would necessarily because of this PR. The options still need to be updated in this help text, the man page, and the completions. Since that's so many places, I don't see a simple static check being feasible. That'd be a good option for an AI reviewer though.

For localization, yes pacman does support localization. Since we support localization in most (all?) text areas, we should support it for the help message too. I created #2944 to solve that.

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