summaryrefslogtreecommitdiff
path: root/fc-list
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-01-15 19:12:37 -0500
committerBehdad Esfahbod <behdad@behdad.org>2009-02-13 16:54:07 -0800
commit41af588f543ca5c0efaeb699992376d89cb35763 (patch)
treefdc8473b31d51e8fdb61cffc7c763485831ac1e8 /fc-list
parent263f16ced279b0c09834bb4ca0df87fd0f76dcaf (diff)
[fc-match] Accept list of elements like fc-list (bug #13017)
Also make --verbose not ignore list of elements and only print those. Update docs.
Diffstat (limited to 'fc-list')
-rw-r--r--fc-list/fc-list.c29
-rw-r--r--fc-list/fc-list.sgml12
2 files changed, 20 insertions, 21 deletions
diff --git a/fc-list/fc-list.c b/fc-list/fc-list.c
index f7a66b59..470b4b93 100644
--- a/fc-list/fc-list.c
+++ b/fc-list/fc-list.c
@@ -76,13 +76,13 @@ usage (char *program, int error)
fprintf (file, "List fonts matching [pattern]\n");
fprintf (file, "\n");
#if HAVE_GETOPT_LONG
- fprintf (file, " -v, --verbose display entire font pattern\n");
+ fprintf (file, " -v, --verbose display entire font pattern verbosely\n");
fprintf (file, " -f, --format=FORMAT use the given output format\n");
fprintf (file, " -q, --quiet suppress all normal output, exit 1 if no fonts matched\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, " -v (verbose) display entire font pattern\n");
+ fprintf (file, " -v (verbose) display entire font pattern verbosely\n");
fprintf (file, " -f FORMAT (format) use the given output format\n");
fprintf (file, " -q, (quiet) suppress all normal output, exit 1 if no fonts matched\n");
fprintf (file, " -V (version) display font config version and exit\n");
@@ -144,13 +144,12 @@ main (int argc, char **argv)
if (argv[i])
{
pat = FcNameParse ((FcChar8 *) argv[i]);
- if (!verbose)
- while (argv[++i])
- {
- if (!os)
- os = FcObjectSetCreate ();
- FcObjectSetAdd (os, argv[i]);
- }
+ while (argv[++i])
+ {
+ if (!os)
+ os = FcObjectSetCreate ();
+ FcObjectSetAdd (os, argv[i]);
+ }
}
else
pat = FcPatternCreate ();
@@ -170,9 +169,6 @@ main (int argc, char **argv)
for (j = 0; j < fs->nfont; j++)
{
- FcChar8 *font;
- FcChar8 *file;
-
if (verbose)
{
FcPatternPrint (fs->fonts[j]);
@@ -187,11 +183,14 @@ main (int argc, char **argv)
}
else
{
- font = FcNameUnparse (fs->fonts[j]);
+ FcChar8 *str;
+ FcChar8 *file;
+
+ str = FcNameUnparse (fs->fonts[j]);
if (FcPatternGetString (fs->fonts[j], FC_FILE, 0, &file) == FcResultMatch)
printf ("%s: ", file);
- printf ("%s\n", font);
- free (font);
+ printf ("%s\n", str);
+ free (str);
}
}
}
diff --git a/fc-list/fc-list.sgml b/fc-list/fc-list.sgml
index cc987794..ffa08914 100644
--- a/fc-list/fc-list.sgml
+++ b/fc-list/fc-list.sgml
@@ -81,9 +81,9 @@ manpage.1: manpage.sgml
<para><command>&dhpackage;</command> lists fonts and styles
available on the system for applications using fontconfig.
- With <option>--verbose</option>, the whole font pattern
- for each font is printed, otherwise only the elements requested
- are printed (family and style if none provided).</para>
+ If any elements are specified, only those are printed.
+ Otherwise family and style are printed, unless verbose
+ output is requested.</para>
</refsect1>
<refsect1>
<title>OPTIONS</title>
@@ -98,9 +98,9 @@ manpage.1: manpage.sgml
<option>--verbose</option>
</term>
<listitem>
- <para>Print whole font pattern for each match. Provided
- <replaceable>element</replaceable>s are ignored in this
- case.</para>
+ <para>Print verbose output of the whole font pattern for each match,
+ or <replaceable>element</replaceable>s if any is
+ provided.</para>
</listitem>
</varlistentry>
<varlistentry>