Ben Chuanlong Du's Blog

It is never too late to learn.

Tips on Bash Completion

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Installation

Ubuntu / Debian

wajig install bash-completion

macOS

brew install bash-completion

Develop Bash Completion

Auto Generate Bash Completion Scripts

  1. The cobra library in GoLang supports auto genrating shell (bash, fish, zsh and PowerShell) completion scripts.

  2. The Python library argcomplete provides easy, extensible command line tab completion of arguments for your Python application. It makes two assumptions:

  3. You're using bash or zsh as your shell.
  4. You're using argparse to manage your command line arguments/options.

  5. The Ruby library (and also command-line tool) completely lets you generate bash completion scripts from simple YAML configuration.

Comments