Executable

public protocol Executable

The Executable

  • Execute the command

    Throws

    If execution fails

    Declaration

    Swift

    @discardableResult
    func execute(_ command: String) throws -> String

    Parameters

    command

    The command that should be executed

    Return Value

    The corresponding output

  • Print text

    Declaration

    Swift

    func print(_ text: String)

    Parameters

    text

    The text that should be printed out

  • Print error

    Declaration

    Swift

    func printError(_ text: String)

    Parameters

    text

    The text that should be printed out

  • Start loading

    Declaration

    Swift

    func startLoading(message: String?)

    Parameters

    message

    The optional message

  • Stop loading

    Declaration

    Swift

    func stopLoading(message: String?)

    Parameters

    message

    The optional message

  • Read line

    Declaration

    Swift

    func readLine(prompt: String?) -> String?

    Parameters

    prompt

    The optional prompt text

    Return Value

    The retrieved line if available

  • Terminate Executable

    Declaration

    Swift

    func terminate()
  • startLoading() Extension method

    Start loading

    Declaration

    Swift

    func startLoading()
  • stopLoading() Extension method

    Stop loading

    Declaration

    Swift

    func stopLoading()