From 9a49aec57099a5a5672bb83ef0121e276470df45 Mon Sep 17 00:00:00 2001 From: Lior Avramov <73036155+liorghub@users.noreply.github.com> Date: Wed, 25 Jan 2023 20:50:38 +0200 Subject: [PATCH] [Mellanox] [ECMP calculator] Add script usage and more information to script description in help option (#13493) Add script usage and more information to script description being printed in help option. - Why I did it Missing information in script description in help option. - How I did it Expand script description and add script usage. - How to verify it Run the script with -h option. --- .../docker-syncd-mlnx/ecmp_calculator/ecmp_calc.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/mellanox/docker-syncd-mlnx/ecmp_calculator/ecmp_calc.py b/platform/mellanox/docker-syncd-mlnx/ecmp_calculator/ecmp_calc.py index 286a40fd2027..280275529b73 100755 --- a/platform/mellanox/docker-syncd-mlnx/ecmp_calculator/ecmp_calc.py +++ b/platform/mellanox/docker-syncd-mlnx/ecmp_calculator/ecmp_calc.py @@ -482,11 +482,12 @@ def validate_packet_json(self, packet_json): def main(): rc = 0 try: - parser = argparse.ArgumentParser(description="ECMP calculator") - parser.add_argument("-i", "--interface", required=True, help="Ingress interface") - parser.add_argument("-p", "--packet", required=True, help="Packet description") + parser = argparse.ArgumentParser(description="Calculate egress interface for the given packet being routed over ECMP", + usage="/usr/bin/ecmp_calc.py -i -p ") + parser.add_argument("-i", "--interface", required=True, help="ingress interface") + parser.add_argument("-p", "--packet", required=True, help="json file describing a packet") parser.add_argument("-v", "--vrf", help="VRF name") - parser.add_argument("-d", "--debug", default=False, action="store_true", help="Flag for debug") + parser.add_argument("-d", "--debug", default=False, action="store_true", help="when used, debug messages will be printed to stdout") args = parser.parse_args() ecmp_calc = EcmpCalc()