Skip to content

Incredibly basic bash completion for Perl's magnificent Carton

License

Notifications You must be signed in to change notification settings

jonasbn/bash_completion_carton

Repository files navigation

Carton Bash Completion

Incredibly basic bash completion for Perl's carton.

License: MIT

Usage

$ carton <tab>
bundle exec     help     install

See carton for more information on the different commands available to carton, can also be retrieved via carton help.

install offers additional completions.

$ carton install <tab>
--cached      --deployment

Download

$ curl https://raw.githubusercontent.com/jonasbn/bash_completion_carton/master/carton > carton

Installation

Where your completions are located might vary.

Personal

If you want to install them for your personal use, do the following.

Create the file: ~/.bash_completion, containing the code below:

for bcfile in ~/.bash_completion.d/* ; do
  . $bcfile
done

Ref: ServerFault.com: Standard place for user defined bash_completion.d scripts?

Create a directiory for your completions:

$ mkdir ~/.bash_completion.d

Copy your completions into the newly created directory:

$ cp carton ~/.bash_completion.d/

Start a new shell and you should be good to go.

System-wide example from Debian

Based on an introduction to bash completions on Debian.

$ sudo cp carton /etc/bash_completion.d/

System-wide example from OSX

This assumes you are using Homebrew

Do note that paths vary based on whether you are using bash 3 or 4

bash 3 (Formula: bash-completions):

$ cp carton /usr/local/etc/bash_completion.d/

And to activate right away:

$ source  /usr/local/etc/bash_completion.d/carton

bash 4 (Formula: bash-completions2)

$ cp carton /usr/local/share/bash-completion/completions/

And to activate right away:

$ source /usr/local/share/bash-completion/completions/carton

Motivation

carton is an important tool in my toolchain, so I wanted to have easy access to all the options available.

See Also

A more elaborate piece of documentation on bash completions is available from The Linux Documentation Project in the Advanced Bash-Scripting Guide.

From the GNU Documentation.

Good two-part article, "An Introduction to Bash Completion": Part 1 and Part 2.

Please note that this experimental implementation has only been tested with bash version 3.

The most comprehensive collection of bash completions I have come across is the one from the Debian Linux distribution. It is also the one offered for OSX via Homebrew.

License

This is made available under the MIT license, see separate license file.

Copyright

©️ jonasbn 2016-2017

About

Incredibly basic bash completion for Perl's magnificent Carton

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages