diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2017-09-15 01:11:34 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2017-09-20 13:13:35 -0700 |
commit | 2a41738fd7c88e2b6977673f91bdb8d1f7224cf1 (patch) | |
tree | 3ac91db133053744bbb7268a86f6cd635a76d49e /fc-scan/fc-scan.c | |
parent | dc8326d3f116bb2a1425aa68660a332e351b6cb4 (diff) |
[fc-match/fc-list/fc-query/fc-scan] Add --brief that is like --verbose without charset
Diffstat (limited to 'fc-scan/fc-scan.c')
-rw-r--r-- | fc-scan/fc-scan.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/fc-scan/fc-scan.c b/fc-scan/fc-scan.c index 58a0b152..41bd2606 100644 --- a/fc-scan/fc-scan.c +++ b/fc-scan/fc-scan.c @@ -52,6 +52,7 @@ #define _GNU_SOURCE #include <getopt.h> static const struct option longopts[] = { + {"brief", 0, 0, 'b'}, {"format", 1, 0, 'f'}, {"version", 0, 0, 'V'}, {"help", 0, 0, 'h'}, @@ -69,19 +70,21 @@ usage (char *program, int error) { FILE *file = error ? stderr : stdout; #if HAVE_GETOPT_LONG - fprintf (file, "usage: %s [-Vh] [-f FORMAT] [--format FORMAT] [--version] [--help] font-file...\n", + fprintf (file, "usage: %s [-bVh] [-f FORMAT] [--brief] [--format FORMAT] [--version] [--help] font-file...\n", program); #else - fprintf (file, "usage: %s [-Vh] [-f FORMAT] font-file...\n", + fprintf (file, "usage: %s [-bVh] [-f FORMAT] font-file...\n", program); #endif fprintf (file, "Scan font files and directories, and print resulting pattern(s)\n"); fprintf (file, "\n"); #if HAVE_GETOPT_LONG + fprintf (file, " -b, --brief display font pattern briefly\n"); fprintf (file, " -f, --format=FORMAT use the given output format\n"); fprintf (file, " -V, --version display font config version and exit\n"); fprintf (file, " -h, --help display this help and exit\n"); #else + fprintf (file, " -b (brief) display font pattern briefly\n"); fprintf (file, " -f FORMAT (format) use the given output format\n"); fprintf (file, " -V (version) display font config version and exit\n"); fprintf (file, " -h (help) display this help and exit\n"); @@ -92,6 +95,7 @@ usage (char *program, int error) int main (int argc, char **argv) { + int brief = 0; FcChar8 *format = NULL; int i; FcFontSet *fs; @@ -105,6 +109,9 @@ main (int argc, char **argv) #endif { switch (c) { + case 'b': + brief = 1; + break; case 'f': format = (FcChar8 *) strdup (optarg); break; @@ -152,6 +159,12 @@ main (int argc, char **argv) { FcPattern *pat = fs->fonts[i]; + if (brief) + { + FcPatternDel (pat, FC_CHARSET); + FcPatternDel (pat, FC_LANG); + } + if (format) { FcChar8 *s; |