abstract const classstudsTools::Cmd

sys::Obj
  studsTools::Cmd

Cmd models a build tool command.

abort

Source

Void abort(Str msg)

Print the given error message, show command help, then exit with error code.

args

Source

Str[] args()

List command arguments. Arguments are any terms that trail the command name not prefixied with -.

err

Source

Void err(Str msg)

Convenience for Env.cur.err.printLine.

get

Source

static Cmd? get(Str name)

Get the given command, or null if not found.

helpFull

Source

abstract Str? helpFull()

Full help text for this command, or null for none.

helpShort

Source

abstract Str helpShort()

One-line short help text for this command.

info

Source

Void info(Str msg)

Convenience for Env.cur.out.printLine.

list

Source

static Cmd[] list()

List all commands.

name

Source

abstract Str name()

Unique name of this command.

opts

Source

Str[] opts()

List of command options. Options are any terms that trail the command name and are prexifed with -.

profile

Source

static Str:Str profile()

Profile configuration.

prompt

Source

Str? prompt(Str msg)

Conveniece for Env.cur.prompt.

promptChoice

Source

Int promptChoice(Str msg, Range range)

Convenience for prompt with an integer range choice, returns the selected choise, or aborts if invalid input or out of range.

promptYesNo

Source

Bool promptYesNo(Str msg, Str def := "y")

Convenience for prompt with yes/no choice, return true for y or false for n. If enter is pressed with no choice, then use def for default.

props

Source

static Props props()

Props configuration.

run

Source

abstract Int run()

Run this command and return exit code.

showHelp

Source

Void showHelp()

Convenience to display help for this command.

sig

Source

virtual Str sig()

Help signature.

workDir

Source

File workDir()

Get the current working directory.