From 211fdc3bb4bb1bf7f819636bb85837aebe00aa14 Mon Sep 17 00:00:00 2001 From: Jonathan Hamberg Date: Thu, 10 Dec 2020 10:29:47 -0800 Subject: [PATCH] Added command to list included protocols. --- protocol | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/protocol b/protocol index abbed87..cb521a3 100755 --- a/protocol +++ b/protocol @@ -483,6 +483,7 @@ class Main(): print(" -h, --help : Displays this help information") print(" -n, --no-numbers : Do not print bit numbers on top of the header") print(" -V, --version : Displays current version") + print(" -l, --list : List included protocols") print(" --evenchar : Character for the even positions of horizontal table borders") print(" --oddchar : Character for the odd positions of horizontal table borders") print(" --startchar : Character that starts horizontal table borders") @@ -624,6 +625,13 @@ class Main(): print("%s v%s" % (APPLICATION_NAME, APPLICATION_VERSION)) sys.exit(0) + # Display included protocols + elif argv[i]=="-l" or argv[i]=="--list": + for spec in specs.protocols.keys(): + print(spec, "", end="") + print() + sys.exit(0) + # Incorrect option supplied elif argv[i].startswith("-"): print("ERROR: Invalid option supplied (%s)" % argv[i])