Interface CommandContext
- All Known Implementing Classes:
- CommandContext.DefaultCommandContext
public interface CommandContext
Interface containing information about current command execution.
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionGets a command registration.<T> TgetOptionValue(String name) Gets an mapped option value.Gets a command option parser results.String[]Gets a raw args passed into a currently executing command.Gets aShellContextassociated withCommandContext.org.jline.terminal.TerminalGets a terminal.booleanhasMappedOption(String name) Gets if option has been mapped.static CommandContextof(String[] args, CommandParser.CommandParserResults results, org.jline.terminal.Terminal terminal, CommandRegistration commandRegistration, ShellContext shellContext) Gets an instance of a defaultCommandContext.
- 
Method Details- 
getRawArgsString[] getRawArgs()Gets a raw args passed into a currently executing command.- Returns:
- raw command arguments
 
- 
hasMappedOptionGets if option has been mapped.- Parameters:
- name- the option name
- Returns:
- true if option has been mapped, false otherwise
 
- 
getParserResultsCommandParser.CommandParserResults getParserResults()Gets a command option parser results.- Returns:
- the command option parser results
 
- 
getCommandRegistrationCommandRegistration getCommandRegistration()Gets a command registration.- Returns:
- the command registration
 
- 
getOptionValueGets an mapped option value.- Type Parameters:
- T- the type to map to
- Parameters:
- name- the option name
- Returns:
- mapped value
 
- 
getTerminalorg.jline.terminal.Terminal getTerminal()Gets a terminal.- Returns:
- a terminal
 
- 
getShellContextShellContext getShellContext()Gets aShellContextassociated withCommandContext.- Returns:
- a shell context
 
- 
ofstatic CommandContext of(String[] args, CommandParser.CommandParserResults results, org.jline.terminal.Terminal terminal, CommandRegistration commandRegistration, ShellContext shellContext) Gets an instance of a defaultCommandContext.- Parameters:
- args- the arguments
- results- the results
- terminal- the terminal
- commandRegistration- the command registration
- Returns:
- a command context
 
 
-