lib/ehbrs/runner.rb in ehbrs-tools-0.13.0 vs lib/ehbrs/runner.rb in ehbrs-tools-0.13.1

- old
+ new

@@ -1,27 +1,23 @@ # frozen_string_literal: true +require 'eac_cli/default_runner' require 'eac_ruby_utils/core_ext' require 'eac_ruby_utils/console/docopt_runner' require 'ehbrs/tools/version' module Ehbrs class Runner < ::EacRubyUtils::Console::DocoptRunner require_sub __FILE__ - enable_console_speaker + include ::EacCli::DefaultRunner - DOC = <<~DOCOPT - Tools for EHB/RS. - - Usage: - __PROGRAM__ [options] __SUBCOMMANDS__ - __PROGRAM__ --version - __PROGRAM__ -h | --help - - Options: - -h --help Show this screen. - -V --version Show version. - DOCOPT + runner_definition do + desc 'Tools for EHB/RS.' + subcommands + alt do + bool_opt '-V', '--version', 'Show version.' + end + end def run if options.fetch('--version') out(::Ehbrs::Tools::VERSION + "\n") else