Skip to content

Provide pregenerated completion scripts in RPM and DEB packages #7281

@Xerkus

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}

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