Commit 02d504a7 authored by Fabrice Bellard's avatar Fabrice Bellard

more sections in help - copyright fixes

Originally committed as revision 2143 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 18bff752
......@@ -16,38 +16,31 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define HAVE_AV_CONFIG_H
#include "common.h"
#include "avformat.h"
#include "cmdutils.h"
void show_help_options(const OptionDef *options)
void show_help_options(const OptionDef *options, const char *msg, int mask, int value)
{
const OptionDef *po;
int i, expert, first;
int first;
printf("Main options are:\n");
for(i=0;i<2;i++) {
first = 1;
for(po = options; po->name != NULL; po++) {
char buf[64];
expert = (po->flags & OPT_EXPERT) != 0;
if (expert == i) {
if (expert && first) {
printf("\nAdvanced options are:\n");
first = 0;
}
strcpy(buf, po->name);
if (po->flags & HAS_ARG) {
strcat(buf, " ");
strcat(buf, po->argname);
}
printf("-%-17s %s\n", buf, po->help);
first = 1;
for(po = options; po->name != NULL; po++) {
char buf[64];
if ((po->flags & mask) == value) {
if (first) {
printf("%s", msg);
first = 0;
}
strcpy(buf, po->name);
if (po->flags & HAS_ARG) {
strcat(buf, " ");
strcat(buf, po->argname);
}
printf("-%-17s %s\n", buf, po->help);
}
}
}
......@@ -84,7 +77,7 @@ void parse_options(int argc, char **argv, const OptionDef *options)
}
if (po->flags & OPT_STRING) {
char *str;
str = strdup(arg);
str = av_strdup(arg);
*po->u.str_arg = str;
} else if (po->flags & OPT_BOOL) {
*po->u.int_arg = 1;
......
......@@ -8,6 +8,9 @@ typedef struct {
#define OPT_BOOL 0x0002
#define OPT_EXPERT 0x0004
#define OPT_STRING 0x0008
#define OPT_VIDEO 0x0010
#define OPT_AUDIO 0x0020
#define OPT_GRAB 0x0040
union {
void (*func_arg)(const char *);
int *int_arg;
......@@ -17,7 +20,7 @@ typedef struct {
const char *argname;
} OptionDef;
void show_help_options(const OptionDef *options);
void show_help_options(const OptionDef *options, const char *msg, int mask, int value);
void parse_options(int argc, char **argv, const OptionDef *options);
void parse_arg_file(const char *filename);
void print_error(const char *filename, int err);
......
This diff is collapsed.
......@@ -1634,10 +1634,14 @@ const OptionDef options[] = {
void show_help(void)
{
printf("usage: ffplay [options] input_file\n"
printf("ffplay version " FFMPEG_VERSION ", Copyright (c) 2003 Fabrice Bellard\n"
"usage: ffplay [options] input_file\n"
"Simple media player\n");
printf("\n");
show_help_options(options);
show_help_options(options, "Main options:\n",
OPT_EXPERT, 0);
show_help_options(options, "\nAdvanced options:\n",
OPT_EXPERT, OPT_EXPERT);
printf("\nWhile playing:\n"
"q, ESC quit\n"
"f toggle full screen\n"
......
......@@ -4477,23 +4477,27 @@ static void write_packet(FFCodec *ffenc,
}
#endif
static void help(void)
static void show_banner(void)
{
printf("ffserver version " FFMPEG_VERSION ", Copyright (c) 2000, 2001, 2002 Fabrice Bellard\n"
"usage: ffserver [-L] [-h] [-f configfile]\n"
printf("ffserver version " FFMPEG_VERSION ", Copyright (c) 2000-2003 Fabrice Bellard\n");
}
static void show_help(void)
{
show_banner();
printf("usage: ffserver [-L] [-h] [-f configfile]\n"
"Hyper fast multi format Audio/Video streaming server\n"
"\n"
"-L : print the LICENCE\n"
"-L : print the LICENSE\n"
"-h : this help\n"
"-f configfile : use configfile instead of /etc/ffserver.conf\n"
);
}
static void licence(void)
static void show_license(void)
{
show_banner();
printf(
"ffserver version " FFMPEG_VERSION "\n"
"Copyright (c) 2000, 2001, 2002 Fabrice Bellard\n"
"This library is free software; you can redistribute it and/or\n"
"modify it under the terms of the GNU Lesser General Public\n"
"License as published by the Free Software Foundation; either\n"
......@@ -4556,11 +4560,11 @@ int main(int argc, char **argv)
break;
switch(c) {
case 'L':
licence();
show_license();
exit(1);
case '?':
case 'h':
help();
show_help();
exit(1);
case 'n':
no_launch = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment