aboutsummaryrefslogtreecommitdiff
path: root/uxd.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-12-15 04:18:50 -0500
committerB. Watson <urchlay@slackware.uk>2024-12-15 04:18:50 -0500
commitcb94cb60fe5a750ed670d89efe3d9233bf0c9b38 (patch)
treeeb06a2c07a5d255b53afb95dc0d9d9f472678feb /uxd.c
parent01a5b51315430bc714a194cd0a864d4e33d6682f (diff)
downloaduxd-cb94cb60fe5a750ed670d89efe3d9233bf0c9b38.tar.gz
implement -b (bold) option.
Diffstat (limited to 'uxd.c')
-rw-r--r--uxd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/uxd.c b/uxd.c
index c4ad772..c235777 100644
--- a/uxd.c
+++ b/uxd.c
@@ -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);