summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorZack Hobson2014-01-26 09:57:08 -0800
committerZack Hobson2014-01-26 09:57:08 -0800
commit8c39b363ca5fc3f38772ad579f1145a72a97a1b4 (patch)
tree31c123bc8c649ace1f52bc6cb020fdd6ba87407d /lib
parent5498488f77446fd79bea7b43f24f6b4c20d507ef (diff)
downloadhcl-8c39b363ca5fc3f38772ad579f1145a72a97a1b4.tar.bz2
deprecate completion command, closes #51
Diffstat (limited to 'lib')
-rw-r--r--lib/hcl/app.rb4
-rw-r--r--lib/hcl/commands.rb3
-rw-r--r--lib/hcl/version.rb2
3 files changed, 8 insertions, 1 deletions
diff --git a/lib/hcl/app.rb b/lib/hcl/app.rb
index 1ddc805..044b83d 100644
--- a/lib/hcl/app.rb
+++ b/lib/hcl/app.rb
@@ -11,6 +11,7 @@ module HCl
HCL_DIR = (ENV['HCL_DIR'] || "#{ENV['HOME']}/.hcl").freeze
SETTINGS_FILE = "#{HCL_DIR}/settings.yml".freeze
+ ALIAS_LIST = "#{HCL_DIR}/aliases".freeze
CONFIG_FILE = "#{HCL_DIR}/config.yml".freeze
attr_reader :http
@@ -187,6 +188,9 @@ EOM
end
def write_settings
+ File.open(ALIAS_LIST, 'w') do |f|
+ f.write aliases.join(' ')
+ end
File.open(SETTINGS_FILE, 'w') do |f|
f.write @settings.to_yaml
end
diff --git a/lib/hcl/commands.rb b/lib/hcl/commands.rb
index 784f343..c753fbf 100644
--- a/lib/hcl/commands.rb
+++ b/lib/hcl/commands.rb
@@ -79,6 +79,9 @@ module HCl
def completion command=nil
command ||= $PROGRAM_NAME.split('/').last
+ $stderr.puts \
+ "The hcl completion command is deprecated (and slow!), instead use something like:",
+ "> complete -W `cat #{HCl::App::ALIAS_LIST}` #{command}"
%[complete -W "#{aliases.join ' '}" #{command}]
end
diff --git a/lib/hcl/version.rb b/lib/hcl/version.rb
index ee35062..f62a0b6 100644
--- a/lib/hcl/version.rb
+++ b/lib/hcl/version.rb
@@ -1,3 +1,3 @@
module HCl
- VERSION = '0.4.11'
+ VERSION = '0.4.12'
end