Change in gr-gsm[master]: apps/grgsm_trx: use format string for help message

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Fri Aug 10 08:20:42 UTC 2018


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10420


Change subject: apps/grgsm_trx: use format string for help message
......................................................................

apps/grgsm_trx: use format string for help message

Instead of using the hard-coded default values in help message,
it makes sense to use a format string, and pass the actual
values when printing help.

Change-Id: Ib1bf0ef3ded86aa92faeb9b63eb286283f5c8c3d
---
M apps/grgsm_trx
1 file changed, 15 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/20/10420/1

diff --git a/apps/grgsm_trx b/apps/grgsm_trx
index eb7fbdb..b925fc1 100755
--- a/apps/grgsm_trx
+++ b/apps/grgsm_trx
@@ -96,20 +96,27 @@
 
 		# TRX specific
 		s += " TRX interface specific\n" \
-			 "  -i --remote-addr  Set remote address (default 127.0.0.1)\n" \
-			 "  -p --base-port    Set base port number (default 5700)\n\n"
+			 "  -i --remote-addr  Set remote address (default %s)\n" \
+			 "  -p --base-port    Set base port number (default %d)\n\n"
 
 		# PHY specific
 		s += " Radio interface specific\n" \
 			 "  -a --device-args  Set device arguments\n" \
 			 "  -s --sample-rate  Set sample rate\n" \
-			 "  -g --rx-gain      Set RX gain (default 30)\n" \
-			 "  -G --tx-gain      Set TX gain (default 10)\n" \
-			 "     --rx-antenna   Set RX antenna (default RX2)\n" \
-			 "     --tx-antenna   Set TX antenna (default TX/RX)\n" \
-			 "     --ppm          Set frequency correction (default 0)\n"
+			 "  -g --rx-gain      Set RX gain (default %d)\n" \
+			 "  -G --tx-gain      Set TX gain (default %d)\n" \
+			 "     --rx-antenna   Set RX antenna (default %s)\n" \
+			 "     --tx-antenna   Set TX antenna (default %s)\n" \
+			 "     --ppm          Set frequency correction (default %d)\n"
 
-		print(s)
+		print(s % (
+			self.remote_addr,
+			self.base_port,
+			self.phy_rx_gain,
+			self.phy_tx_gain,
+			self.phy_rx_antenna,
+			self.phy_tx_antenna,
+			self.phy_ppm))
 
 	def parse_argv(self):
 		try:

-- 
To view, visit https://gerrit.osmocom.org/10420
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib1bf0ef3ded86aa92faeb9b63eb286283f5c8c3d
Gerrit-Change-Number: 10420
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180810/747a9691/attachment.htm>


More information about the gerrit-log mailing list