1
mirror of https://github.com/rclone/rclone synced 2024-11-25 02:47:14 +01:00
rclone/fs/terminalcolormode.go
Nick Craig-Wood 3092f82dcc fs: re-implement CutoffMode, LogLevel, TerminalColorMode with Enum
This almost 100% backwards compatible. The only difference being that
in the rc options/get output CutoffMode, LogLevel, TerminalColorMode
will be output as strings instead of integers. This is a lot more
convenient for the user. They still accept integer inputs though so
the fallout from this should be minimal.
2023-10-03 15:14:24 +01:00

22 lines
496 B
Go

package fs
// TerminalColorMode describes how ANSI codes should be handled
type TerminalColorMode = Enum[terminalColorModeChoices]
// TerminalColorMode constants
const (
TerminalColorModeAuto TerminalColorMode = iota
TerminalColorModeNever
TerminalColorModeAlways
)
type terminalColorModeChoices struct{}
func (terminalColorModeChoices) Choices() []string {
return []string{
TerminalColorModeAuto: "AUTO",
TerminalColorModeNever: "NEVER",
TerminalColorModeAlways: "ALWAYS",
}
}