exe/helpline in helpline-0.2.1 vs exe/helpline in helpline-0.2.2
- old
+ new
@@ -1,7 +1,10 @@
#!/usr/bin/env ruby
# -*- ruby -*-
+#
+# HelpLineのメインプログラム
+#
require 'optparse'
$:.unshift "lib"
require 'helpline/helpline'
@@ -19,22 +22,22 @@
helpline = HelpLine.new
options = ARGV.getopts('utds:','update','test','source:','debug')
-#
-# update
-#
+debug = options['d'] || options['debug']
+
+# データ更新
if options['u'] || options['update'] # ~/.helpline.json更新
sources = (ARGV.length > 0 ? ARGV : ['HelpLine'])
helpline.update sources
exit
end
+# テスト
if options['t'] || options['test'] # テスト
- puts helpline.generate " #{ARGV.join(' ')} "
+ puts helpline.generate " #{ARGV.join(' ')} ", debug
exit
end
-debug = options['d'] || options['debug']
query = " #{ARGV.join(' ').sub(/\[/,'').sub(/\]/,'')} "
helpline.run query, debug