From b266c229dc7101ea0ff32feb031f9cf0906c9fb3 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 25 Jun 2018 13:31:18 -0400 Subject: [PATCH] Print usage if bad --- libremanage.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libremanage.py b/libremanage.py index a2bb022..7a59af9 100644 --- a/libremanage.py +++ b/libremanage.py @@ -19,7 +19,7 @@ along with this program. If not, see . import sys -""" +USAGE = """ Usage: $ libremanage [server name] [command] @@ -35,4 +35,10 @@ Valid commands are as follows: - shutdown, reboot, poweron: Power management """ -sys.argv[1] +#sys.argv[1] +if len(sys.argv) != 3: + print("Incorrect number of arguments") + print(USAGE) + sys.exit(1) + +print(len(sys.argv)) -- 2.25.1