Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

oci-cli: install shell completion #292467

Merged
merged 1 commit into from Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions pkgs/tools/admin/oci-cli/default.nix
Expand Up @@ -2,6 +2,7 @@
, fetchFromGitHub
, fetchPypi
, python3
, installShellFiles
}:

let
Expand Down Expand Up @@ -46,6 +47,8 @@ buildPythonApplication rec {
hash = "sha256-yooEZuSIw2EMJVyT/Z/x4hJi8a1F674CtsMMGkMAYLg=";
};

nativeBuildInputs = [ installShellFiles ];

propagatedBuildInputs = [
arrow
certifi
Expand Down Expand Up @@ -73,6 +76,24 @@ buildPythonApplication rec {
--replace "oci==2.78.0" "oci"
'';

postInstall = ''
cat >oci.zsh <<EOF
#compdef oci
SuperSandro2000 marked this conversation as resolved.
Show resolved Hide resolved
zmodload -i zsh/parameter
autoload -U +X bashcompinit && bashcompinit
if ! (( $+functions[compdef] )) ; then
autoload -U +X compinit && compinit
fi

EOF
cat src/oci_cli/bin/oci_autocomplete.sh >>oci.zsh

installShellCompletion \
--cmd oci \
--bash src/oci_cli/bin/oci_autocomplete.sh \
--zsh oci.zsh
'';

# https://github.com/oracle/oci-cli/issues/187
doCheck = false;

Expand Down