Shell Completions

Shell completions are command line completions for a specific shell, such as Bash, fish or Zsh.

RPM Macros

The following macros MUST be used instead of hardcoding paths.

macro definition

%{bash_completions_dir}

%{_datadir}/bash-completion/completions

%{fish_completions_dir}

%{_datadir}/fish/vendor_completions.d

%{zsh_completions_dir}

%{_datadir}/zsh/site-functions

Shell Completions Packaging

Shell completion files MUST use standard file permissions (0644).

Example of shell completions packaging

Name: foo
...

%install
...

# Bash completion
install -Dpm 0644 foo.bash -t %{buildroot}%{bash_completions_dir}

# Fish completion
install -Dpm 0644 foo.fish -t %{buildroot}%{fish_completions_dir}

# Zsh completion
install -Dpm 0644 _foo -t     %{buildroot}%{zsh_completions_dir}
...

%files
%{bash_completions_dir}/foo.bash
%{fish_completions_dir}/foo.fish
%{zsh_completions_dir}/_foo