Sha256: e1e6d0f21d8af6a3fe00e9c5c3808dd2fa92bc945638a304d5037993d489a427

Contents?: true

Size: 474 Bytes

Versions: 8

Compression:

Stored size: 474 Bytes

Contents

require 'optparse'

module CliApp
  class <<self
    def run
      OptionParser.new do |opts|
        opts.banner = "Usage: cli.rb [options]\nCommand line test app."
        
        opts.on( "--option OPTIONIAL", "run with OPTIONIAL") do |option|
          puts option
        end
        
        opts.on_tail("-h", "--help", "show help") do
          puts opts
          #exit NB!
        end      
      end.parse!
    end
  end
end


if $0 == __FILE__
  CliApp.run
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
afurmanov-clicase-0.1.10 test/cli_app.rb
afurmanov-clicase-0.1.11 test/cli_app.rb
afurmanov-clicase-0.1.5 test/cli_app.rb
afurmanov-clicase-0.1.6 test/cli_app.rb
afurmanov-clicase-0.1.7 test/cli_app.rb
afurmanov-clicase-0.1.8 test/cli_app.rb
afurmanov-clicase-0.1.9 test/cli_app.rb
fkocherga-cmd_line_test-0.1.2 test/cli_app.rb