summaryrefslogtreecommitdiff
path: root/pango-view
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-03-16 17:25:33 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-03-16 17:25:33 -0400
commitc82e8ad9dda142b1acfbcb86054750e082600893 (patch)
tree7dc3241e3a661718f770c0854658de18ee7300aa /pango-view
parent69e1f7921525c2849d937b5a822475007a4f9a2f (diff)
downloadpango-c82e8ad9dda142b1acfbcb86054750e082600893.tar.gz
Bug 547963 – man page for pango-view
Diffstat (limited to 'pango-view')
-rw-r--r--pango-view/Makefile.am26
-rw-r--r--pango-view/viewer-main.c1
-rw-r--r--pango-view/viewer-render.c13
3 files changed, 32 insertions, 8 deletions
diff --git a/pango-view/Makefile.am b/pango-view/Makefile.am
index 08bd4744..3ff5b5c3 100644
--- a/pango-view/Makefile.am
+++ b/pango-view/Makefile.am
@@ -37,6 +37,7 @@ INCLUDES = \
$(X_CFLAGS)
#########################################################
+
bin_PROGRAMS = pango-view
pango_view_SOURCES = \
viewer-render.h \
@@ -80,6 +81,31 @@ pango_view_LDADD += \
../pango/libpangocairo-$(PANGO_API_VERSION).la \
$(CAIRO_LIBS)
endif
+
+#########################################################
+
+MAINTAINERCLEANFILES = pango-view.1
+
+dist_man_MANS = pango-view.1
+
+$(srcdir)/pango-view.1: ../configure.in $(pango_view_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) pango-view
+ @echo "Creating $@ using help2man(1)"
+ @$(top_builddir)/missing --run \
+ help2man --no-info --section=1 \
+ --help-option="--help-all" --output="$@.tmp" \
+ --name 'Pango text viewer' ./pango-view \
+ && mv "$@.tmp" "$@" \
+ || ($(RM) "$@"; \
+ echo Failed to update pango-view.1, the man page may be outdated >&2; \
+ (test -f "$@" || echo help2man is required to generate this file. >> "$@"));
+
+install-data-hook:
+ @cd "$(DESTDIR)$(man1dir)" && gzip -c pango-view.1 > preload.1.gz && $(RM) preload.1
+
+uninstall-hook:
+ $(RM) "$(DESTDIR)$(man1dir)/pango-view.1.gz"
+
#########################################################
BUILT_SOURCES = pangorc
diff --git a/pango-view/viewer-main.c b/pango-view/viewer-main.c
index 61c43ee5..8ff76bbc 100644
--- a/pango-view/viewer-main.c
+++ b/pango-view/viewer-main.c
@@ -48,6 +48,7 @@ main (int argc,
gpointer surface;
g_type_init();
+ g_set_prgname ("pango-view");
setlocale (LC_ALL, "");
parse_options (argc, argv);
diff --git a/pango-view/viewer-render.c b/pango-view/viewer-render.c
index b3ee52b5..c698b459 100644
--- a/pango-view/viewer-render.c
+++ b/pango-view/viewer-render.c
@@ -32,8 +32,6 @@
#include "viewer-render.h"
-const char *prog_name;
-
gboolean opt_display = TRUE;
int opt_dpi = 96;
const char *opt_font = "";
@@ -79,7 +77,7 @@ fail (const char *format, ...)
va_list vap;
va_start (vap, format);
msg = g_strdup_vprintf (format, vap);
- g_printerr ("%s: %s\n", prog_name, msg);
+ g_printerr ("%s: %s\n", g_get_prgname (), msg);
exit (1);
}
@@ -630,11 +628,11 @@ show_version(const char *name G_GNUC_UNUSED,
gpointer data G_GNUC_UNUSED,
GError **error G_GNUC_UNUSED)
{
- g_printf("%s (%s) %s\n", prog_name, PACKAGE_NAME, PACKAGE_VERSION);
- g_printf("module interface version: %s\n", MODULE_VERSION);
+ g_printf("%s (%s) %s\n", g_get_prgname (), PACKAGE_NAME, PACKAGE_VERSION);
+ g_printf("\nPango module interface version: %s\n", MODULE_VERSION);
if (PANGO_VERSION != pango_version())
- g_printf("\nLinked Pango library has a different version: %s\n", pango_version_string ());
+ g_printf("Linked Pango library has a different version: %s\n", pango_version_string ());
exit(0);
}
@@ -715,7 +713,6 @@ parse_options (int argc, char *argv[])
size_t len;
const PangoViewer **viewer;
- prog_name = g_path_get_basename (argv[0]);
context = g_option_context_new ("- FILE");
g_option_context_add_main_entries (context, entries, NULL);
@@ -744,7 +741,7 @@ parse_options (int argc, char *argv[])
if (opt_text && argc != 1)
fail ("When specifying --text, no file should be given");
- g_printerr ("Usage: %s [OPTION...] FILE\n", prog_name);
+ g_printerr ("Usage: %s [OPTION...] FILE\n", g_get_prgname ());
exit (1);
}