Skip to content

Commit

Permalink
Print help text when no arguments are supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
selplacei authored Feb 27, 2021
1 parent 5641cae commit 6d0377b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion consave
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def main():
list_of_profiles = os.listdir(profiles_dir)

try:
options, args = getopt.getopt(argv, 'hlr:s:a:b')
options, args = getopt.getopt(argv, 'r:s:a:hlb')

except getopt.GetoptError:
option = argv[0]
Expand All @@ -169,6 +169,9 @@ def main():
print_msg(f"Usage- {data[option]['usage']}")

else:
if not options:
print(help_text)
sys.exit(0)
for option, argument in options:
if option in data:
opt = data[option]
Expand Down

0 comments on commit 6d0377b

Please sign in to comment.