goctl autocomplete

goctl autocomplete only supports unix-like operating systems

Usage

  1. $ goctl completion -h
  2. Name.
  3. goctl autocomplete - generates completion scripts, it only works on unix-like operating systems
  4. Usage.
  5. goctl completion [command options] [arguments...] (command options).
  6. Options.
  7. --name value, -n value filename of the autocomplete script, default is [goctl_autocomplete]

Generate autocomplete file

  1. $ goctl completion
  2. Generate autocomplete successfully!
  3. Execute the following script to set up the shell.
  4. echo PROG=goctl source /Users/keson/.goctl/.auto_complete/zsh/goctl_autocomplete >> ~/.zshrc && source ~/.zshrc
  5. or
  6. echo PROG=goctl source /Users/keson/.goctl/.auto_complete/bash/goctl_autocomplete >> ~/.bashrc && source ~/.bashrc

shell configuration

  • zsh
    1. $ echo PROG=goctl source /Users/keson/.goctl/.auto_complete/zsh/goctl_autocomplete >> ~/.zshrc && source ~/.zshrc
  • bash
    1. $ echo PROG=goctl source /Users/keson/.goctl/.auto_complete/bash/goctl_autocomplete >> ~/.bashrc && source ~/.bashrc

Demo effect

Use the tab key to bring up the autocomplete prompt

  1. $ goctl
  2. api -- generate api-related files
  3. bug -- report a bug
  4. completion -- generates a completion script, which is only available for unix-like operating systems
  5. docker -- generates a Docker file
  6. help h -- displays a list of commands or help information for a command
  7. kube -- generates kubernetes files
  8. migrate -- migrate from tal-tech to zeromicro
  9. model -- Generate model code
  10. rpc -- generate rpc code
  11. template -- Template operations
  12. upgrade -- upgrade goctl to the latest version

Translated with www.DeepL.com/Translator (free version)