summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 47601cb)
raw | patch | inline | side by side (parent: 47601cb)
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | |
Tue, 16 Feb 2010 11:30:35 +0000 (11:30 +0000) | ||
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | |
Tue, 16 Feb 2010 11:33:19 +0000 (11:33 +0000) |
g_setprgname is implicitly called by g_option_context_new() with a check
to see if it's been set already, so set it before g_option_context_new()
Move version printing back until after the options have been parsed,
otherwise it won't work, since it evaluates a flag set by the
option parser.
to see if it's been set already, so set it before g_option_context_new()
Move version printing back until after the options have been parsed,
otherwise it won't work, since it evaluates a flag set by the
option parser.
diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c
index 13d76da5d4a89a5208ce1e8d10e0e7208c321726..4f2723d1529a875a7ceddcfc42ff86c1b24c9291 100644 (file)
--- a/tools/gst-inspect.c
+++ b/tools/gst-inspect.c
g_thread_init (NULL);
+ gst_tools_set_prgname ("gst-inspect");
+
#ifndef GST_DISABLE_OPTION_PARSING
ctx = g_option_context_new ("[ELEMENT-NAME | PLUGIN-NAME]");
g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
diff --git a/tools/gst-launch.c b/tools/gst-launch.c
index 591d631101d88e55c80f281eed193a31c0b3abc8..cb9b8e2f2e13b1c1f933f2eb231cd380a3893936 100644 (file)
--- a/tools/gst-launch.c
+++ b/tools/gst-launch.c
g_thread_init (NULL);
+ gst_tools_set_prgname ("gst-launch");
+
#ifndef GST_DISABLE_OPTION_PARSING
ctx = g_option_context_new ("PIPELINE-DESCRIPTION");
g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
diff --git a/tools/gst-typefind.c b/tools/gst-typefind.c
index d51f282496710ee76af3f634503f37e6673e693b..53635d620e6aed65d092957d58a8d6e80a6af0e7 100644 (file)
--- a/tools/gst-typefind.c
+++ b/tools/gst-typefind.c
g_thread_init (NULL);
- gst_tools_print_version ("gst-typefind");
+ gst_tools_set_prgname ("gst-typefind");
ctx = g_option_context_new ("FILES");
g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
}
g_option_context_free (ctx);
+ gst_tools_print_version ("gst-typefind");
+
if (filenames == NULL || *filenames == NULL) {
g_print ("Please give a filename to typefind\n\n");
return 1;
diff --git a/tools/gst-xmlinspect.c b/tools/gst-xmlinspect.c
index 6a8b6fdce8ba56477d23418472de4edf91fc38b7..4e608071ffb0ff316bbb628c84f2d7c44fbde203 100644 (file)
--- a/tools/gst-xmlinspect.c
+++ b/tools/gst-xmlinspect.c
g_thread_init (NULL);
- gst_tools_print_version ("gst-xmlinspect");
+ gst_tools_set_prgname ("gst-xmlinspect");
ctx = g_option_context_new ("[ELEMENT-NAME]");
g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
}
g_option_context_free (ctx);
+ gst_tools_print_version ("gst-xmlinspect");
+
/* if no arguments, print out all elements */
if (argc == 1) {
GList *features, *f;
diff --git a/tools/tools.h b/tools/tools.h
index a4e3371eded118fa5f9757e9c72f9088026e23bc..93ac542eebbf44687b3b6496bbe5ea50a1ec3467 100644 (file)
--- a/tools/tools.h
+++ b/tools/tools.h
static void
gst_tools_print_version (const gchar * tool)
{
- gchar *s;
-
- s = g_strdup_printf ("%s-%u.%u", tool, GST_VERSION_MAJOR, GST_VERSION_MINOR);
- g_set_prgname (s);
- g_free (s);
-
if (__gst_tools_version) {
gchar *version_str;
}
}
+static void
+gst_tools_set_prgname (const gchar * tool)
+{
+ gchar *s;
+
+ s = g_strdup_printf ("%s-%u.%u", tool, GST_VERSION_MAJOR, GST_VERSION_MINOR);
+ g_set_prgname (s);
+ g_free (s);
+}
+
#endif /* __GST_TOOLS_H__ */