lib/bbiff/executable.rb in bbiff-0.4.1 vs lib/bbiff/executable.rb in bbiff-0.4.2

- old
+ new

@@ -153,35 +153,47 @@ STDERR.print "Error: " STDERR.puts e.message STDERR.puts e.backtrace if $DEBUG STDERR.puts "#{RETRY_INTERVAL_SECONDS}秒後にリトライ" sleep RETRY_INTERVAL_SECONDS - thread = Bbs::create_thread(@settings.current['thread_url']) - start_polling(thread, start_no) + retry end + COPYRIGHT = "Copyright © 2016-2020 Yoteichi" + def usage STDERR.puts "Usage: bbiff [OPTIONS] [http://jbbs.shitaraba.net/bbs/read.cgi/CATEGORY/BOARD_ID/THREAD_ID/] [START_NUMBER]" STDERR.puts <<"EOD" Bbiff version #{Bbiff::VERSION} -Copyright © 2016-2019 Yoteichi +#{COPYRIGHT} -h, --help + -v, --version --no-render --debug --long-polling (for Genkai) --delay-seconds=N EOD end + def version + STDERR.puts <<"EOD" +Bbiff version #{Bbiff::VERSION} +#{COPYRIGHT} +EOD + end + def main args = [] ARGV.each do |arg| case arg when '-h', '--help' raise UsageError + when '-v', '--version' + version + exit 0 when '--no-render' @settings.current['no_render'] = true when '--debug' $DEBUG = true when '--long-polling'