Class: CommandProcess

vertx-shell-js/command_process~ CommandProcess

new CommandProcess()

The command process provides interaction with the process of the command provided by Vert.x Shell.
Source:

Methods

args() → {Array.<string>}

Source:
Returns:
  • the actual string arguments of the command
  • Type
    Array.<string>

argsTokens() → {Array.<CliToken>}

Source:
Returns:
  • the unparsed arguments tokens
  • Type
    Array.<CliToken>

backgroundHandler(handler) → {CommandProcess}

Set a background handler, this handler is called when the command is running and put to background.
Parameters:
Name Type Description
handler function the background handler
Source:
Returns:
this command
Type
CommandProcess

commandLine() → {CommandLine}

Source:
Returns:
  • the command line object or null
  • Type
    CommandLine

end(status)

End the process.
Parameters:
Name Type Description
status number the exit status.
Source:

endHandler(handler) → {CommandProcess}

Set an end handler, this handler is called when the command is ended, for instance the command is running and the shell closes.
Parameters:
Name Type Description
handler function the end handler
Source:
Returns:
a reference to this, so the API can be used fluently
Type
CommandProcess

foregroundHandler(handler) → {CommandProcess}

Set a foreground handler, this handler is called when the command is running and put to foreground.
Parameters:
Name Type Description
handler function the foreground handler
Source:
Returns:
this command
Type
CommandProcess

interruptHandler(handler) → {CommandProcess}

Set an interrupt handler, this handler is called when the command is interrupted, for instance user press Ctrl-C.
Parameters:
Name Type Description
handler function the interrupt handler
Source:
Returns:
this command
Type
CommandProcess

isForeground() → {boolean}

Source:
Returns:
  • true if the command is running in foreground
  • Type
    boolean

resizehandler(handler) → {CommandProcess}

Parameters:
Name Type Description
handler function
Source:
Returns:
Type
CommandProcess

resumeHandler(handler) → {CommandProcess}

Set a resume handler, this handler is called when the command is resumed, for instance user types bg or fg to resume the command.
Parameters:
Name Type Description
handler function the interrupt handler
Source:
Returns:
this command
Type
CommandProcess

session() → {Session}

Source:
Returns:
  • the shell session
  • Type
    Session

stdinHandler(handler) → {CommandProcess}

Parameters:
Name Type Description
handler function
Source:
Returns:
Type
CommandProcess

suspendHandler(handler) → {CommandProcess}

Set a suspend handler, this handler is called when the command is suspended, for instance user press Ctrl-Z.
Parameters:
Name Type Description
handler function the interrupt handler
Source:
Returns:
this command
Type
CommandProcess

vertx() → {Vertx}

Source:
Returns:
  • the current Vert.x instance
  • Type
    Vertx

write(data) → {CommandProcess}

Write some text to the standard output.
Parameters:
Name Type Description
data string the text
Source:
Returns:
a reference to this, so the API can be used fluently
Type
CommandProcess