[chirp_devel] [PATCH 1/4] chirp.py: add --list-radios option (#2343)

Zach Welch
Sun Feb 22 23:09:52 PST 2015


The current list of radios is too long to present to the user in
the --help text, so this splits the list out into its own option.
---
 chirp.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/chirp.py b/chirp.py
index 9e5c59c..88c3922 100755
--- a/chirp.py
+++ b/chirp.py
@@ -137,8 +137,10 @@ if __name__ == "__main__":
 			  help="Set mode (%s)" % ",".join(chirp_common.MODES))
 	parser.add_option("-r", "--radio", dest="radio",
 			  default=None,
-			  help="Radio model (one of %s)" % ",".join(RADIOS.keys()))
-
+			  help="Radio model (see --list-radios)")
+	parser.add_option("", "--list-radios", dest="list_radios",
+			  action="store_true",
+			  help="List radio models")
 	parser.add_option("", "--mmap", dest="mmap",
 			  default=None,
 			  help="Radio memory map file location")
@@ -155,6 +157,10 @@ if __name__ == "__main__":
 		sys.exit(0)
 	(options, args) = parser.parse_args()
 
+        if options.list_radios:
+            print "Supported Radios:\n\t", "\n\t".join(sorted(RADIOS.keys()))
+            sys.exit(0);
+
 	if options.id:
 	    from chirp import icf
 
-- 
1.9.1




More information about the chirp_devel mailing list