Code

Allow custom versions with the release file...
[nagiosplug.git] / plugins / check_ide_smart.c
index 937f84c51c23bbe55300b274c6cadf8b1210854b..b0b0189051e4b642dbfadc1cac31b945fe267ed6 100644 (file)
@@ -9,8 +9,6 @@
 * Copyright (c) 2000 Robert Dale <rdale@digital-mission.com>
 * Copyright (c) 2000-2007 Nagios Plugins Development Team
 * 
-* Last Modified: $Date$
-* 
 * Description:
 * 
 * This file contains the check_ide_smart plugin
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
-* $Id$
 * 
 *****************************************************************************/
 
 const char *progname = "check_ide_smart";
-const char *revision = "$Revision$";
 const char *copyright = "1998-2007";
 const char *email = "nagiosplug-devel@lists.sourceforge.net";
        
@@ -162,6 +158,9 @@ main (int argc, char *argv[])
        values_t values;
        int fd;
 
+       /* Parse extra opts if any */
+       argv=np_extra_opts (&argc, argv, progname);
+
        static struct option longopts[] = { 
                {"device", required_argument, 0, 'd'}, 
                {"immediate", no_argument, 0, 'i'}, 
@@ -170,7 +169,8 @@ main (int argc, char *argv[])
                {"auto-off", no_argument, 0, '0'}, 
                {"nagios", no_argument, 0, 'n'}, 
                {"help", no_argument, 0, 'h'}, 
-               {"version", no_argument, 0, 'V'}, {0, 0, 0, 0} 
+               {"version", no_argument, 0, 'V'},
+               {0, 0, 0, 0}
        };
 
        setlocale (LC_ALL, "");
@@ -207,7 +207,7 @@ main (int argc, char *argv[])
                        print_help ();
                        return STATE_OK;
                case 'V':
-                       print_revision (progname, revision);
+                       print_revision (progname, NP_VERSION);
                        return STATE_OK;
                default:
                        usage5 ();
@@ -477,7 +477,7 @@ smart_read_thresholds (int fd, thresholds_t * thresholds)
 void
 print_help (void)
 {
-       print_revision (progname, revision);
+       print_revision (progname, NP_VERSION);
 
        printf ("Nagios feature - 1999 Robert Dale <rdale@digital-mission.com>\n");
        printf ("(C) 1999 Ragnar Hojland Espinosa <ragnar@lightside.dhis.org>\n");
@@ -490,6 +490,7 @@ print_help (void)
   print_usage ();
 
   printf (_(UT_HELP_VRSN));
+  printf (_(UT_EXTRA_OPTS));
 
   printf (" %s\n", "-d, --device=DEVICE");
   printf ("    %s\n", _("Select device DEVICE"));
@@ -504,6 +505,13 @@ print_help (void)
   printf ("    %s\n", _("Turn off automatic offline tests"));
   printf (" %s\n", "-n, --nagios");
   printf ("    %s\n", _("Output suitable for Nagios"));
+
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
   printf (_(UT_SUPPORT));
 }