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 {
|
|
|
|
return fmt.Sprintf(fmt.Sprintf("\033[2m%s\033[0m", str))
|
|
|
|
}
|
|
|
|
|
|
|
|
// otherwise, return the string unmodified
|
|
|
|
return str
|
2020-11-27 19:40:24 +01:00
|
|
|
}
|