Browse Source

Require either --file or a drive. Improved message.

tags/0.3.1
Johann Schmitz 2 years ago
parent
commit
83cbaf1b0a
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      smartcheck/__main__.py

+ 5
- 1
smartcheck/__main__.py View File

@@ -59,6 +59,10 @@ if __name__ == "__main__":
59 59
     if args.file and any([args.interface, args.drive]):
60 60
         parser.error('-f/--file cannot be used with a device and/or -i/--interface')
61 61
 
62
+    if not (args.file or args.drive):
63
+        parser.print_help()
64
+        sys.exit(1)
65
+
62 66
     if args.debug:
63 67
         logging.basicConfig(level=logging.DEBUG, format='%(levelname)-8s %(message)s')
64 68
 
@@ -104,7 +108,7 @@ if __name__ == "__main__":
104 108
 
105 109
             msg = "%s: %s" % (check.device_model, msg)
106 110
         else:
107
-            msg = "Could not read S.M.A.R.T. data (executed as root?)"
111
+            msg = "Could not read S.M.A.R.T. data from %s. Does the disk exists? (executed as root?)" % args.drive
108 112
             exit_code = 3
109 113
     except Exception as ex:
110 114
         msg = "Plugin failed: %s" % ex

Loading…
Cancel
Save