From ae5f02d5c41eb53c09b802f722337c6dc25648e1 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Mon, 14 Jun 2004 11:28:16 +0000 Subject: [PATCH] Simplify, remove -n and always print names if -a is specified Original commit message from CVS: (main): Simplify, remove -n and always print names if -a is specified --- ChangeLog | 1 + tools/gst-inspect.c | 14 ++++---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index ddf967217c..7626368a22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * tools/gst-inspect.c (main): Add two new command line options: -a to print all elements and -n to print the name on each line. Also fix some error reporting. + (main): Simplify, remove -n and always print names if -a is specified 2004-06-13 Steve Lhomme diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index 9ea312ac40..3ac773f2aa 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -862,7 +862,7 @@ print_children_info (GstElement * element) } static void -print_element_list (gboolean print_all, gboolean print_names) +print_element_list (gboolean print_all) { GList *plugins; @@ -885,7 +885,7 @@ print_element_list (gboolean print_all, gboolean print_names) factory = GST_ELEMENT_FACTORY (feature); if (print_all) - print_element_info (factory, print_names); + print_element_info (factory, TRUE); else g_print ("%s: %s: %s\n", plugin->desc.name, GST_PLUGIN_FEATURE_NAME (factory), factory->details.longname); @@ -1112,11 +1112,8 @@ main (int argc, char *argv[]) GstElementFactory *factory; GstPlugin *plugin; gchar *so; - gboolean print_names = FALSE; gboolean print_all = FALSE; struct poptOption options[] = { - {"print-names", 'n', POPT_ARG_NONE | POPT_ARGFLAG_STRIP, &print_names, 0, - N_("Print element names in the beginning of each line"), NULL}, {"print-all", 'a', POPT_ARG_NONE | POPT_ARGFLAG_STRIP, &print_all, 0, N_("Print all elements"), NULL}, POPT_TABLEEND @@ -1134,14 +1131,11 @@ main (int argc, char *argv[]) if (print_all && argc > 2) { g_print ("-a requires no extra arguments\n"); return 1; - } else if (print_names && argc < 3) { - g_print ("-n requires an element name\n"); - return 1; } /* if no arguments, print out list of elements */ if (argc == 1 || print_all) { - print_element_list (print_all, print_names); + print_element_list (print_all); /* else we try to get a factory */ } else { const char *arg = argv[argc - 1]; @@ -1153,7 +1147,7 @@ main (int argc, char *argv[]) factory = gst_element_factory_find (arg); /* if there's a factory, print out the info */ if (factory) { - retval = print_element_info (factory, print_names); + retval = print_element_info (factory, print_all); } else { retval = print_element_features (arg); }