summaryrefslogtreecommitdiff
path: root/patches/sent-options-20190213-72d33d4.diff
blob: d13df48e707e19f129ad50dfb087d9eda0d0d20d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From 3a348cc15a97df8e8784b129800293dcfba28f3f Mon Sep 17 00:00:00 2001
From: Sunur Efe Vural <efe@efe.kim>
Date: Wed, 13 Feb 2019 14:28:17 -0500
Subject: [PATCH] Commandline Options

A simple patch that adds extra commandline options to sent.
---
 sent.1 | 11 +++++++++++
 sent.c | 11 ++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/sent.1 b/sent.1
index fabc614..5d55bf4 100644
--- a/sent.1
+++ b/sent.1
@@ -5,6 +5,9 @@
 .Nd simple plaintext presentation tool
 .Sh SYNOPSIS
 .Nm
+.Op Fl f Ar font
+.Op Fl c Ar fgcolor
+.Op Fl b Ar bgcolor
 .Op Fl v
 .Op Ar file
 .Sh DESCRIPTION
@@ -21,6 +24,14 @@ few minutes.
 .Bl -tag -width Ds
 .It Fl v
 Print version information to stdout and exit.
+.It Fl f Ar font
+Defines the
+.Ar font
+when sent is run.
+.It Fl c Ar fgcolor
+Defines the foreground color when sent is run.
+.It Fl b Ar bgcolor
+Defines the background color when sent is run.
 .El
 .Sh USAGE
 .Bl -tag -width Ds
diff --git a/sent.c b/sent.c
index c50a572..0b36e32 100644
--- a/sent.c
+++ b/sent.c
@@ -675,7 +675,7 @@ configure(XEvent *e)
 void
 usage()
 {
-	die("usage: %s [file]", argv0);
+	die("usage: %s [-c fgcolor] [-b bgcolor] [-f font] [file]", argv0);
 }
 
 int
@@ -687,6 +687,15 @@ main(int argc, char *argv[])
 	case 'v':
 		fprintf(stderr, "sent-"VERSION"\n");
 		return 0;
+	case 'f':
+		fontfallbacks[0] = EARGF(usage());
+		break;
+	case 'c':
+		colors[0] = EARGF(usage());
+		break;
+	case 'b':
+		colors[1] = EARGF(usage());
+		break;
 	default:
 		usage();
 	} ARGEND
-- 
2.20.1