Class: Iated::Application
- Inherits:
-
Object
- Object
- Iated::Application
- Defined in:
- lib/iated.rb
Instance Method Summary collapse
-
#initialize ⇒ Application
constructor
:nocov:.
-
#run ⇒ Object
:nocov:.
Constructor Details
#initialize ⇒ Application
:nocov:
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/iated.rb', line 26 def initialize @mcp = nil @optparse = OptionParser.new do |opts| opts. = "Usage: #{opts.program_name} [OPTIONS]" opts.on('-p', '--port PORT', Integer, "The port number to run the server on (default: #{Iated.mcp.prefs.port}).") do |p| Iated.mcp.prefs.port = p end opts.on('-e', '--editor EDITOR', "Set editor (default #{Iated.mcp.prefs.editor}).") do |editor| Iated.mcp.prefs.editor = editor end opts.on('-u', '--ui UI', "Set the UI to be 'gui' or 'text' (default #{Iated.mcp.ui}).") do |ui| Iated.mcp.ui = ui.to_sym end opts.on('-d', '--debug', "Turn on debugging mode.") do Iated.mcp.debug = true end opts.on_tail('-h', '--help', 'Show this help.') do puts opts exit end end end |