From 63464e369345487f609b2306ac275bf27b774577 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Wed, 15 Jan 2014 20:29:06 +0000 Subject: [PATCH] ivfrate: fix one error message, make -h/--help display usage. Actually, right now, any first arg starting with '-' will show the usage. git-svn-id: https://svn.eduke32.com/eduke32@4258 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/util/ivfrate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/source/util/ivfrate.c b/polymer/eduke32/source/util/ivfrate.c index e652cd912..557bb2354 100644 --- a/polymer/eduke32/source/util/ivfrate.c +++ b/polymer/eduke32/source/util/ivfrate.c @@ -39,8 +39,12 @@ int main(int argc, char **argv) return 255; } + if (argc == 2 && argv[1][0]=='-') + goto usage; + if (argc != 2 && argc != 4 && argc != 5) { +usage: fprintf(stderr, "Usage: %s [ [-force]]\n" " Without -force, must be < 1000.\n" " If is >= 1000, the actual frame rate\n" @@ -54,7 +58,7 @@ int main(int argc, char **argv) fd = open(argv[1], dowrite ? O_RDWR : O_RDONLY); if (fd < 0) { - fprintf(stderr, "Could't open \"%s\" for: %s\n", + fprintf(stderr, "Could't open \"%s\" for %s: %s\n", argv[1], dowrite ? "reading/writing":"reading", strerror(errno)); return 2; }