[FFmpeg-cvslog] avtools: move some newlines to show_help_options().

Anton Khirnov git at videolan.org
Mon Aug 20 16:58:27 CEST 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Aug 11 19:33:27 2012 +0200| [dc4c24a3d35603957aecf2b075ac25902d18a190] | committer: Anton Khirnov

avtools: move some newlines to show_help_options().

Don't require every caller to supply them.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc4c24a3d35603957aecf2b075ac25902d18a190
---

 avconv_opt.c |   14 +++++++-------
 avplay.c     |    4 ++--
 avprobe.c    |    2 +-
 avserver.c   |    2 +-
 cmdutils.c   |    3 ++-
 5 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/avconv_opt.c b/avconv_opt.c
index 295cc27..8915a86 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -1794,24 +1794,24 @@ static int show_help(const char *opt, const char *arg)
     int flags = AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM;
     av_log_set_callback(log_callback_help);
     show_usage();
-    show_help_options(options, "Main options:\n",
+    show_help_options(options, "Main options:",
                       OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE, 0);
-    show_help_options(options, "\nAdvanced options:\n",
+    show_help_options(options, "Advanced options:",
                       OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE,
                       OPT_EXPERT);
-    show_help_options(options, "\nVideo options:\n",
+    show_help_options(options, "Video options:",
                       OPT_EXPERT | OPT_AUDIO | OPT_VIDEO,
                       OPT_VIDEO);
-    show_help_options(options, "\nAdvanced Video options:\n",
+    show_help_options(options, "Advanced Video options:",
                       OPT_EXPERT | OPT_AUDIO | OPT_VIDEO,
                       OPT_VIDEO | OPT_EXPERT);
-    show_help_options(options, "\nAudio options:\n",
+    show_help_options(options, "Audio options:",
                       OPT_EXPERT | OPT_AUDIO | OPT_VIDEO,
                       OPT_AUDIO);
-    show_help_options(options, "\nAdvanced Audio options:\n",
+    show_help_options(options, "Advanced Audio options:",
                       OPT_EXPERT | OPT_AUDIO | OPT_VIDEO,
                       OPT_AUDIO | OPT_EXPERT);
-    show_help_options(options, "\nSubtitle options:\n",
+    show_help_options(options, "Subtitle options:",
                       OPT_SUBTITLE, OPT_SUBTITLE);
     printf("\n");
     show_help_children(avcodec_get_class(), flags);
diff --git a/avplay.c b/avplay.c
index 593b38a..bb10810 100644
--- a/avplay.c
+++ b/avplay.c
@@ -2926,9 +2926,9 @@ static int show_help(const char *opt, const char *arg)
 {
     av_log_set_callback(log_callback_help);
     show_usage();
-    show_help_options(options, "Main options:\n",
+    show_help_options(options, "Main options:",
                       OPT_EXPERT, 0);
-    show_help_options(options, "\nAdvanced options:\n",
+    show_help_options(options, "Advanced options:",
                       OPT_EXPERT, OPT_EXPERT);
     printf("\n");
     show_help_children(avcodec_get_class(), AV_OPT_FLAG_DECODING_PARAM);
diff --git a/avprobe.c b/avprobe.c
index 996a138..0116acb 100644
--- a/avprobe.c
+++ b/avprobe.c
@@ -872,7 +872,7 @@ static int show_help(const char *opt, const char *arg)
 {
     av_log_set_callback(log_callback_help);
     show_usage();
-    show_help_options(options, "Main options:\n", 0, 0);
+    show_help_options(options, "Main options:", 0, 0);
     printf("\n");
     show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);
     return 0;
diff --git a/avserver.c b/avserver.c
index fabdd32..de050a6 100644
--- a/avserver.c
+++ b/avserver.c
@@ -4634,7 +4634,7 @@ static void show_help(void)
     printf("usage: avserver [options]\n"
            "Hyper fast multi format Audio/Video streaming server\n");
     printf("\n");
-    show_help_options(options, "Main options:\n", 0, 0);
+    show_help_options(options, "Main options:", 0, 0);
 }
 
 static const OptionDef options[] = {
diff --git a/cmdutils.c b/cmdutils.c
index 3b8ab3f..5107744 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -124,7 +124,7 @@ void show_help_options(const OptionDef *options, const char *msg, int mask,
         char buf[64];
         if ((po->flags & mask) == value) {
             if (first) {
-                printf("%s", msg);
+                printf("%s\n", msg);
                 first = 0;
             }
             av_strlcpy(buf, po->name, sizeof(buf));
@@ -135,6 +135,7 @@ void show_help_options(const OptionDef *options, const char *msg, int mask,
             printf("-%-17s  %s\n", buf, po->help);
         }
     }
+    printf("\n");
 }
 
 void show_help_children(const AVClass *class, int flags)



More information about the ffmpeg-cvslog mailing list