diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-12-30 21:49:10 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-03-02 19:08:31 +0100 |
commit | 312dff17607db3de5959fd6cf84506ef9cdfd9a8 (patch) | |
tree | f4e9c217a67d03b90f8ab044619bd001c806c9ad /src/basic/terminal-util.h | |
parent | man: document usage of SD_BUS_CREDS_AUGMENT (diff) | |
download | systemd-312dff17607db3de5959fd6cf84506ef9cdfd9a8.tar.xz systemd-312dff17607db3de5959fd6cf84506ef9cdfd9a8.zip |
util: add helpers for generating colored check mark glyphs from bools
Diffstat (limited to 'src/basic/terminal-util.h')
-rw-r--r-- | src/basic/terminal-util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/terminal-util.h b/src/basic/terminal-util.h index 27e7f8db22..d327627b20 100644 --- a/src/basic/terminal-util.h +++ b/src/basic/terminal-util.h @@ -253,5 +253,9 @@ int vt_release(int fd, bool restore_vt); void get_log_colors(int priority, const char **on, const char **off, const char **highlight); +static inline const char* ansi_highlight_green_red(bool b) { + return b ? ansi_highlight_green() : ansi_highlight_red(); +} + /* This assumes there is a 'tty' group */ #define TTY_MODE 0620 |