Revert incomplete "Allow hiding of TypedCommand cmd and output"
This commit is contained in:
parent
48680338bf
commit
0d797ea684
|
@ -126,29 +126,22 @@ case class Pause(millisec: Long) extends Slide
|
||||||
case object PauseKey extends Slide
|
case object PauseKey extends Slide
|
||||||
case class Meta(contents: (Presentation, Int) => Slide) extends Slide
|
case class Meta(contents: (Presentation, Int) => Slide) extends Slide
|
||||||
|
|
||||||
case class TypedCommand[T](exec: T => String, display: String, cmd: T, cmdIsHidden: Boolean, outputIsHidden: Boolean) extends Slide:
|
case class TypedCommand[T](exec: T => String, display: String, cmd: T) extends Slide:
|
||||||
private lazy val _output = exec(cmd)
|
private lazy val _output = exec(cmd)
|
||||||
def output = _output
|
def output = _output
|
||||||
|
|
||||||
infix def showing (s: String): TypedCommand[T] = TypedCommand(exec, s, cmd)
|
infix def showing (s: String): TypedCommand[T] = TypedCommand(exec, s, cmd)
|
||||||
|
|
||||||
def show() =
|
def show() =
|
||||||
force()
|
|
||||||
if ! cmdIsHidden then
|
|
||||||
prompt()
|
prompt()
|
||||||
Terminal.showCursor()
|
Terminal.showCursor()
|
||||||
typeCmd()
|
typeCmd()
|
||||||
if ! outputIsHidden then
|
|
||||||
print(output)
|
print(output)
|
||||||
if ! cmdIsHidden then
|
|
||||||
Terminal.hideCursor()
|
Terminal.hideCursor()
|
||||||
|
|
||||||
def quickShow() =
|
def quickShow() =
|
||||||
force()
|
|
||||||
if ! cmdIsHidden then
|
|
||||||
prompt()
|
prompt()
|
||||||
println(display)
|
println(display)
|
||||||
if ! outputIsHidden then
|
|
||||||
print(output)
|
print(output)
|
||||||
|
|
||||||
def prompt() = print(fansi.Color.LightGreen("user@host % "))
|
def prompt() = print(fansi.Color.LightGreen("user@host % "))
|
||||||
|
|
Loading…
Reference in a new issue