lol

oci-cli: install shell completion

+21
+21
pkgs/tools/admin/oci-cli/default.nix
··· 2 , fetchFromGitHub 3 , fetchPypi 4 , python3 5 }: 6 7 let ··· 46 hash = "sha256-yooEZuSIw2EMJVyT/Z/x4hJi8a1F674CtsMMGkMAYLg="; 47 }; 48 49 propagatedBuildInputs = [ 50 arrow 51 certifi ··· 71 --replace "prompt-toolkit==3.0.29" "prompt-toolkit" \ 72 --replace "terminaltables==3.1.0" "terminaltables" \ 73 --replace "oci==2.78.0" "oci" 74 ''; 75 76 # https://github.com/oracle/oci-cli/issues/187
··· 2 , fetchFromGitHub 3 , fetchPypi 4 , python3 5 + , installShellFiles 6 }: 7 8 let ··· 47 hash = "sha256-yooEZuSIw2EMJVyT/Z/x4hJi8a1F674CtsMMGkMAYLg="; 48 }; 49 50 + nativeBuildInputs = [ installShellFiles ]; 51 + 52 propagatedBuildInputs = [ 53 arrow 54 certifi ··· 74 --replace "prompt-toolkit==3.0.29" "prompt-toolkit" \ 75 --replace "terminaltables==3.1.0" "terminaltables" \ 76 --replace "oci==2.78.0" "oci" 77 + ''; 78 + 79 + postInstall = '' 80 + cat >oci.zsh <<EOF 81 + #compdef oci 82 + zmodload -i zsh/parameter 83 + autoload -U +X bashcompinit && bashcompinit 84 + if ! (( $+functions[compdef] )) ; then 85 + autoload -U +X compinit && compinit 86 + fi 87 + 88 + EOF 89 + cat src/oci_cli/bin/oci_autocomplete.sh >>oci.zsh 90 + 91 + installShellCompletion \ 92 + --cmd oci \ 93 + --bash src/oci_cli/bin/oci_autocomplete.sh \ 94 + --zsh oci.zsh 95 ''; 96 97 # https://github.com/oracle/oci-cli/issues/187