Method: MDHost::CLI#initialize

Defined in:
lib/mdhost.rb

#initializeCLI

Returns a new instance of CLI.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/mdhost.rb', line 10

def initialize
  @options = Optimist.options do
    version "mdhost #{File.read(File.expand_path('../VERSION', __dir__)).strip}"

    banner "      \#{version}\n\n      Usage:\n        mdhost INPUT\n        mdhost --format FORMAT_STRING INPUTS...\n\n      Given a format string, inputs will be formatted to the location of\n      the sequence \#{FORMAT_SPECIFIER}\n\n      Options:\n    BANNER\n\n    opt :execute, \"Execute the input using `eshost -x`\", short: :x\n    opt :format, \"Format string to compose multiple inputs into\", type: :string\n    opt :table_format, 'Format string to use for the table \"Input\" column', type: :string\n\n    opt :browser_names, \"Use browser names in output table\"\n\n    educate_on_error\n  end\n\n  if ARGV.empty?\n    Optimist.educate\n  end\nend\n"