summaryrefslogtreecommitdiff
path: root/xvidtune.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-11 18:11:36 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-11 18:14:14 -0800
commit10e1cdd54decacd78a2ea841cb1a206c67a735d5 (patch)
tree8be0283e041401c069c01463b2e071aff2b1f401 /xvidtune.c
parent1e9e2cd20ea446ed5ff83c605d49a8989790758a (diff)
Give a hint what is wrong before printing usage messageHEADmaster
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xvidtune.c')
-rw-r--r--xvidtune.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/xvidtune.c b/xvidtune.c
index 85cd9ce..7005957 100644
--- a/xvidtune.c
+++ b/xvidtune.c
@@ -1579,15 +1579,19 @@ main (int argc, char** argv)
if( (!strcmp(argv[1], "-timeout")) ) {
TestTimeout = ((unsigned long) atol( argv[2] )) * 1000L;
}
- else
+ else {
+ fprintf(stderr, "Invalid number of arguments\n\n");
usage(1);
+ }
}
if (argc > 1) {
int i = 0;
- if (argc != 2)
- usage(1);
+ if (argc != 2) {
+ fprintf(stderr, "Invalid number of arguments\n\n");
+ usage(1);
+ }
if (!strcmp(argv[1], "-show")) {
if (!GetModeLine(XtDisplay (top), DefaultScreen (XtDisplay (top)))) {
fprintf(stderr, "Unable to get mode info\n");
@@ -1604,8 +1608,10 @@ main (int argc, char** argv)
CleanUp(XtDisplay (top));
XSync(XtDisplay (top), True);
return 0;
- } else
- usage(1);
+ } else {
+ fprintf(stderr, "Unknown argument: %s\n\n", argv[1]);
+ usage(1);
+ }
if (i != 0) {
XF86VidModeSwitchMode(XtDisplay (top),
DefaultScreen (XtDisplay (top)), i);