Skip to content

Provide pregenerated completion scripts in RPM and DEB packages #7281

Closed

Description

@Xerkus

Describe the feature or problem you’d like to solve

RPM and DEB packages created as part of the release process do not generate shell completion scripts. Those scripts need to be manually generated by the user after installation or update.

Proposed solution

Pre-generate completion scripts and package them to be deployed in respective completion locations for common shells.

Bash: /usr/share/bash-completion/completions/gh
Fish: /usr/share/fish/vendor_completions.d/gh.fish
Zsh: /usr/share/zsh/site-functions/_gh

Additional context

It is the behavior of RPMs generated by fedora repos:
https://src.fedoraproject.org/rpms/gh/blob/f37/f/gh.spec#_68

# Generate shell completions
%{gobuilddir}/bin/%{name} completion -s bash > %{name}.bash
%{gobuilddir}/bin/%{name} completion -s fish > %{name}.fish
%{gobuilddir}/bin/%{name} completion -s zsh  > %{name}.zsh

# Install shell completions
install -Dpm 0644 %{name}.bash %{buildroot}%{_datadir}/bash-completion/completions/%{name}
install -Dpm 0644 %{name}.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/%{name}.fish
install -Dpm 0644 %{name}.zsh  %{buildroot}%{_datadir}/zsh/site-functions/_%{name}

Activity

  1. vilmibm commented on Apr 7, 2023

    @vilmibm
    Contributor

    seems like a sensible enhancement to me

  2. added and removed on Apr 7, 2023
  3. ghost assigned on Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementa request to improve CLIhelp wantedContributions welcome

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions