cli

package
v1.3.0-sp2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Args []string
)
View Source
var CliExports = map[string]interface{}{
	"Args":        _getArgs,
	"Bool":        _cliBool,
	"Have":        _cliBool,
	"String":      CliString,
	"HTTPPacket":  CliString,
	"YakCode":     CliString,
	"Text":        CliString,
	"Int":         _cliInt,
	"Integer":     _cliInt,
	"Float":       _cliFloat,
	"Double":      _cliFloat,
	"YakitPlugin": _cliYakitPluginFiles,
	"StringSlice": CliStringSlice,

	"Urls": _cliUrls,
	"Url":  _cliUrls,

	"Ports": _cliPort,
	"Port":  _cliPort,

	"Hosts":   _cliHosts,
	"Host":    _cliHosts,
	"Network": _cliHosts,
	"Net":     _cliHosts,

	"File":          _cliFile,
	"FileNames":     _cliFileNames,
	"FileOrContent": _cliFileOrContent,
	"LineDict":      _cliLineDict,

	"setHelp":     _cliSetHelpInfo,
	"setDefault":  _cliSetDefaultValue,
	"setRequired": _cliSetRequired,

	"setVerboseName": _cliSetVerboseName,

	"setCliGroup": _cliSetGroup,

	"setMultipleSelect": _cliSetMultiSelect,

	"setSelectOption": _cliSetSelectOption,

	"SetCliName": _cliSetName,
	"SetDoc":     _cliSetDocument,

	"help":  _help,
	"check": _cliCheck,
}

Functions

func CliCheckWithContext

func CliCheckWithContext(cancel context.CancelFunc) func()

func CliString

func CliString(name string, opts ...SetCliExtraParam) string

String 获取对应名称的命令行参数,并将其转换为 string 类型返回 Example: ``` target = cli.String("target") // --target yaklang.com 则 target 为 yaklang.com ```

func CliStringSlice

func CliStringSlice(name string, options ...SetCliExtraParam) []string

StringSlice 获取对应名称的命令行参数,将其字符串根据","切割返回 []string 类型 Example: ``` targets = cli.StringSlice("targets") // --targets yaklang.com,google.com 则 targets 为 ["yaklang.com", "google.com"] ```

func InjectCliArgs

func InjectCliArgs(args []string)

Types

type SetCliExtraParam

type SetCliExtraParam func(c *cliExtraParams)

func SetTempArgs

func SetTempArgs(args []string) SetCliExtraParam

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL