Commands

Custom types

CommandResult

type CommandResult is bytes32;

Structs

Command

struct Command {
	string[] inputs
}

Struct used to hold command parameters. Useful for creating commands that can be run multiple times

CommandOutput

struct CommandOutput {
	int32 exitCode
	bytes stdout
	bytes stderr
	Command command
}

Functions

Ok(CommandOutput value) → (CommandResult)

commands

create() → (Command cmd)

Creates a new 'Command' struct with empty arguments.

create(string input) → (Command)

Creates a new Command struct using the provided input as the executable.

arg(Command self, string _arg) → (Command)

args(Command self, string[] _args) → (Command)

args(Command self, string[1] _args) → (Command)

args(Command self, string[2] _args) → (Command)

args(Command self, string[3] _args) → (Command)

args(Command self, string[4] _args) → (Command)

args(Command self, string[5] _args) → (Command)

args(Command self, string[6] _args) → (Command)

args(Command self, string[7] _args) → (Command)

args(Command self, string[8] _args) → (Command)

args(Command self, string[9] _args) → (Command)

args(Command self, string[10] _args) → (Command)

args(Command self, string[11] _args) → (Command)

args(Command self, string[12] _args) → (Command)

args(Command self, string[13] _args) → (Command)

args(Command self, string[14] _args) → (Command)

args(Command self, string[15] _args) → (Command)

args(Command self, string[16] _args) → (Command)

args(Command self, string[17] _args) → (Command)

args(Command self, string[18] _args) → (Command)

args(Command self, string[19] _args) → (Command)

args(Command self, string[20] _args) → (Command)

toString(Command self) → (string)

Transforms a command to its string representation.

run(Command self) → (CommandResult)

Runs a command using the specified Command struct as parameters and returns the result.

run(string[] inputs) → (CommandResult)

Runs a command with the specified inputs as parameters and returns the result.

run(string[1] inputs) → (CommandResult)

run(string[2] inputs) → (CommandResult)

run(string[3] inputs) → (CommandResult)

run(string[4] inputs) → (CommandResult)

run(string[5] inputs) → (CommandResult)

run(string[6] inputs) → (CommandResult)

run(string[7] inputs) → (CommandResult)

run(string[8] inputs) → (CommandResult)

run(string[9] inputs) → (CommandResult)

run(string[10] inputs) → (CommandResult)

run(string[11] inputs) → (CommandResult)

run(string[12] inputs) → (CommandResult)

run(string[13] inputs) → (CommandResult)

run(string[14] inputs) → (CommandResult)

run(string[15] inputs) → (CommandResult)

run(string[16] inputs) → (CommandResult)

run(string[17] inputs) → (CommandResult)

run(string[18] inputs) → (CommandResult)

run(string[19] inputs) → (CommandResult)

run(string[20] inputs) → (CommandResult)

CommandError

NotExecuted(string reason) → (Error)

toCommandResult(Error self) → (CommandResult)

LibCommandOutputPointer

toCommandOutput(Pointer self) → (CommandOutput output)

toCommandResult(Pointer self) → (CommandResult result)

toPointer(CommandOutput self) → (Pointer ptr)

LibCommandResult

isOk(CommandResult self) → (bool)

isError(CommandResult self) → (bool)

unwrap(CommandResult self) → (CommandOutput)

expect(CommandResult self, string err) → (CommandOutput)

toError(CommandResult self) → (Error)

toValue(CommandResult self) → (CommandOutput)

toPointer(CommandResult self) → (Pointer)