Documentation ¶
Index ¶
- Constants
- func AppendLF(s string) string
- func LastLine(str string) string
- type Interceptor
- func AlwaysNo(showOut ...bool) Interceptor
- func AlwaysOption(optionIndex int, showOut ...bool) Interceptor
- func AlwaysYes(showOut ...bool) Interceptor
- func Continue() Interceptor
- func LastLinePassword(pattern string, input string, showOut ...bool) Interceptor
- func LastLinePattern(pattern string, input string, showOut ...bool) Interceptor
- func LastLineRegex(regex *regexp.Regexp, input string, showOut ...bool) Interceptor
- func More() Interceptor
- func Password(pattern string, password string, showOut ...bool) Interceptor
- func Pattern(pattern string, input string, format func(string) string, showOut ...bool) Interceptor
- func Regexp(regex *regexp.Regexp, input string, format func(string) string, ...) Interceptor
Constants ¶
View Source
const ( // DefaultOptionPromptPattern 默认选项的匹配规则 DefaultOptionPromptPattern = `(?i)[\[(]y(es)?[/|]no?[\])][?:]\s*$` // FlexibleOptionPromptPattern 灵活选项的匹配规则 FlexibleOptionPromptPattern = `(?i)[\[(][a-z]+([/|][a-z\[\]]+)+[\])][?:]\s*$` )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Interceptor ¶
func AlwaysNo ¶
func AlwaysNo(showOut ...bool) Interceptor
func AlwaysOption ¶
func AlwaysOption(optionIndex int, showOut ...bool) Interceptor
func AlwaysYes ¶
func AlwaysYes(showOut ...bool) Interceptor
func Continue ¶
func Continue() Interceptor
func LastLinePassword ¶
func LastLinePassword(pattern string, input string, showOut ...bool) Interceptor
LastLinePassword 需要调用方保证 pattern 是合法的正则表达式
func LastLinePattern ¶
func LastLinePattern(pattern string, input string, showOut ...bool) Interceptor
LastLinePattern 需要调用方保证 pattern 是合法的正则表达式
func LastLineRegex ¶
func LastLineRegex(regex *regexp.Regexp, input string, showOut ...bool) Interceptor
func More ¶
func More() Interceptor
func Password ¶
func Password(pattern string, password string, showOut ...bool) Interceptor
Password 需要调用方保证 pattern 是合法的正则表达式
Click to show internal directories.
Click to hide internal directories.