From c70090ef2c04abcc392df3b6a7e2a0ae3982573c Mon Sep 17 00:00:00 2001 From: jsoldani Date: Wed, 5 Oct 2022 17:51:01 +0200 Subject: [PATCH] enhanced help --- yrca.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/yrca.py b/yrca.py index 33566b8..5bbbbda 100644 --- a/yrca.py +++ b/yrca.py @@ -14,14 +14,6 @@ def main(argv): cli_error("wrong options used") exit(-1) - # check & process command line arguments - if len(args) < 3: - cli_error("missing input arguments") - exit(-1) - eventLogLine = args[0] - applicationLogs = args[1] - templater = Templater(args[2]) - # options to customise the execution of the explainer (with default values) nSols = None # number of possible explanations to find (default: all) rootCause = None # value for root cause (default: all) @@ -47,6 +39,14 @@ def main(argv): elif option in ["-v","--verbose"]: verbose = True + # check & process command line arguments + if len(args) < 3: + cli_error("missing input arguments") + exit(-1) + eventLogLine = args[0] + applicationLogs = args[1] + templater = Templater(args[2]) + # ****************** # * PARSING INPUTS * # ****************** @@ -90,8 +90,8 @@ def cli_error(message): # function for printing cli usage def cli_help(): print("Usage of yrca.py is as follows:") - print(" yrca.py [OPTIONS] eventToBeExplained.json applicationLogs.json logParsingTemplates.yml") - print("where OPTIONS can be") + print(" yrca.py [OPTIONS] EVENT LOGS TEMPLATES") + print("where EVENT and LOGS are JSON files, TEMPLATES is a YAML file, and OPTIONS can be") print(" [--help] to print a help on the usage of yrca.py") print(" [-n N|--num=N] to set to N the amount of possible explanations to identify") print(" [-r X|--root=X] to require X to be the root cause of identified explanations")