-
Setup bash completion script, there are two types of auto completion you can choose from.
-
start with an action and followed by options
# actions local action_list=( ... ) # options for each action local option_bool_<action>=( ... ) # on/off option local option_file_<action>=( ... ) # followed by file local option_files_<action>=( ... ) # followed by files local option_argument_<action>=( ... ) # followed by argument local option_arguments_<action>=( ... ) # followed by arguments # arguments for each option # (remove all non-alphanumeric characters from option) local argument_list_<option>=( ... )
-
options only
# options local option_bool=( ... ) # on/off option local option_file=( ... ) # followed by file local option_files=( ... ) # followed by files local option_argument=( ... ) # followed by argument local option_arguments=( ... ) # followed by arguments # arguments for each option # (remove all non-alphanumeric characters from option) local argument_list_<option>=( ... )
-
-
Replace <###> with a unique string. (ex: command name)
-
Install bash completion script.
-
for all users
$ sudo mkdir -p /usr/share/bash-completion/completions $ sudo cp <bash completion script> /usr/share/bash-completion/completions/<command name>
-
for single user
$ mkdir -p ~/.local/share/bash-completion/completions $ cp <bash completion script> ~/.local/share/bash-completion/completions/<command name>
-
-
Notifications
You must be signed in to change notification settings - Fork 0
wups0713/BashCompletion
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
A bash completion template.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published