<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10623">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">cosmetic: add commandline help<br><br>There is no helptext for the commandline options, which makes it<br>difficult for new users to use the program.<br><br>- Add commandline help<br><br>Change-Id: I8d04644342acd64432742f96e32dc9f2e0e91c20<br>---<br>M src/host/virt_phy/src/virtphy.c<br>1 file changed, 24 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/23/10623/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c</span><br><span>index 153f890..118e8a1 100644</span><br><span>--- a/src/host/virt_phy/src/virtphy.c</span><br><span>+++ b/src/host/virt_phy/src/virtphy.c</span><br><span>@@ -60,11 +60,30 @@</span><br><span> static char *arfcn_sig_lev_red_mask = NULL;</span><br><span> static char *pm_timeout = NULL;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static void print_usage()</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+  printf("Usage: virtphy\n");</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static void print_help()</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+       printf("  Some useful help...\n");</span><br><span style="color: hsl(120, 100%, 40%);">+  printf("  -h --help                        This text.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+  printf("  -z --dl-rx-grp           ms multicast group.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ printf("  -y --ul-tx-grp           bts multicast group.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+        printf("  -x --port                        udp port to use for communication with virtual BTS (GSMTAP)\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ printf("  -d --log-mask                    --log-mask=DRLL:DCC enable debugging.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+       printf("  -s --l1ctl-sock                  l1ctl socket path path.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+     printf("  -r --arfcn-sig-lev-red        reduce signal level (e.g. 666,12:888,43:176,22).\n");</span><br><span style="color: hsl(120, 100%, 40%);">+       printf("  -t --pm-timeout          power management timeout.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static void handle_options(int argc, char **argv)</span><br><span> {</span><br><span>   while (1) {</span><br><span>          int option_index = 0, c;</span><br><span>             static struct option long_options[] = {</span><br><span style="color: hsl(120, 100%, 40%);">+                       {"help", 0, 0, 'h'},</span><br><span>                       {"dl-rx-grp", required_argument, 0, 'z'},</span><br><span>                  {"ul-tx-grp", required_argument, 0, 'y'},</span><br><span>                  {"port", required_argument, 0, 'x'},</span><br><span>@@ -74,12 +93,16 @@</span><br><span>                         {"pm-timeout", required_argument, 0, 't'},</span><br><span>                         {0, 0, 0, 0},</span><br><span>                };</span><br><span style="color: hsl(0, 100%, 40%);">-              c = getopt_long(argc, argv, "z:y:x:d:s:r:t:", long_options,</span><br><span style="color: hsl(120, 100%, 40%);">+         c = getopt_long(argc, argv, "hz:y:x:d:s:r:t:", long_options,</span><br><span>                               &option_index);</span><br><span>          if (c == -1)</span><br><span>                         break;</span><br><span> </span><br><span>           switch (c) {</span><br><span style="color: hsl(120, 100%, 40%);">+          case 'h':</span><br><span style="color: hsl(120, 100%, 40%);">+                     print_usage();</span><br><span style="color: hsl(120, 100%, 40%);">+                        print_help();</span><br><span style="color: hsl(120, 100%, 40%);">+                 exit(0);</span><br><span>             case 'z':</span><br><span>                    dl_rx_grp = optarg;</span><br><span>                  break;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10623">change 10623</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/10623"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmocom-bb </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I8d04644342acd64432742f96e32dc9f2e0e91c20 </div>
<div style="display:none"> Gerrit-Change-Number: 10623 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>