summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2008-10-01 20:57:15 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2008-10-01 20:57:15 +1000
commit65f0d981e66f5348e09324873fc5f62bcf71e4c1 (patch)
tree81c2861005243aa578db1a7343f0cff586d1d2ea /examples
parente0d92fd712ce20a9013560fb784c664aea385d12 (diff)
examples/sndfile-metadata-(get|set).c : Add usage messages.
Diffstat (limited to 'examples')
-rw-r--r--examples/sndfile-metadata-get.c26
-rw-r--r--examples/sndfile-metadata-set.c47
2 files changed, 67 insertions, 6 deletions
diff --git a/examples/sndfile-metadata-get.c b/examples/sndfile-metadata-get.c
index 4818db4..5ece575 100644
--- a/examples/sndfile-metadata-get.c
+++ b/examples/sndfile-metadata-get.c
@@ -63,7 +63,7 @@ main (int argc, char *argv [])
progname = progname ? progname + 1 : argv [0] ;
/* Check if we've been asked for help. */
- if (argc < 2 || strcmp (argv [1], "--help") == 0 || strcmp (argv [1], "-h") == 0)
+ if (argc <= 2 || strcmp (argv [1], "--help") == 0 || strcmp (argv [1], "-h") == 0)
usage_exit (progname, 0) ;
if (argv [argc - 1][0] != '-')
@@ -100,8 +100,28 @@ main (int argc, char *argv [])
static void
usage_exit (const char *progname, int exit_code)
-{ printf ("Usage :\n %s <file> ...\n", progname) ;
- printf (" Fill in more later.\n\n") ;
+{ printf ("\nUsage :\n %s [options] <file>\n\nOptions:\n", progname) ;
+
+ puts (
+ " --bext-description Print the 'bext' description.\n"
+ " --bext-originator Print the 'bext; originator info.\n"
+ " --bext-orig-ref Print the 'bext' origination reference.\n"
+ " --bext-umid Print the 'bext' UMID.\n"
+ " --bext-orig-date Print the 'bext' origination date.\n"
+ " --bext-orig-time Print the 'bext' origination time.\n"
+ " --bext-coding-hist Print the 'bext' coding history.\n"
+ ) ;
+
+ puts (
+ " --str-title Print the title metadata.\n"
+ " --str-copyright Print the copyright metadata.\n"
+ " --str-artist Print the artist metadata.\n"
+ " --str-comment Print the comment metadata.\n"
+ " --str-date Print the creation date metadata.\n"
+ " --str-album Print the album metadata.\n"
+ " --str-license Print the license metadata.\n"
+ ) ;
+
exit (exit_code) ;
} /* usage_exit */
diff --git a/examples/sndfile-metadata-set.c b/examples/sndfile-metadata-set.c
index 55089b1..8cfc96c 100644
--- a/examples/sndfile-metadata-set.c
+++ b/examples/sndfile-metadata-set.c
@@ -114,7 +114,6 @@ main (int argc, char *argv [])
HANDLE_STR_ARG ("--str-title", title) ;
HANDLE_STR_ARG ("--str-copyright", copyright) ;
HANDLE_STR_ARG ("--str-artist", artist) ;
- HANDLE_STR_ARG ("--str-copyright", copyright) ;
HANDLE_STR_ARG ("--str-date", date) ;
HANDLE_STR_ARG ("--str-album", album) ;
HANDLE_STR_ARG ("--str-license", license) ;
@@ -181,8 +180,50 @@ main (int argc, char *argv [])
static void
usage_exit (const char *progname, int exit_code)
-{ printf ("Usage :\n %s <file> ...\n", progname) ;
- printf (" Fill in more later.\n\n") ;
+{ printf ("\nUsage :\n\n"
+ " %s [options] <file>\n"
+ " %s [options] <input file> <output file>\n"
+ "\n",
+ progname, progname) ;
+
+ puts (
+ "Where an option is made up of a pair of a field to set (one of\n"
+ "the 'bext' or metadata fields below) and a string. Fields are\n"
+ "as follows :\n"
+ ) ;
+
+ puts (
+ " --bext-description Set the 'bext' description.\n"
+ " --bext-originator Set the 'bext' originator.\n"
+ " --bext-orig-ref Set the 'bext' originator reference.\n"
+ " --bext-umid Set the 'bext' UMID.\n"
+ " --bext-orig-date Set the 'bext' origination date.\n"
+ " --bext-orig-time Set the 'bext' origination time.\n"
+ " --bext-coding-hist Set the 'bext' coding history\n"
+ "\n"
+ " --str-title Set the metadata title.\n"
+ " --str-copyright Set the metadata copyright.\n"
+ " --str-artist Set the metadata artist.\n"
+ " --str-date Set the metadata date.\n"
+ " --str-album Set the metadata album.\n"
+ " --str-license Set the metadata license.\n"
+ ) ;
+
+ puts (
+ "There are also the following arguments which do not take a\n"
+ "parameter :\n\n"
+ " --bext-auto-time-date Set the 'bext' time and date to current time/date.\n"
+ " --bext-auto-time Set the 'bext' time to current time.\n"
+ " --bext-auto-date Set the 'bext' date to current date.\n"
+ " --str-auto-date Set the metadata date to current date.\n"
+ ) ;
+
+ puts (
+ "Most of the above operations can be done in-place on an existing\n"
+ "file. If any operation cannot be performed, the application will\n"
+ "exit with an appropriate error message.\n"
+ ) ;
+
exit (exit_code) ;
} /* usage_exit */