Documentation ¶
Overview ¶
Package cli provides all methods to control command line functions
Index ¶
- func CMDRgx() *regexp.Regexp
- func Flag(args string) (string, map[string]interface{})
- func GetCMDNames(s interface{}) []string
- func GetOptions(s interface{}, key string) ([]string, []interface{})
- func InitConfig(f string) ([]byte, error)
- func SetConfig(args string, s *Config)
- func SetFlag(flag map[string]interface{}, option string, v interface{}) interface{}
- func SetValue(v reflect.Value, rec string, val interface{}) error
- func ShowConfig(s *Config)
- func UpgradeConfig(cfg *Config) error
- func WriteConfig(cfg Config) error
- type Config
- type HPing
- type Ping
- type Readline
- func (r *Readline) AddCompleter(pcItem string, pcSubItems []string)
- func (r *Readline) Close(next chan struct{})
- func (r *Readline) GetPrompt() string
- func (r *Readline) Help()
- func (r *Readline) Next()
- func (r *Readline) Refresh()
- func (r *Readline) RemoveItemCompleter(pcItem string)
- func (r *Readline) Run(cmd chan<- string, next chan struct{})
- func (r *Readline) SetEmacs()
- func (r *Readline) SetPrompt(p string)
- func (r *Readline) SetVim()
- func (r *Readline) UpdateCompleter(pcItem string, pcSubItems []string)
- func (r *Readline) UpdatePromptN(p string, n int)
- type Scan
- type Trace
- type Web
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCMDNames ¶ added in v0.2.3
func GetCMDNames(s interface{}) []string
GetCMDNames returns command line names
func GetOptions ¶ added in v0.2.3
GetOptions returns option(s)/value(s) for specific command
func InitConfig ¶ added in v0.2.3
InitConfig creates new config file
func UpgradeConfig ¶ added in v0.2.3
UpgradeConfig adds / removes new command(s)/option(s)
func WriteConfig ¶ added in v0.2.3
WriteConfig write config to disk
Types ¶
type Config ¶ added in v0.2.3
type Config struct { Ping Ping `json:"ping"` Hping HPing `json:"hping"` Web Web `json:"web"` Scan Scan `json:"scan"` Trace Trace `json:"trace"` }
Config represents configuration
func ReadConfig ¶ added in v0.2.3
func ReadConfig() Config
ReadConfig reads configuration from existing or default configuration
func ReadDefaultConfig ¶ added in v0.2.3
ReadDefaultConfig returns default configuration
type HPing ¶ added in v0.2.3
type HPing struct { Timeout string `json:"timeout"` Method string `json:"method"` Data string `json:"data"` Count int `json:"count"` }
HPing represents ping command options
type Ping ¶ added in v0.2.3
type Ping struct { Timeout string `json:"timeout"` Interval string `json:"interval"` Count int `json:"count"` }
Ping represents ping command options
type Readline ¶
type Readline struct {
// contains filtered or unexported fields
}
Readline structure
func (*Readline) AddCompleter ¶
AddCompleter updates subitem(s) from a specific main item
func (*Readline) RemoveItemCompleter ¶
RemoveItemCompleter removes subitem(s) from a specific main item
func (*Readline) UpdateCompleter ¶
UpdateCompleter updates subitem(s) from a specific main item
func (*Readline) UpdatePromptN ¶
UpdatePromptN appends readline prompt
type Scan ¶ added in v0.2.3
type Scan struct {
Port string `json:"port"`
}
Scan represents scan command options