Skip to content

Commit

Permalink
[terminal] Update windows stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Jul 15, 2023
1 parent 9d5e151 commit d5f6d41
Showing 1 changed file with 60 additions and 28 deletions.
88 changes: 60 additions & 28 deletions terminal/terminal_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,38 @@ var MaskSymbol = "*"
// ❗ HideLength is flag for hiding password length
var HideLength = false

// ❗ MaskSymbolColorTag is fmtc color tag used for MaskSymbol output
var MaskSymbolColorTag = ""
// ❗ HidePassword is flag for hiding password while typing
// Because of using the low-level linenoise method for this feature, we can not use a
// custom masking symbol, so it always will be an asterisk (*).
var HidePassword = false

// ❗ TitleColorTag is fmtc color tag used for input titles
var TitleColorTag = "{c}"
var (
// ❗ MaskSymbolColorTag is fmtc color tag used for MaskSymbol output
MaskSymbolColorTag = ""

// ❗ ErrorColorTag is fmtc color tag used for error messages
var ErrorColorTag = "{r}"
// ❗ TitleColorTag is fmtc color tag used for input titles
TitleColorTag = "{s}"

// ❗ WarnColorTag is fmtc color tag used for warning messages
var WarnColorTag = "{y}"
// ❗ ErrorColorTag is fmtc color tag used for error messages
ErrorColorTag = "{r}"

// ❗ ErrorPrefix is prefix for error messages
var ErrorPrefix = ""
// ❗ WarnColorTag is fmtc color tag used for warning messages
WarnColorTag = "{y}"

// ❗ WarnPrefix is prefix for warning messages
var WarnPrefix = ""
// ❗ InfoColorTag is fmtc color tag used for info messages
InfoColorTag = "{c-}"
)

var (
// ❗ ErrorPrefix is prefix for error messages
ErrorPrefix = ""

// ❗ WarnPrefix is prefix for warning messages
WarnPrefix = ""

// ❗ InfoPrefix is prefix for info messages
InfoPrefix = ""
)

// ////////////////////////////////////////////////////////////////////////////////// //

Expand All @@ -53,14 +68,6 @@ func Read(title string, nonEmpty bool) (string, error) {
return "", nil
}

// ❗ ReadUI reads user's input
//
// Deprecated: Use method Read instead
func ReadUI(title string, nonEmpty bool) (string, error) {
panic("UNSUPPORTED")
return "", nil
}

// ❗ ReadAnswer reads user's answer for yes/no question
func ReadAnswer(title, defaultAnswer string) (bool, error) {
panic("UNSUPPORTED")
Expand All @@ -81,23 +88,48 @@ func ReadPasswordSecure(title string, nonEmpty bool) (*secstr.String, error) {
return "", nil
}

// ❗ PrintErrorMessage prints error message
func PrintErrorMessage(message string, args ...any) {
// ❗ PrintActionMessage prints message about action currently in progress
func PrintActionMessage(message string) {
panic("UNSUPPORTED")
}

// ❗ PrintWarnMessage prints warning message
func PrintWarnMessage(message string, args ...any) {
// ❗ PrintActionStatus prints message with action execution status
func PrintActionStatus(status int) {
panic("UNSUPPORTED")
}

// ❗ PrintActionMessage prints message about action currently in progress
func PrintActionMessage(message string) {
// ❗ Error prints error message
func Error(message string, args ...any) {
panic("UNSUPPORTED")
}

// ❗ PrintActionStatus prints message with action execution status
func PrintActionStatus(status int) {
// ❗ Warn prints warning message
func Warn(message string, args ...any) {
panic("UNSUPPORTED")
}

// ❗ Info prints info message
func Info(message string, args ...any) {
panic("UNSUPPORTED")
}

// ❗ ErrorPanel shows panel with error message
func ErrorPanel(title, message string) {
panic("UNSUPPORTED")
}

// ❗ WarnPanel shows panel with warning message
func WarnPanel(title, message string) {
panic("UNSUPPORTED")
}

// ❗ InfoPanel shows panel with warning message
func InfoPanel(title, message string) {
panic("UNSUPPORTED")
}

// ❗ Panel show panel with given label, title, and message
func Panel(label, colorTag, title, message string) {
panic("UNSUPPORTED")
}

Expand Down

0 comments on commit d5f6d41

Please sign in to comment.