diff options
author | B. Watson <urchlay@slackware.uk> | 2024-12-15 04:18:50 -0500 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-12-15 04:18:50 -0500 |
commit | cb94cb60fe5a750ed670d89efe3d9233bf0c9b38 (patch) | |
tree | eb06a2c07a5d255b53afb95dc0d9d9f472678feb | |
parent | 01a5b51315430bc714a194cd0a864d4e33d6682f (diff) | |
download | uxd-cb94cb60fe5a750ed670d89efe3d9233bf0c9b38.tar.gz |
implement -b (bold) option.
-rw-r--r-- | uxd.c | 7 | ||||
-rw-r--r-- | uxd.rst | 1 |
2 files changed, 5 insertions, 3 deletions
@@ -73,6 +73,7 @@ int dump_column = 0; int filepos = 0; /* options */ +int bold = 0; /* -b */ int hilite_multi = 0; /* -r */ int mono = 0; /* -m */ long display_offset = 0; /* -o */ @@ -120,8 +121,10 @@ void parse_options(int argc, char **argv) { version(); } - while((opt = my_getopt(argc, argv, "l:rmo:s:uhv")) != -1) { + while((opt = my_getopt(argc, argv, "bl:rmo:s:uhv")) != -1) { switch(opt) { + case 'b': + bold = 1; break; case 'l': limit = parse_number(optarg); break; case 'r': @@ -204,7 +207,7 @@ void next_normal_color() { void append_color(char *buf, int fgcolor, int bgcolor) { char tmpbuf[100]; - sprintf(tmpbuf, "\x1b[0;3%d", fgcolor); + sprintf(tmpbuf, "\x1b[%d;3%d", bold, fgcolor); strcat(buf, tmpbuf); if(bgcolor) { sprintf(tmpbuf, ";4%d", bgcolor); @@ -49,7 +49,6 @@ over the environment. -b Bold output. This may be more or less readable, depending on your terminal and its color settings. Ignored if **-m** given. - NOT IMPLEMENTED YET. -c nnnn Set the colors to use. Must be 2 to 4 digits, from 0 to 7. These are |