abstract class fanr::Command
sys::Obj fanr::Command
Command implements a top-level command in the fanr command line tool.
Commands declare their options using the CommandOpt
facet which works similiar to AbstractMain
. If the field is a Bool, then the option is treated as a flag option. Otherwise it must be one of these types: Str, Uri.
- confirm
-
Ask for y/n confirmation or skip if
-y
option specified. - env
-
FanrEnv env()
Get the local environment to use this command
- err
-
Err err(Str msg, Err? cause := null)
Throw an exception which may be used to unwind the stack back to main to indicate command failed and return non-zero
- errTrace
-
@CommandOpt { name="errTrace"; help="Dump error stack traces" }
Bool errTraceOption to dump full stack trace on errors
- name
-
abstract Str name()
Name of command
- out
-
OutStream out := Env.cur().out
Stdout for printing command output
- password
-
@CommandOpt { name="p"; help="Password for authentication"; config="password" }
Str? passwordPassword for authentication
- repo
-
Repo repo()
Get the repo to use for this command:
- default is config prop "repo"
- override with "-r" option
- repoUri
-
@CommandOpt { name="r"; help="Repository URI for command"; config="repo" }
Uri? repoUriRepository URI -r option
- run
-
abstract Void run()
Execute command. If there is a failure then throw
err
, otherwise the command is assumed to be successful. - skipConfirm
-
@CommandOpt { name="y"; help="Skip confirmation" }
Bool skipConfirmOption to skip confirmation (auto yes)
- summary
-
abstract Str summary()
Short summary of command for usage screen
- usage
-
virtual Void usage(OutStream out := this.out)
Print usage to given output stream
- username
-
@CommandOpt { name="u"; help="Username for authentication"; config="username" }
Str? usernameUsername for authentication
- warn
-
Log a warning to
out