Documentation ¶
Index ¶
- func AccountFromFlag(cmd *cobra.Command) (acc accounts.Account)
- func AccountFromFlagOrAsk(cmd *cobra.Command, message string) (acc accounts.Account)
- func Accountable(cmd *cobra.Command)
- func AskAccount(message string) (acc accounts.Account)
- func Confirm(cmd *cobra.Command, message string) (confirmed bool)
- func Confirmable(cmd *cobra.Command)
- func FindAccount(accountValue string) (acc accounts.Account)
- func GetOrAskAmount(cmd *cobra.Command, message string) (amount *conversion.Amount, err error)
- func HandleError(err error)
- func Payable(cmd *cobra.Command)
- func ShowSpinnerForFunc(opts SpinnerOptions, function func())
- func StartSpinner(opts SpinnerOptions) (spinner *spinnerPkg.Spinner)
- func WaitForCancel() (abort chan os.Signal)
- type SpinnerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountFromFlag ¶
AccountFromFlag returns the account based on the flag
func AccountFromFlagOrAsk ¶
AccountFromFlagOrAsk return the selected account either by reading the flag value or by asking to the user
func Accountable ¶
Accountable mark a command as Accountable so will have the --account flag
func AskAccount ¶
AskAccount asks to the user to select an account
func Confirm ¶
Confirm checks that the flag "confirm" is set and otherwise ask a confirmation in the command line
func Confirmable ¶
Confirmable marks a command as confirmable so will have the --confirm flag
func FindAccount ¶
FindAccount returns an account if it matches either the address or the name
func GetOrAskAmount ¶
GetOrAskAmount return the amount in MESG based on the flag or the user input
func HandleError ¶ added in v1.0.0
func HandleError(err error)
HandleError display the error and stop the process if error exist
func ShowSpinnerForFunc ¶
func ShowSpinnerForFunc(opts SpinnerOptions, function func())
ShowSpinnerForFunc shows a spinner during the execution of the function
func StartSpinner ¶
func StartSpinner(opts SpinnerOptions) (spinner *spinnerPkg.Spinner)
StartSpinner create a new spinner for the terminal
func WaitForCancel ¶
WaitForCancel create a chan than is resolved when the user press CTRL+C
Types ¶
type SpinnerOptions ¶
SpinnerOptions is a struct that contains all details for the spinner