2020-11-27 19:40:24 +01:00
|
|
|
package display
|
|
|
|
|
2020-11-28 04:50:55 +01:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/cheat/cheat/internal/config"
|
|
|
|
)
|
2020-11-27 19:40:24 +01:00
|
|
|
|
|
|
|
// Faint returns an faint string
|
2020-11-28 04:50:55 +01:00
|
|
|
func Faint(str string, conf config.Config) string {
|
|
|
|
// make `str` faint only if colorization has been requested
|
|
|
|
if conf.Colorize {
|
2022-08-05 02:38:49 +02:00
|
|
|
return fmt.Sprintf("\033[2m%s\033[0m", str)
|
2020-11-28 04:50:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// otherwise, return the string unmodified
|
|
|
|
return str
|
2020-11-27 19:40:24 +01:00
|
|
|
}
|