3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/command_butler/line_decorator.rb', line 3
def self.decoration(command:command, index:index, current_index: current_index, input: input)
mark = if current_index == index
"\e[33m" + " > "
elsif input
"\e[32m" + (input.execute?? " o " : " - ")
else
"\e[37m" + " "
end
ret = "#{index + 1} " + "["+ mark + "\e[0m" + "]"
if command.command
ret += " " + command.command
else
ret += " - "
end
ret += " <= chdir to #{command.chdir}" if command.chdir
ret
end
|