Skip to content

Commit

Permalink
Create openqa-cli-bash-completion package
Browse files Browse the repository at this point in the history
Provide openqa-cli bash completion for openqa-cli as a package when openQA is
install and bash is used.

Signed-off-by: Ioannis Bonatakis <[email protected]>
  • Loading branch information
b10n1k committed Nov 26, 2024
1 parent 25d3376 commit e511759
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions dist/rpm/openQA.spec
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,21 @@ Use this package to install munin scripts that allow to monitor some openQA
statistics.
%endif

%package client-bash-completion
Summary: Bash Completion for %{name}
Requires: bash-completion
Supplements: (%{name}-client and bash)

%description client-bash-completion
The official bash completion script for openqa-cli.


%package client-zsh-completion
Summary: Zsh Completion for %{name}
Supplements: (%{name}-client and zsh)

%description client-zsh-completion
The official zsh completion script for openqa-cli.

%prep
%setup -q
Expand Down Expand Up @@ -419,6 +434,8 @@ done
#
install -D -m 644 /dev/null %{buildroot}%{_localstatedir}/log/openqa
install -m 0644 %{_sourcedir}/openQA.changes %{buildroot}%{_datadir}/openqa/public/Changelog
install -Dm 0644 %{_sourcedir}/completion/openqa-cli-completion.bash %{buildroot}%{_datadir}/bash-completion/completions/openqa-cli
install -Dm 0644 %{_sourcedir}/completion/openqa-cli-completion.zsh %{buildroot}%{_datadir}/usr/share/zsh/site-functions/_openqa-cli
#
mkdir %{buildroot}%{_localstatedir}/lib/openqa/pool/1
mkdir %{buildroot}%{_localstatedir}/lib/openqa/cache
Expand Down Expand Up @@ -819,4 +836,10 @@ fi
%config(noreplace) %{_sysconfdir}/munin/plugin-conf.d/openqa-minion
%endif

%files client-bash-completion
%{_datadir}/bash-completion/completions/openqa-cli/openqa-cli-completion.bash

%files client-zsh-completion
%{_datadir}/zsh/site-functions/_openqa-cli/openqa-cli-completion.zsh

%changelog
10 changes: 3 additions & 7 deletions docs/UsersGuide.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -963,13 +963,9 @@ without needing to install openQA itself. Call `openqa-cli --help` for help.
The sub-commands provide further help, e.g. `openqa-cli api --help` contains
a lot of examples.

`openqa-cli` supports auto completion for `bash` and `zsh`.
If you use `bash` run or add the line below on your `.bashrc` profile.

[source,sh]
----
source openqa-cli-completion.bash
----
`openqa-cli` supports auto completion for `bash` and `zsh`. We distribute two
packages `openQA-client-bash-completion` and `openQA-client-zsh-completion` as
part of openQA-client.

This section focuses on particular API use-cases. Checkout the
<<Client.asciidoc#client,openQA client>> section for further information about
Expand Down

0 comments on commit e511759

Please sign in to comment.