Skip to content

Commit

Permalink
oci-cli: install shell completion
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbrunet committed Mar 16, 2024
1 parent 07d0a01 commit cb80a71
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkgs/tools/admin/oci-cli/default.nix
Original file line number Diff line number Diff line change
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
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

0 comments on commit cb80a71

Please sign in to comment.