Module: Skylab::Face::Command::Nodeish

Included in:
Skylab::Face::Cli, Skylab::Face::Command, Namespace
Defined in:
lib/myterm/vendor/skylab/face/cli.rb

Instance Method Summary collapse

Instance Method Details

#build_empty_option_parserObject



120
121
122
# File 'lib/myterm/vendor/skylab/face/cli.rb', line 120

def build_empty_option_parser
  OptionParser.new
end

#inviteObject



123
124
125
126
# File 'lib/myterm/vendor/skylab/face/cli.rb', line 123

def invite
  @err.puts "Try #{hi("#{invocation_string} -h")} for help."
  nil
end

#invocation_stringObject



127
128
129
# File 'lib/myterm/vendor/skylab/face/cli.rb', line 127

def invocation_string
  "#{@parent.invocation_string} #{name}"
end

#parent=(parent) ⇒ Object



130
131
132
133
# File 'lib/myterm/vendor/skylab/face/cli.rb', line 130

def parent= parent
  @parent and fail("won't overwrite existing parent")
  @parent = parent
end

#usage(msg = nil) ⇒ Object Also known as: empty_argv



134
135
136
137
138
# File 'lib/myterm/vendor/skylab/face/cli.rb', line 134

def usage msg=nil
  msg and @err.puts(msg)
  @err.puts usage_string
  invite
end