From 4c147af06faab5de3979917065b2644955e32911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sun, 29 Mar 2020 17:53:25 +0100 Subject: When no action is provided by user, print the help output instead. This makes it friendlier to the user who's not sure how to use it. --- glucometerutils/glucometer.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/glucometerutils/glucometer.py b/glucometerutils/glucometer.py index 7b5803b..b74e078 100755 --- a/glucometerutils/glucometer.py +++ b/glucometerutils/glucometer.py @@ -108,9 +108,10 @@ def main(): ) return 1 - # This check needs to happen before we try to initialize the device, as the - # help action does not require a --device at all. - if args.action == "help": + # This check needs to happen before we try to initialize the device, as the help + # action does not require a --device at all. Also use the same output if there's no + # action provided. + if not args.action or args.action == "help": print(requested_driver.help) return 0 -- cgit v1.2.3