{"system-only", 0, 0, 's'},
{"version", 0, 0, 'V'},
{"verbose", 0, 0, 'v'},
- {"help", 0, 0, '?'},
+ {"help", 0, 0, 'h'},
{NULL,0,0,0},
};
#else
#endif
static void
-usage (char *program)
+usage (char *program, int error)
{
+ FILE *file = error ? stderr : stdout;
#if HAVE_GETOPT_LONG
- fprintf (stderr, "usage: %s [-frsvV?] [--force|--really-force] [--system-only] [--verbose] [--version] [--help] [dirs]\n",
+ fprintf (file, "usage: %s [-frsvVh] [--force|--really-force] [--system-only] [--verbose] [--version] [--help] [dirs]\n",
program);
#else
- fprintf (stderr, "usage: %s [-frsvV?] [dirs]\n",
+ fprintf (file, "usage: %s [-frsvVh] [dirs]\n",
program);
#endif
- fprintf (stderr, "Build font information caches in [dirs]\n"
+ fprintf (file, "Build font information caches in [dirs]\n"
"(all directories in font configuration by default).\n");
- fprintf (stderr, "\n");
+ fprintf (file, "\n");
#if HAVE_GETOPT_LONG
- fprintf (stderr, " -f, --force scan directories with apparently valid caches\n");
- fprintf (stderr, " -r, --really-force erase all existing caches, then rescan\n");
- fprintf (stderr, " -s, --system-only scan system-wide directories only\n");
- fprintf (stderr, " -v, --verbose display status information while busy\n");
- fprintf (stderr, " -V, --version display font config version and exit\n");
- fprintf (stderr, " -?, --help display this help and exit\n");
+ fprintf (file, " -f, --force scan directories with apparently valid caches\n");
+ fprintf (file, " -r, --really-force erase all existing caches, then rescan\n");
+ fprintf (file, " -s, --system-only scan system-wide directories only\n");
+ fprintf (file, " -v, --verbose display status information while busy\n");
+ fprintf (file, " -V, --version display font config version and exit\n");
+ fprintf (file, " -h, --help display this help and exit\n");
#else
- fprintf (stderr, " -f (force) scan directories with apparently valid caches\n");
- fprintf (stderr, " -r, (really force) erase all existing caches, then rescan\n");
- fprintf (stderr, " -s (system) scan system-wide directories only\n");
- fprintf (stderr, " -v (verbose) display status information while busy\n");
- fprintf (stderr, " -V (version) display font config version and exit\n");
- fprintf (stderr, " -? (help) display this help and exit\n");
+ fprintf (file, " -f (force) scan directories with apparently valid caches\n");
+ fprintf (file, " -r, (really force) erase all existing caches, then rescan\n");
+ fprintf (file, " -s (system) scan system-wide directories only\n");
+ fprintf (file, " -v (verbose) display status information while busy\n");
+ fprintf (file, " -V (version) display font config version and exit\n");
+ fprintf (file, " -h (help) display this help and exit\n");
#endif
- exit (1);
+ exit (error);
}
static FcStrSet *processed_dirs;
int c;
#if HAVE_GETOPT_LONG
- while ((c = getopt_long (argc, argv, "frsVv?", longopts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "frsVvh", longopts, NULL)) != -1)
#else
- while ((c = getopt (argc, argv, "frsVv?")) != -1)
+ while ((c = getopt (argc, argv, "frsVvh")) != -1)
#endif
{
switch (c) {
case 'v':
verbose = FcTrue;
break;
+ case 'h':
+ usage (argv[0], 0);
default:
- usage (argv[0]);
+ usage (argv[0], 1);
}
}
i = optind;
<cmdsynopsis>
<command>&dhpackage;</command>
- <arg><option>-fsvV?</option></arg>
+ <arg><option>-fsvVh</option></arg>
<arg><option>--force</option></arg>
<arg><option>--system-only</option></arg>
<arg><option>--verbose</option></arg>
</listitem>
</varlistentry>
<varlistentry>
- <term><option>-?</option>
+ <term><option>-h</option>
<option>--help</option>
</term>
<listitem>
{"version", 0, 0, 'V'},
{"verbose", 0, 0, 'v'},
{"recurse", 0, 0, 'r'},
- {"help", 0, 0, '?'},
+ {"help", 0, 0, 'h'},
{NULL,0,0,0},
};
#else
}
static void
-usage (char *program)
+usage (char *program, int error)
{
+ FILE *file = error ? stderr : stdout;
#if HAVE_GETOPT_LONG
- fprintf (stderr, "usage: %s [-rv] [--recurse] [--verbose] [*-%s.cache-2|directory]...\n",
+ fprintf (file, "usage: %s [-rv] [--recurse] [--verbose] [*-%s.cache-2|directory]...\n",
program, FC_ARCHITECTURE);
- fprintf (stderr, " %s [-V?] [--version] [--help]\n", program);
+ fprintf (file, " %s [-Vh] [--version] [--help]\n", program);
#else
- fprintf (stderr, "usage: %s [-rvV?] [*-%s.cache-2|directory]...\n",
+ fprintf (file, "usage: %s [-rvVh] [*-%s.cache-2|directory]...\n",
program, FC_ARCHITECTURE);
#endif
- fprintf (stderr, "Reads font information cache from:\n");
- fprintf (stderr, " 1) specified fontconfig cache file\n");
- fprintf (stderr, " 2) related to a particular font directory\n");
- fprintf (stderr, "\n");
+ fprintf (file, "Reads font information cache from:\n");
+ fprintf (file, " 1) specified fontconfig cache file\n");
+ fprintf (file, " 2) related to a particular font directory\n");
+ fprintf (file, "\n");
#if HAVE_GETOPT_LONG
- fprintf (stderr, " -r, --recurse recurse into subdirectories\n");
- fprintf (stderr, " -v, --verbose be verbose\n");
- fprintf (stderr, " -V, --version display font config version and exit\n");
- fprintf (stderr, " -?, --help display this help and exit\n");
+ fprintf (file, " -r, --recurse recurse into subdirectories\n");
+ fprintf (file, " -v, --verbose be verbose\n");
+ fprintf (file, " -V, --version display font config version and exit\n");
+ fprintf (file, " -h, --help display this help and exit\n");
#else
- fprintf (stderr, " -r (recurse) recurse into subdirectories\n");
- fprintf (stderr, " -v (verbose) be verbose\n");
- fprintf (stderr, " -V (version) display font config version and exit\n");
- fprintf (stderr, " -? (help) display this help and exit\n");
+ fprintf (file, " -r (recurse) recurse into subdirectories\n");
+ fprintf (file, " -v (verbose) be verbose\n");
+ fprintf (file, " -V (version) display font config version and exit\n");
+ fprintf (file, " -h (help) display this help and exit\n");
#endif
- exit (1);
+ exit (error);
}
/*
int c;
#if HAVE_GETOPT_LONG
- while ((c = getopt_long (argc, argv, "Vvr?", longopts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "Vvrh", longopts, NULL)) != -1)
#else
- while ((c = getopt (argc, argv, "Vvr?")) != -1)
+ while ((c = getopt (argc, argv, "Vvrh")) != -1)
#endif
{
switch (c) {
case 'r':
recurse++;
break;
+ case 'h':
+ usage (argv[0], 0);
default:
- usage (argv[0]);
+ usage (argv[0], 1);
}
}
i = optind;
<cmdsynopsis>
<command>&dhpackage;</command>
- <arg><option>-rvV?</option></arg>
+ <arg><option>-rvVh</option></arg>
<arg><option>--recurse</option></arg>
<arg><option>--verbose</option></arg>
<arg><option>--version</option></arg>
</listitem>
</varlistentry>
<varlistentry>
- <term><option>-?</option>
+ <term><option>-h</option>
<option>--help</option>
</term>
<listitem>
const struct option longopts[] = {
{"version", 0, 0, 'V'},
{"verbose", 0, 0, 'v'},
- {"help", 0, 0, '?'},
+ {"help", 0, 0, 'h'},
{NULL,0,0,0},
};
#else
#endif
#endif
-static void usage (char *program)
+static void
+usage (char *program, int error)
{
+ FILE *file = error ? stderr : stdout;
#if HAVE_GETOPT_LONG
- fprintf (stderr, "usage: %s [-vV?] [--verbose] [--version] [--help] [pattern] {element ...} \n",
+ fprintf (file, "usage: %s [-vVh] [--verbose] [--version] [--help] [pattern] {element ...} \n",
program);
#else
- fprintf (stderr, "usage: %s [-vV?] [pattern] {element ...} \n",
+ fprintf (file, "usage: %s [-vVh] [pattern] {element ...} \n",
program);
#endif
- fprintf (stderr, "List fonts matching [pattern]\n");
- fprintf (stderr, "\n");
+ fprintf (file, "List fonts matching [pattern]\n");
+ fprintf (file, "\n");
#if HAVE_GETOPT_LONG
- fprintf (stderr, " -v, --verbose display entire font pattern\n");
- fprintf (stderr, " -V, --version display font config version and exit\n");
- fprintf (stderr, " -?, --help display this help and exit\n");
+ fprintf (file, " -v, --verbose display entire font pattern\n");
+ fprintf (file, " -V, --version display font config version and exit\n");
+ fprintf (file, " -h, --help display this help and exit\n");
#else
- fprintf (stderr, " -v (verbose) display entire font pattern\n");
- fprintf (stderr, " -V (version) display font config version and exit\n");
- fprintf (stderr, " -? (help) display this help and exit\n");
+ fprintf (file, " -v (verbose) display entire font pattern\n");
+ fprintf (file, " -V (version) display font config version and exit\n");
+ fprintf (file, " -h (help) display this help and exit\n");
#endif
- exit (1);
+ exit (error);
}
int
int c;
#if HAVE_GETOPT_LONG
- while ((c = getopt_long (argc, argv, "Vv?", longopts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "Vvh", longopts, NULL)) != -1)
#else
- while ((c = getopt (argc, argv, "Vv?")) != -1)
+ while ((c = getopt (argc, argv, "Vvh")) != -1)
#endif
{
switch (c) {
case 'v':
verbose = 1;
break;
+ case 'h':
+ usage (argv[0], 0);
default:
- usage (argv[0]);
+ usage (argv[0], 1);
}
}
i = optind;
<cmdsynopsis>
<command>&dhpackage;</command>
- <arg><option>-vV?</option></arg>
+ <arg><option>-vVh</option></arg>
<arg><option>--verbose</option></arg>
<arg><option>--version</option></arg>
<arg><option>--help</option></arg>
</listitem>
</varlistentry>
<varlistentry>
- <term><option>-?</option>
+ <term><option>-h</option>
<option>--help</option>
</term>
<listitem>
{"all", 0, 0, 'a'},
{"version", 0, 0, 'V'},
{"verbose", 0, 0, 'v'},
- {"help", 0, 0, '?'},
+ {"help", 0, 0, 'h'},
{NULL,0,0,0},
};
#else
#endif
#endif
-static void usage (char *program)
+static void
+usage (char *program, int error)
{
+ FILE *file = error ? stderr : stdout;
#if HAVE_GETOPT_LONG
- fprintf (stderr, "usage: %s [-savV?] [--sort] [--all] [--verbose] [--version] [--help] [pattern]\n",
+ fprintf (file, "usage: %s [-savVh] [--sort] [--all] [--verbose] [--version] [--help] [pattern]\n",
program);
#else
- fprintf (stderr, "usage: %s [-savV?] [pattern]\n",
+ fprintf (file, "usage: %s [-savVh] [pattern]\n",
program);
#endif
- fprintf (stderr, "List fonts matching [pattern]\n");
- fprintf (stderr, "\n");
+ fprintf (file, "List fonts matching [pattern]\n");
+ fprintf (file, "\n");
#if HAVE_GETOPT_LONG
- fprintf (stderr, " -s, --sort display sorted list of matches\n");
- fprintf (stderr, " -a, --all display unpruned sorted list of matches\n");
- fprintf (stderr, " -v, --verbose display entire font pattern\n");
- fprintf (stderr, " -V, --version display font config version and exit\n");
- fprintf (stderr, " -?, --help display this help and exit\n");
+ fprintf (file, " -s, --sort display sorted list of matches\n");
+ fprintf (file, " -a, --all display unpruned sorted list of matches\n");
+ fprintf (file, " -v, --verbose display entire font pattern\n");
+ fprintf (file, " -V, --version display font config version and exit\n");
+ fprintf (file, " -h, --help display this help and exit\n");
#else
- fprintf (stderr, " -s, (sort) display sorted list of matches\n");
- fprintf (stderr, " -a (all) display unpruned sorted list of matches\n");
- fprintf (stderr, " -v (verbose) display entire font pattern\n");
- fprintf (stderr, " -V (version) display font config version and exit\n");
- fprintf (stderr, " -? (help) display this help and exit\n");
+ fprintf (file, " -s, (sort) display sorted list of matches\n");
+ fprintf (file, " -a (all) display unpruned sorted list of matches\n");
+ fprintf (file, " -v (verbose) display entire font pattern\n");
+ fprintf (file, " -V (version) display font config version and exit\n");
+ fprintf (file, " -h (help) display this help and exit\n");
#endif
- exit (1);
+ exit (error);
}
int
int c;
#if HAVE_GETOPT_LONG
- while ((c = getopt_long (argc, argv, "asVv?", longopts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "asVvh", longopts, NULL)) != -1)
#else
- while ((c = getopt (argc, argv, "asVv?")) != -1)
+ while ((c = getopt (argc, argv, "asVvh")) != -1)
#endif
{
switch (c) {
case 'v':
verbose = 1;
break;
+ case 'h':
+ usage (argv[0], 0);
default:
- usage (argv[0]);
+ usage (argv[0], 1);
}
}
i = optind;
<cmdsynopsis>
<command>&dhpackage;</command>
- <arg><option>-asvV?</option></arg>
+ <arg><option>-asvVh</option></arg>
<arg><option>--all</option></arg>
<arg><option>--sort</option></arg>
<arg><option>--verbose</option></arg>
</listitem>
</varlistentry>
<varlistentry>
- <term><option>-?</option>
+ <term><option>-h</option>
<option>--help</option>
</term>
<listitem>
static const struct option longopts[] = {
{"index", 1, 0, 'i'},
{"version", 0, 0, 'V'},
- {"help", 0, 0, '?'},
+ {"help", 0, 0, 'h'},
{NULL,0,0,0},
};
#else
#endif
#endif
-static void usage (char *program)
+static void
+usage (char *program, int error)
{
+ FILE *file = error ? stderr : stdout;
#if HAVE_GETOPT_LONG
- fprintf (stderr, "usage: %s [-V?] [-i index] [--index index] [--version] [--help] font-file...\n",
+ fprintf (file, "usage: %s [-Vh] [-i index] [--index index] [--version] [--help] font-file...\n",
program);
#else
- fprintf (stderr, "usage: %s [-V?] [-i index] font-file...\n",
+ fprintf (file, "usage: %s [-Vh] [-i index] font-file...\n",
program);
#endif
- fprintf (stderr, "Query font files and print resulting pattern(s)\n");
- fprintf (stderr, "\n");
+ fprintf (file, "Query font files and print resulting pattern(s)\n");
+ fprintf (file, "\n");
#if HAVE_GETOPT_LONG
- fprintf (stderr, " -i, --index INDEX display the INDEX face of each font file only\n");
- fprintf (stderr, " -V, --version display font config version and exit\n");
- fprintf (stderr, " -?, --help display this help and exit\n");
+ fprintf (file, " -i, --index INDEX display the INDEX face of each font file only\n");
+ fprintf (file, " -V, --version display font config version and exit\n");
+ fprintf (file, " -h, --help display this help and exit\n");
#else
- fprintf (stderr, " -i INDEX (index) display the INDEX face of each font file only\n");
- fprintf (stderr, " -a (all) display unpruned sorted list of matches\n");
- fprintf (stderr, " -V (version) display font config version and exit\n");
- fprintf (stderr, " -? (help) display this help and exit\n");
+ fprintf (file, " -i INDEX (index) display the INDEX face of each font file only\n");
+ fprintf (file, " -a (all) display unpruned sorted list of matches\n");
+ fprintf (file, " -V (version) display font config version and exit\n");
+ fprintf (file, " -h (help) display this help and exit\n");
#endif
- exit (1);
+ exit (error);
}
int
int c;
#if HAVE_GETOPT_LONG
- while ((c = getopt_long (argc, argv, "i:sVv?", longopts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "i:sVvh", longopts, NULL)) != -1)
#else
- while ((c = getopt (argc, argv, "i:asVv?")) != -1)
+ while ((c = getopt (argc, argv, "i:asVvh")) != -1)
#endif
{
switch (c) {
fprintf (stderr, "fontconfig version %d.%d.%d\n",
FC_MAJOR, FC_MINOR, FC_REVISION);
exit (0);
+ case 'h':
+ usage (argv[0], 0);
default:
- usage (argv[0]);
+ usage (argv[0], 1);
}
}
i = optind;
#endif
if (i == argc)
- usage (argv[0]);
+ usage (argv[0], 1);
if (!FcInit ())
{
<cmdsynopsis>
<command>&dhpackage;</command>
- <arg><option>-V?</option></arg>
+ <arg><option>-Vh</option></arg>
<arg><option>--version</option></arg>
<arg><option>--help</option></arg>
<sbr>
<variablelist>
<varlistentry>
- <term><option>-?</option>
+ <term><option>-h</option>
<option>--help</option>
</term>
<listitem>