bin/lightning-complete in cldwalker-lightning-0.1.1 vs bin/lightning-complete in cldwalker-lightning-0.1.2
- old
+ new
@@ -1,7 +1,13 @@
#!/usr/bin/env ruby
-require File.expand_path(File.dirname(__FILE__) + "/../lib/lightning")
+# == Description
+# Used to complete a lightning command
+require File.expand_path(File.join(File.dirname(__FILE__), "..","lib","lightning"))
-key = ARGV.shift or raise "Path key needs to be specified"
-puts Lightning::Completion.complete(ENV["COMP_LINE"], key)
-exit 0
+if (command = ARGV.shift)
+ puts Lightning.complete(command, ENV["COMP_LINE"])
+ exit 0
+else
+ puts "No command given"
+ exit 1
+end