Skip to content

Command Line tab complete

vintagepc edited this page Apr 23, 2022 · 1 revision

MK404 has the capability to generate its own auto-completion scripts for the Bash and Zsh shells.

This can be done using the appropriate --complete-bash or --complete-zsh flags. For example, using bash:

./MK404 --complete-bash > MK404_completion.sh

IMPORTANT

Bash completion helpers will execute as shell scripts on your computer! Be sure you are aware of the consequences of running unverified or third-party shell commands, and inspect it thoroughly before trusting it!


You can then either add it to the current shell session with: source ./MK404_completion.sh or install it to your system's completion directory, e.g. /etc/bash_completion.d/

While the (bash) completion helper will generally parse the program's help output for the basic arguments, you will need to regenerate the helper if:

  • using Bash and new arguments that require a value are added, e.g. something that takes a file or one of a set of specified values.
  • using Zsh and new arguments are added.
Clone this wiki locally