Sha256: 1be23c750eac980ef1188da6a56708a7185b92c4ce1f0e7d61c5e6a8a8bc25df

Contents?: true

Size: 860 Bytes

Versions: 1

Compression:

Stored size: 860 Bytes

Contents

#!/usr/bin/env ruby
# -*- ruby -*-

require 'optparse'

$:.unshift "lib"
require 'helpline/helpline'
require 'helpline/update'
require 'helpline/generate'
require 'helpline/run'

# アップデート
#   % helpline -u
# データを指定してアップデート
#   % helpline -u HelpLine /Users/masui/ScrapboxData/masui-HelpLine.json
# テスト
#   % helpline -t args
#

helpline = HelpLine.new

options = ARGV.getopts('utds:','update','test','source:','debug')

#
# update
#
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(' ')} "
  exit
end

debug = options['d'] || options['debug']
query = " #{ARGV.join(' ').sub(/\[/,'').sub(/\]/,'')} "
helpline.run query, debug

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
helpline-0.2.1 exe/helpline