Documentation ¶
Index ¶
- Constants
- func ArgAddressCheck(arg string) bool
- func ArgBigIntCheck(arg string) bool
- func ArgBoolCheck(arg string) bool
- func ArgDirExistsCheck(arg string) bool
- func ArgFloatCheck(arg string) bool
- func ArgPubKeyHashCheck(arg string) bool
- func ArgTxHashCheck(arg string) bool
- func ArgUInt64Check(arg string) bool
- func ArgsLenCheck(args []string, requiredLen int) bool
- func ArgsLenCheckWithOptional(args []string, requiredLen int, optionalLen int) bool
- func ArgsLenCheckWithOptionalRange(args []string, requiredLen int, optionalLenLower int, optionalLenHigher int) bool
- func ArgsMinLenCheck(args []string, minimumLen int) bool
- func GetConfirmationInput() bool
- func PasswordCompleter(d prompt.Document) []prompt.Suggest
- type BaseMode
- func (bm *BaseMode) CliPrefix() (string, bool)
- func (bm *BaseMode) Completer(d prompt.Document) []prompt.Suggest
- func (bm *BaseMode) GetEmptySuggestions(line []string) []prompt.Suggest
- func (bm *BaseMode) HandleExitCommand(args []string)
- func (bm *BaseMode) HandleJumpCommand(args []string)
- func (bm *BaseMode) HandleReturnToRoot(args []string)
- func (bm *BaseMode) HandleSelection(currCmd mode_interface.Mode, selection string, args []string)
- func (bm *BaseMode) Init(contxt *context.Context)
- func (bm *BaseMode) RegisterCommand(command string, suggestionFunc func([]string) []prompt.Suggest, ...)
- func (bm *BaseMode) RegisterSubCommand(command string, subcommand string, ...)
- func (bm *BaseMode) SetBaseSuggestions(suggestions []prompt.Suggest)
- type Command
Constants ¶
const ( RETURN_TO_ROOT = "home" EXIT_CMD = "exit" JUMP_CMD = "j" )
Variables ¶
This section is empty.
Functions ¶
func ArgAddressCheck ¶
func ArgBigIntCheck ¶
func ArgBoolCheck ¶
func ArgDirExistsCheck ¶
func ArgFloatCheck ¶
func ArgPubKeyHashCheck ¶
func ArgTxHashCheck ¶
func ArgUInt64Check ¶
func ArgsLenCheck ¶
func ArgsMinLenCheck ¶
func GetConfirmationInput ¶
func GetConfirmationInput() bool
Loop to get user input for a confirmation
func PasswordCompleter ¶
func PasswordCompleter(d prompt.Document) []prompt.Suggest
Returns a suggestion to ask for the user's wallet password
Types ¶
type BaseMode ¶
type BaseMode struct {
// contains filtered or unexported fields
}
BaseMode handles breaking down the current input ( line ) into command and args Handles showing different suggestions depending on the command
Used as a component in other structs to statisfy the cmd interface
func (*BaseMode) Completer ¶
func (bm *BaseMode) Completer(d prompt.Document) []prompt.Suggest
Based on the current line, split into command and args, Pass this to the registered suggestion functions to get a specific suggestion for a command
func (*BaseMode) GetEmptySuggestions ¶
For when there is no need for any suggestions
func (*BaseMode) HandleExitCommand ¶
Triggers the mcli to exit by passing back a nil instead of a valid cmd
func (*BaseMode) HandleJumpCommand ¶
Updates the context's active mode based on the args provided
func (*BaseMode) HandleReturnToRoot ¶
Jumps to the root mode
func (*BaseMode) HandleSelection ¶
func (bm *BaseMode) HandleSelection(currCmd mode_interface.Mode, selection string, args []string)
Once a selection has been made, pass args to command handler
func (*BaseMode) RegisterCommand ¶
func (*BaseMode) RegisterSubCommand ¶
func (*BaseMode) SetBaseSuggestions ¶
func (bm *BaseMode) SetBaseSuggestions(suggestions []prompt.Suggest)