From 17d245eaa8ebc3cdf27b20a92254bf66a53f96a6 Mon Sep 17 00:00:00 2001
From: ballen4705 <ballen4705@4ea69e1a-61f1-4043-bf83-b5c94c648137>
Date: Sun, 5 Jan 2003 06:44:41 +0000
Subject: [PATCH] More fine-tuning of error messages

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@427 4ea69e1a-61f1-4043-bf83-b5c94c648137
---
 sm5/smartctl.c   | 8 +++++---
 sm5/smartctl.cpp | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/sm5/smartctl.c b/sm5/smartctl.c
index 42ed0d658..c8c8c2330 100644
--- a/sm5/smartctl.c
+++ b/sm5/smartctl.c
@@ -42,7 +42,7 @@
 #include "extern.h"
 
 extern const char *CVSid1, *CVSid2, *CVSid3, *CVSid4; 
-const char* CVSid5="$Id: smartctl.c,v 1.38 2003/01/05 06:02:36 ballen4705 Exp $"
+const char* CVSid5="$Id: smartctl.c,v 1.39 2003/01/05 06:44:41 ballen4705 Exp $"
 CVSID1 CVSID2 CVSID3 CVSID4 CVSID5 CVSID6;
 
 // This is a block containing all the "control variables".  We declare
@@ -522,17 +522,19 @@ void ParseOpts (int argc, char** argv){
   
   // Warn if the user has provided no device name
   if (argc-optind<1){
-    pout("\nERROR: smartctl requires a device name as the final command-line argument.\n\n");
+    pout("ERROR: smartctl requires a device name as the final command-line argument.\n\n");
+    pout("Use smartctl -h to get a usage summary\n\n");
     exit(FAILCMD);
   }
   
   // Warn if the user has provided more than one device name
   if (argc-optind>1){
     int i;
-    pout("\nERROR: smartctl takes ONE device name as the final command-line argument.\n");
+    pout("ERROR: smartctl takes ONE device name as the final command-line argument.\n");
     pout("You have provided %d device names:\n",argc-optind);
     for (i=0; i<argc-optind; i++)
       pout("%s\n",argv[optind+i]);
+    pout("Use smartctl -h to get a usage summary\n\n");
     exit(FAILCMD);
   }  
 }
diff --git a/sm5/smartctl.cpp b/sm5/smartctl.cpp
index f3c849b9a..87bdad300 100644
--- a/sm5/smartctl.cpp
+++ b/sm5/smartctl.cpp
@@ -42,7 +42,7 @@
 #include "extern.h"
 
 extern const char *CVSid1, *CVSid2, *CVSid3, *CVSid4; 
-const char* CVSid5="$Id: smartctl.cpp,v 1.38 2003/01/05 06:02:36 ballen4705 Exp $"
+const char* CVSid5="$Id: smartctl.cpp,v 1.39 2003/01/05 06:44:41 ballen4705 Exp $"
 CVSID1 CVSID2 CVSID3 CVSID4 CVSID5 CVSID6;
 
 // This is a block containing all the "control variables".  We declare
@@ -522,17 +522,19 @@ void ParseOpts (int argc, char** argv){
   
   // Warn if the user has provided no device name
   if (argc-optind<1){
-    pout("\nERROR: smartctl requires a device name as the final command-line argument.\n\n");
+    pout("ERROR: smartctl requires a device name as the final command-line argument.\n\n");
+    pout("Use smartctl -h to get a usage summary\n\n");
     exit(FAILCMD);
   }
   
   // Warn if the user has provided more than one device name
   if (argc-optind>1){
     int i;
-    pout("\nERROR: smartctl takes ONE device name as the final command-line argument.\n");
+    pout("ERROR: smartctl takes ONE device name as the final command-line argument.\n");
     pout("You have provided %d device names:\n",argc-optind);
     for (i=0; i<argc-optind; i++)
       pout("%s\n",argv[optind+i]);
+    pout("Use smartctl -h to get a usage summary\n\n");
     exit(FAILCMD);
   }  
 }
-- 
GitLab