diff options
| author | Zack Hobson | 2013-11-20 08:34:37 -0800 |
|---|---|---|
| committer | Zack Hobson | 2013-11-20 08:34:37 -0800 |
| commit | 9b962a50218cac283c9b8075d238b391f6555fad (patch) | |
| tree | 04db51bdb3502e976dcacfda381395368e6fc6bd /lib | |
| parent | b35ffaad3a9b75e275464aa3c1a2fd4434673125 (diff) | |
| download | hcl-9b962a50218cac283c9b8075d238b391f6555fad.tar.bz2 | |
completion: output a bash completion script
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/hcl/commands.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/hcl/commands.rb b/lib/hcl/commands.rb index 250ec0e..254138e 100644 --- a/lib/hcl/commands.rb +++ b/lib/hcl/commands.rb @@ -62,6 +62,10 @@ module HCl end end + def completion + %[complete -W "#{aliases.join ' '}" hcl] + end + def aliases @settings.keys.select { |s| s =~ /^task\./ }.map { |s| "@"+s.slice(5..-1) } end |
