mirror of
https://github.com/cheat/cheat.git
synced 2024-11-18 09:50:39 +01:00
1a7b5c6127
Make `display.Faint` respect the `Colorize` config value.
18 lines
366 B
Go
18 lines
366 B
Go
package display
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/cheat/cheat/internal/config"
|
|
)
|
|
|
|
// Faint returns an faint string
|
|
func Faint(str string, conf config.Config) string {
|
|
// make `str` faint only if colorization has been requested
|
|
if conf.Colorize {
|
|
return fmt.Sprintf(fmt.Sprintf("\033[2m%s\033[0m", str))
|
|
}
|
|
|
|
// otherwise, return the string unmodified
|
|
return str
|
|
}
|