sent-options-20190213-72d33d4.diff (1536B)
1 From 3a348cc15a97df8e8784b129800293dcfba28f3f Mon Sep 17 00:00:00 2001 2 From: Sunur Efe Vural <efe@efe.kim> 3 Date: Wed, 13 Feb 2019 14:28:17 -0500 4 Subject: [PATCH] Commandline Options 5 6 A simple patch that adds extra commandline options to sent. 7 --- 8 sent.1 | 11 +++++++++++ 9 sent.c | 11 ++++++++++- 10 2 files changed, 21 insertions(+), 1 deletion(-) 11 12 diff --git a/sent.1 b/sent.1 13 index fabc614..5d55bf4 100644 14 --- a/sent.1 15 +++ b/sent.1 16 @@ -5,6 +5,9 @@ 17 .Nd simple plaintext presentation tool 18 .Sh SYNOPSIS 19 .Nm 20 +.Op Fl f Ar font 21 +.Op Fl c Ar fgcolor 22 +.Op Fl b Ar bgcolor 23 .Op Fl v 24 .Op Ar file 25 .Sh DESCRIPTION 26 @@ -21,6 +24,14 @@ few minutes. 27 .Bl -tag -width Ds 28 .It Fl v 29 Print version information to stdout and exit. 30 +.It Fl f Ar font 31 +Defines the 32 +.Ar font 33 +when sent is run. 34 +.It Fl c Ar fgcolor 35 +Defines the foreground color when sent is run. 36 +.It Fl b Ar bgcolor 37 +Defines the background color when sent is run. 38 .El 39 .Sh USAGE 40 .Bl -tag -width Ds 41 diff --git a/sent.c b/sent.c 42 index c50a572..0b36e32 100644 43 --- a/sent.c 44 +++ b/sent.c 45 @@ -675,7 +675,7 @@ configure(XEvent *e) 46 void 47 usage() 48 { 49 - die("usage: %s [file]", argv0); 50 + die("usage: %s [-c fgcolor] [-b bgcolor] [-f font] [file]", argv0); 51 } 52 53 int 54 @@ -687,6 +687,15 @@ main(int argc, char *argv[]) 55 case 'v': 56 fprintf(stderr, "sent-"VERSION"\n"); 57 return 0; 58 + case 'f': 59 + fontfallbacks[0] = EARGF(usage()); 60 + break; 61 + case 'c': 62 + colors[0] = EARGF(usage()); 63 + break; 64 + case 'b': 65 + colors[1] = EARGF(usage()); 66 + break; 67 default: 68 usage(); 69 } ARGEND 70 -- 71 2.20.1 72