summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-06 19:14:31 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-06 19:14:31 -0300
commitae5c02bbe7498b38f6173d31b900170ae8e54ddc (patch)
tree5029e73220a66b19482f2bc3c2c8d392d5709d34 /main.c
parentb3e7bfacea40336e4f855f662a8c88a31e94f007 (diff)
downloadeeshow-ae5c02bbe7498b38f6173d31b900170ae8e54ddc.tar.gz
eeshow-ae5c02bbe7498b38f6173d31b900170ae8e54ddc.tar.bz2
eeshow-ae5c02bbe7498b38f6173d31b900170ae8e54ddc.zip
eeshow/: use printf-style formatting for overlay text; test mode -F fmt string
Diffstat (limited to 'main.c')
-rw-r--r--main.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/main.c b/main.c
index 815b556..0960015 100644
--- a/main.c
+++ b/main.c
@@ -27,6 +27,7 @@
#include "file.h"
#include "lib.h"
#include "sch.h"
+#include "fmt-pango.h"
#include "git-hist.h"
#include "gui.h"
#include "main.h"
@@ -94,6 +95,7 @@ int main(int argc, char **argv)
bool recurse = 0;
const char *cat = NULL;
const char *history = NULL;
+ const char *fmt = NULL;
char c;
int arg, dashdash;
bool have_dashdash = 0;
@@ -110,7 +112,7 @@ int main(int argc, char **argv)
if (!have_dashdash)
gtk_init(&argc, &argv);
- while ((c = getopt(dashdash, argv, "rvC:H:")) != EOF)
+ while ((c = getopt(dashdash, argv, "rvC:F:H:")) != EOF)
switch (c) {
case 'r':
recurse = 1;
@@ -121,6 +123,9 @@ int main(int argc, char **argv)
case 'C':
cat = optarg;
break;
+ case 'F':
+ fmt = optarg;
+ break;
case 'H':
history = optarg;
break;
@@ -149,6 +154,14 @@ int main(int argc, char **argv)
return 0;
}
+ if (fmt) {
+ char *buf;
+
+ buf = fmt_pango(fmt, argv[optind]);
+ printf("\"%s\"\n", buf);
+ return 0;
+ }
+
if (dashdash - optind < 1)
usage(*argv);