summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorZack Hobson2013-11-20 08:34:37 -0800
committerZack Hobson2013-11-20 08:34:37 -0800
commit9b962a50218cac283c9b8075d238b391f6555fad (patch)
tree04db51bdb3502e976dcacfda381395368e6fc6bd /lib
parentb35ffaad3a9b75e275464aa3c1a2fd4434673125 (diff)
downloadhcl-9b962a50218cac283c9b8075d238b391f6555fad.tar.bz2
completion: output a bash completion script
Diffstat (limited to 'lib')
-rw-r--r--lib/hcl/commands.rb4
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