From 211fdc3bb4bb1bf7f819636bb85837aebe00aa14 Mon Sep 17 00:00:00 2001 From: Jonathan Hamberg Date: Thu, 10 Dec 2020 10:29:47 -0800 Subject: [PATCH 1/2] 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]) From 604720ed4e68e33ed74ba877e9e271b4d57745b4 Mon Sep 17 00:00:00 2001 From: Jonathan Hamberg Date: Thu, 10 Dec 2020 10:50:22 -0800 Subject: [PATCH 2/2] Added -l, and --list options to the README.md --- README.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/README.txt b/README.txt index 93cfad1..6c82de4 100644 --- a/README.txt +++ b/README.txt @@ -270,6 +270,7 @@ -h, --help : Displays this help information -n, --no-numbers : Do not print bit numbers on top of the header -V, --version : Displays current version + -l, --list : List included protocols --evenchar : Character for the even positions of horizontal lines --oddchar : Character for the odd positions of horizontal lines --startchar : Character that starts horizontal lines