Skip to content

Commit

Permalink
Added bash completion script for enhanced gibo joy
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Whitaker committed May 4, 2012
1 parent eae40ba commit bf03194
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ For additional usage instructions, run `gibo` without arguments.

Copy or symlink `gibo` into your $PATH. Done.

## Bash tab completion

Bash users can enjoy the deluxe gibo experience by enabling tab
completion of available boilerplate names.

Copy `gibo-completion.bash` into a `bash_completion.d` folder:

* `/etc/bash_completion.d`
* `/usr/local/etc/bash_completion.d`
* `~/bash_completion.d`

or copy it somewhere (e.g. ~/.gibo-completion.sh) and put the
following in your .bashrc:

source ~/.gibo-completion.sh

## Credits

gibo was written by Simon Whitaker ([@s1mn](http://twitter.com/s1mn))
58 changes: 58 additions & 0 deletions gibo-completion.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!bash
#
# Bash completion for gibo
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# For more information, please refer to <http://unlicense.org/>
#
# INSTALLATION
#
# First install gibo from
# https://github.com/simonwhitaker/gitignore-boilerplates
#
# Then copy this file into a bash_completion.d folder:
#
# /etc/bash_completion.d
# /usr/local/etc/bash_completion.d
# ~/bash_completion.d
#
# or copy it somewhere (e.g. ~/.gibo-completion.sh) and put the
# following in your .bashrc:
#
# source ~/.gibo-completion.sh
#
# CREDITS
#
# Written by Simon Whitaker <simon@goosoftware.co.uk>

_gibo()
{
local cur opts
opts=$( find $HOME/.gitignore-boilerplates -name "*.gitignore" -exec basename \{\} .gitignore \; )
cur="${COMP_WORDS[COMP_CWORD]}"

COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
}
complete -F _gibo gibo

0 comments on commit bf03194

Please sign in to comment.