Class: Mysh::Console

Inherits:
Object show all
Defined in:
lib/mysh/sources/console.rb

Overview

A wrapper for the mysh console terminal.

Instance Method Summary collapse

Constructor Details

#initializeConsole

Setup the console wrapper.



10
11
12
# File 'lib/mysh/sources/console.rb', line 10

def initialize
  @eoi = false
end

Instance Method Details

#eoi?Boolean

Have we reached the end of input?

Returns:

  • (Boolean)


26
27
28
# File 'lib/mysh/sources/console.rb', line 26

def eoi?
  @eoi
end

#get_commandObject

Get the initial line of command input.



15
16
17
18
# File 'lib/mysh/sources/console.rb', line 15

def get_command
  puts MNV[:pre_prompt] if MNV.key?(:pre_prompt)
  get(prompt: MNV[:prompt] + '>')
end

#get_command_extra(str) ⇒ Object

Get additional lines of continued commands.



21
22
23
# File 'lib/mysh/sources/console.rb', line 21

def get_command_extra(str)
  get(prompt: MNV[:post_prompt] + '\\', prefix: str[0])
end