aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-08-10 00:32:41 +0700
committerPiotr Krysik <ptrkrysik@gmail.com>2018-09-13 15:35:44 +0200
commit4cedbb530e640b6906dcd3a6361e4c8fabc23379 (patch)
tree949394a586b2c28f00f2a38254532c9247bdd640
parent3824bbaeb17540e6225733baacb563d9e5633203 (diff)
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
-rwxr-xr-xapps/grgsm_trx25
1 files changed, 16 insertions, 9 deletions
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 @@ class Application:
# 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"
-
- print(s)
+ " -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 % (
+ 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: