public interface CliHandler extends org.osgl.Osgl.Function<CliContext,Void>, Destroyable
Defines a thread-save function object that can be applied to a CliContext
context to produce certain output which could be applied to cli associated with the context
Destroyable.Util
Modifier and Type | Method and Description |
---|---|
boolean |
appliedIn(Act.Mode mode)
Check if this handler applied in a specific
Act.Mode |
org.osgl.Osgl.T2<String,String> |
commandLine()
Returns the command line information that is used to display the command in help.
|
void |
handle(CliContext context)
Invoke handler upon a cli context
|
List<org.osgl.Osgl.T2<String,String>> |
options()
Returns a list of options information to be displayed in help of this command.
|
String |
summary()
Returns the summary of the command.
|
destroy, isDestroyed, scope
void handle(CliContext context)
Invoke handler upon a cli context
context
- the cli contextorg.osgl.Osgl.T2<String,String> commandLine()
Returns the command line information that is used to display the command in help. For example the Help
command is
help [options] [command] show help message
Help
command should return $.T2(“help [options] [command]”, “show help message”)
String summary()
Returns the summary of the command. This is used to display the help information about this command. If null
or empty string returned, then there will be no summary section in the help for this command
List<org.osgl.Osgl.T2<String,String>> options()
Returns a list of options information to be displayed in help of this command. E.g. the options of Help
command is
-s –system list system commands
-a –app list app commands
Help
should return a list of $.T2(“-s –system”, “list system commands”)
$.T2(“-a –app”, “list application commands”)
Copyright © 2014–2018 ActFramework. All rights reserved.