fix: use proper zsh/bash completion methods and correct zsh install instructions
Use GenZshCompletion (native zsh) instead of the old bash-wrapper method. Use GenBashCompletionV2 for modern bash completions. Fix help text to show proper fpath-based zsh installation instead of `source`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -20,9 +20,16 @@ Bash:
|
|||||||
$ echo 'source <(opal completion bash)' >> ~/.bashrc
|
$ echo 'source <(opal completion bash)' >> ~/.bashrc
|
||||||
|
|
||||||
Zsh:
|
Zsh:
|
||||||
$ source <(opal completion zsh)
|
# Option 1: Write to a directory in your $fpath
|
||||||
# To load on startup, add to ~/.zshrc:
|
$ opal completion zsh > "${fpath[1]}/_opal"
|
||||||
$ echo 'source <(opal completion zsh)' >> ~/.zshrc
|
# Then restart your shell or run: compinit
|
||||||
|
|
||||||
|
# Option 2: Write to a custom directory and add it to fpath
|
||||||
|
$ mkdir -p ~/.zsh/completions
|
||||||
|
$ opal completion zsh > ~/.zsh/completions/_opal
|
||||||
|
# Add to ~/.zshrc (before compinit):
|
||||||
|
# fpath=(~/.zsh/completions $fpath)
|
||||||
|
# autoload -Uz compinit && compinit
|
||||||
|
|
||||||
Fish:
|
Fish:
|
||||||
$ opal completion fish | source
|
$ opal completion fish | source
|
||||||
@@ -33,7 +40,7 @@ Fish:
|
|||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
switch args[0] {
|
switch args[0] {
|
||||||
case "bash":
|
case "bash":
|
||||||
rootCmd.GenBashCompletion(os.Stdout)
|
rootCmd.GenBashCompletionV2(os.Stdout, true)
|
||||||
case "zsh":
|
case "zsh":
|
||||||
rootCmd.GenZshCompletion(os.Stdout)
|
rootCmd.GenZshCompletion(os.Stdout)
|
||||||
case "fish":
|
case "fish":
|
||||||
|
|||||||
Reference in New Issue
Block a user