oracle / yo

A fast and simple command line OCI client
Universal Permissive License v1.0
63 stars 6 forks source link

Add contrib/yo.zsh #29

Closed rpigott closed 1 month ago

rpigott commented 1 month ago

This adds an alternative zsh completion definition for yo that includes tags, descriptions, and argument groups, beyond the bash-style argument listings and explanations offered by the python argcomplete provided completions.

Because they are not the default, for now the user would need to install them as any other supplementary completion definition by including this file in their $fpath with the filename "_yo" and re-running compinit.

jq is used to parse the yo cache files when it is installed. Otherwise, argument listings for some words (isntances, shapes, etc.) are not available.

oracle-contributor-agreement[bot] commented 1 month ago

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA). The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

rpigott commented 1 month ago

Note to reviewer: if you aren't familiar, you can try these out as follows:

$ zsh
$ fpath=(~/.local/share/zsh/completions $fpath)
$ cp contrib/yo.zsh ~/.local/share/zsh/completions/_yo
$ autoload -Uz compinit && compinit
$ yo <TAB>
[...]

And to try with some configurations:

$ zmodload zsh/complist
$ zstyle ':completion:*' menu select
$ zstyle ':completion:*' group-name ''
$ zstyle ':completion:*:descriptions' format 'completing: %d'
$ yo <TAB>
$ yo -r <TAB>
$ yo ssh <TAB> <TAB>
$ yo vol attach <TAB> <TAB>

etc.

That flag options are hidden by default if there are normal arguments available to list is a consequence of the default tag-order style in zsh. If you type a - prefix before attempting the flag completions will be offered.

oracle-contributor-agreement[bot] commented 1 month ago

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA). The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

oracle-contributor-agreement[bot] commented 1 month ago

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA). The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.