[xiph-cvs] cvs commit: ogg-tools/omplay omplay.c

Jack Moffitt jack at xiph.org
Fri Nov 9 13:41:13 PST 2001



jack        01/11/09 13:41:13

  Modified:    omplay   omplay.c
  Log:
  Add usage messages, and fix bug when file is not specified.

Revision  Changes    Path
1.8       +17 -0     ogg-tools/omplay/omplay.c

Index: omplay.c
===================================================================
RCS file: /usr/local/cvsroot/ogg-tools/omplay/omplay.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- omplay.c	2001/10/09 16:01:59	1.7
+++ omplay.c	2001/11/09 21:41:12	1.8
@@ -685,6 +685,16 @@
         }
 }
 
+void usage(void)
+{
+	fprintf(stderr, "omplay [-v] [-s] [-p client:port] [-D pcmdevice]\n");
+	fprintf(stderr, "\t -v: verbose\n");
+	fprintf(stderr, "\t -s: use status files\n");
+	fprintf(stderr, "\t -p: use ALSA client:port (default is 64:0)\n");
+	fprintf(stderr, "\t -D: use ALSA pcm device specified (default is 'default')\n");
+	fprintf(stderr, "\n");
+}
+
 int main(int argc, char **argv)
 {
         int err;
@@ -727,8 +737,15 @@
                         break;
                 default:
                         fprintf(stderr, "invalid options %c\n", c);
+			usage();
                         return 1;
                 }
+	}
+
+	if (optind >= argc) {
+		fprintf(stderr, "error: no file specified\n");
+		usage();
+		return 1;
         }
 
         open_file(argv[optind]);

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list