From 2751626db8aada91d4e812e4e3262e7e3b308d30 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 24 Apr 2008 12:37:35 +0000 Subject: [PATCH] Unknown options are fatal, so label them error rather than warning. git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5206 7894878c-1315-0410-8ee3-d5d059ff63e0 --- tools/i2cdetect.c | 4 ++-- tools/i2cdump.c | 4 ++-- tools/i2cget.c | 4 ++-- tools/i2cset.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/i2cdetect.c b/tools/i2cdetect.c index f2552f1..33f01a8 100644 --- a/tools/i2cdetect.c +++ b/tools/i2cdetect.c @@ -228,8 +228,8 @@ int main(int argc, char *argv[]) last = 0x7F; break; default: - fprintf(stderr, "Warning: Unsupported flag " - "\"-%c\"!\n", argv[1+flags][1]); + fprintf(stderr, "Error: Unsupported option " + "\"%s\"!\n", argv[1+flags]); help(); exit(1); } diff --git a/tools/i2cdump.c b/tools/i2cdump.c index bad8ccf..c4de81b 100644 --- a/tools/i2cdump.c +++ b/tools/i2cdump.c @@ -68,8 +68,8 @@ int main(int argc, char *argv[]) case 'r': range = argv[1+(++flags)]; break; case 'y': yes = 1; break; default: - fprintf(stderr, "Warning: Unsupported flag " - "\"-%c\"!\n", argv[1+flags][1]); + fprintf(stderr, "Error: Unsupported option " + "\"%s\"!\n", argv[1+flags]); help(); exit(1); } diff --git a/tools/i2cget.c b/tools/i2cget.c index 747a6a9..ae7a8f5 100644 --- a/tools/i2cget.c +++ b/tools/i2cget.c @@ -169,8 +169,8 @@ int main(int argc, char *argv[]) case 'f': force = 1; break; case 'y': yes = 1; break; default: - fprintf(stderr, "Warning: Unsupported flag " - "\"-%c\"!\n", argv[1+flags][1]); + fprintf(stderr, "Error: Unsupported option " + "\"%s\"!\n", argv[1+flags]); help(); exit(1); } diff --git a/tools/i2cset.c b/tools/i2cset.c index 88a62c6..5e14bcd 100644 --- a/tools/i2cset.c +++ b/tools/i2cset.c @@ -63,8 +63,8 @@ int main(int argc, char *argv[]) case 'f': force = 1; break; case 'y': yes = 1; break; default: - fprintf(stderr, "Warning: Unsupported flag " - "\"-%c\"!\n", argv[1+flags][1]); + fprintf(stderr, "Error: Unsupported option " + "\"%s\"!\n", argv[1+flags]); help(); exit(1); }