aboutsummaryrefslogtreecommitdiff
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
parent01a5b51315430bc714a194cd0a864d4e33d6682f (diff)
downloaduxd-cb94cb60fe5a750ed670d89efe3d9233bf0c9b38.tar.gz
implement -b (bold) option.
-rw-r--r--uxd.c7
-rw-r--r--uxd.rst1
2 files changed, 5 insertions, 3 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);
diff --git a/uxd.rst b/uxd.rst
index 43081c0..170c46f 100644
--- a/uxd.rst
+++ b/uxd.rst
@@ -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