diff options
-rw-r--r-- | fc-cache/fc-cache.c | 47 | ||||
-rw-r--r-- | fc-cache/fc-cache.sgml | 4 | ||||
-rw-r--r-- | fc-cat/fc-cat.c | 45 | ||||
-rw-r--r-- | fc-cat/fc-cat.sgml | 4 | ||||
-rw-r--r-- | fc-list/fc-list.c | 36 | ||||
-rw-r--r-- | fc-list/fc-list.sgml | 4 | ||||
-rw-r--r-- | fc-match/fc-match.c | 44 | ||||
-rw-r--r-- | fc-match/fc-match.sgml | 4 | ||||
-rw-r--r-- | fc-query/fc-query.c | 40 | ||||
-rw-r--r-- | fc-query/fc-query.sgml | 4 |
10 files changed, 125 insertions, 107 deletions
diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c index c11bb3d6..225c0854 100644 --- a/fc-cache/fc-cache.c +++ b/fc-cache/fc-cache.c @@ -72,7 +72,7 @@ const struct option longopts[] = { {"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 @@ -83,34 +83,35 @@ extern int optind, opterr, optopt; #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; @@ -373,9 +374,9 @@ main (int argc, char **argv) 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) { @@ -395,8 +396,10 @@ main (int argc, char **argv) case 'v': verbose = FcTrue; break; + case 'h': + usage (argv[0], 0); default: - usage (argv[0]); + usage (argv[0], 1); } } i = optind; diff --git a/fc-cache/fc-cache.sgml b/fc-cache/fc-cache.sgml index 62c0ddf4..20a7e85c 100644 --- a/fc-cache/fc-cache.sgml +++ b/fc-cache/fc-cache.sgml @@ -63,7 +63,7 @@ manpage.1: manpage.sgml <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> @@ -131,7 +131,7 @@ manpage.1: manpage.sgml </listitem> </varlistentry> <varlistentry> - <term><option>-?</option> + <term><option>-h</option> <option>--help</option> </term> <listitem> diff --git a/fc-cat/fc-cat.c b/fc-cat/fc-cat.c index 86a1c2f3..ec2b032a 100644 --- a/fc-cat/fc-cat.c +++ b/fc-cat/fc-cat.c @@ -56,7 +56,7 @@ const struct option longopts[] = { {"version", 0, 0, 'V'}, {"verbose", 0, 0, 'v'}, {"recurse", 0, 0, 'r'}, - {"help", 0, 0, '?'}, + {"help", 0, 0, 'h'}, {NULL,0,0,0}, }; #else @@ -146,32 +146,33 @@ write_string (FILE *f, const FcChar8 *string) } 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); } /* @@ -282,9 +283,9 @@ main (int argc, char **argv) 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) { @@ -298,8 +299,10 @@ main (int argc, char **argv) case 'r': recurse++; break; + case 'h': + usage (argv[0], 0); default: - usage (argv[0]); + usage (argv[0], 1); } } i = optind; diff --git a/fc-cat/fc-cat.sgml b/fc-cat/fc-cat.sgml index 94c74b25..69482b57 100644 --- a/fc-cat/fc-cat.sgml +++ b/fc-cat/fc-cat.sgml @@ -63,7 +63,7 @@ manpage.1: manpage.sgml <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> @@ -109,7 +109,7 @@ manpage.1: manpage.sgml </listitem> </varlistentry> <varlistentry> - <term><option>-?</option> + <term><option>-h</option> <option>--help</option> </term> <listitem> diff --git a/fc-list/fc-list.c b/fc-list/fc-list.c index 8384f28a..97baea4c 100644 --- a/fc-list/fc-list.c +++ b/fc-list/fc-list.c @@ -49,7 +49,7 @@ const struct option longopts[] = { {"version", 0, 0, 'V'}, {"verbose", 0, 0, 'v'}, - {"help", 0, 0, '?'}, + {"help", 0, 0, 'h'}, {NULL,0,0,0}, }; #else @@ -59,27 +59,29 @@ extern int optind, opterr, optopt; #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 @@ -94,9 +96,9 @@ main (int argc, char **argv) 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) { @@ -107,8 +109,10 @@ main (int argc, char **argv) case 'v': verbose = 1; break; + case 'h': + usage (argv[0], 0); default: - usage (argv[0]); + usage (argv[0], 1); } } i = optind; diff --git a/fc-list/fc-list.sgml b/fc-list/fc-list.sgml index f4a31477..35bf899d 100644 --- a/fc-list/fc-list.sgml +++ b/fc-list/fc-list.sgml @@ -63,7 +63,7 @@ manpage.1: manpage.sgml <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> @@ -100,7 +100,7 @@ manpage.1: manpage.sgml </listitem> </varlistentry> <varlistentry> - <term><option>-?</option> + <term><option>-h</option> <option>--help</option> </term> <listitem> diff --git a/fc-match/fc-match.c b/fc-match/fc-match.c index 05bf7746..5ed8deff 100644 --- a/fc-match/fc-match.c +++ b/fc-match/fc-match.c @@ -53,7 +53,7 @@ static const struct option longopts[] = { {"all", 0, 0, 'a'}, {"version", 0, 0, 'V'}, {"verbose", 0, 0, 'v'}, - {"help", 0, 0, '?'}, + {"help", 0, 0, 'h'}, {NULL,0,0,0}, }; #else @@ -63,31 +63,33 @@ extern int optind, opterr, optopt; #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 @@ -103,9 +105,9 @@ main (int argc, char **argv) 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) { @@ -122,8 +124,10 @@ main (int argc, char **argv) case 'v': verbose = 1; break; + case 'h': + usage (argv[0], 0); default: - usage (argv[0]); + usage (argv[0], 1); } } i = optind; diff --git a/fc-match/fc-match.sgml b/fc-match/fc-match.sgml index c2f699d5..b5ca6756 100644 --- a/fc-match/fc-match.sgml +++ b/fc-match/fc-match.sgml @@ -63,7 +63,7 @@ manpage.1: manpage.sgml <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> @@ -103,7 +103,7 @@ are printed. The <option>--all</option> option works like </listitem> </varlistentry> <varlistentry> - <term><option>-?</option> + <term><option>-h</option> <option>--help</option> </term> <listitem> diff --git a/fc-query/fc-query.c b/fc-query/fc-query.c index 2a36bf04..6ea45ea5 100644 --- a/fc-query/fc-query.c +++ b/fc-query/fc-query.c @@ -54,7 +54,7 @@ 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 @@ -64,28 +64,30 @@ extern int optind, opterr, optopt; #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 @@ -100,9 +102,9 @@ main (int argc, char **argv) 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) { @@ -114,8 +116,10 @@ main (int argc, char **argv) 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; @@ -124,7 +128,7 @@ main (int argc, char **argv) #endif if (i == argc) - usage (argv[0]); + usage (argv[0], 1); if (!FcInit ()) { diff --git a/fc-query/fc-query.sgml b/fc-query/fc-query.sgml index 4a1a5e6a..2c731291 100644 --- a/fc-query/fc-query.sgml +++ b/fc-query/fc-query.sgml @@ -62,7 +62,7 @@ manpage.1: manpage.sgml <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> @@ -93,7 +93,7 @@ manpage.1: manpage.sgml <variablelist> <varlistentry> - <term><option>-?</option> + <term><option>-h</option> <option>--help</option> </term> <listitem> |