This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 2cfbefa10a7d2148fb016b0745ef80e3514c4073
Author: gaohedong <[email protected]>
AuthorDate: Fri Aug 28 15:35:16 2026 +0800

    netutils/iperf: fix long option handling
    
    Register the long options already documented by the usage output.
    Report the client time default from IPERF_DEFAULT_TIME.
    
    Signed-off-by: gaohedong <[email protected]>
    Assisted-by: Kiro:claude-opus-4
---
 netutils/iperf/iperf_main.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/netutils/iperf/iperf_main.c b/netutils/iperf/iperf_main.c
index db3d358ad..268f38485 100644
--- a/netutils/iperf/iperf_main.c
+++ b/netutils/iperf/iperf_main.c
@@ -96,11 +96,12 @@ static void iperf_showusage(FAR const char *progname)
          "  -p, --port=<port>    server port to listen on/connect to\n"
          "  -i, --interval=<interval> seconds between periodic bandwidth"
          " reports\n"
-         "  -t, --time=<time>    time in seconds to transmit for (default 10"
+         "  -t, --time=<time>    time in seconds to transmit for (default %d"
          " secs)\n"
          "  -l, --len=<length>   length of buffer in bytes to read or write"
          " (default: TCP 8K, UDP TX 1472, UDP RX 16K)\n"
-         "  -a, --abort          abort running iperf\n");
+         "  -a, --abort          abort running iperf\n",
+         IPERF_DEFAULT_TIME);
 }
 
 /****************************************************************************
@@ -159,10 +160,18 @@ int main(int argc, FAR char *argv[])
 
   struct option loptions[] =
   {
-    {"local", optional_argument, 0, 'L'},
-    {"rpmsg", required_argument, 0, 'R'},
-    {"vsock", required_argument, 0, 'V'},
-    {"len",   required_argument, 0, 'l'},
+    {"client",   required_argument, 0, 'c'},
+    {"server",   no_argument,       0, 's'},
+    {"udp",      no_argument,       0, 'u'},
+    {"local",    optional_argument, 0, 'L'},
+    {"rpmsg",    required_argument, 0, 'R'},
+    {"vsock",    required_argument, 0, 'V'},
+    {"bind",     required_argument, 0, 'B'},
+    {"port",     required_argument, 0, 'p'},
+    {"interval", required_argument, 0, 'i'},
+    {"time",     required_argument, 0, 't'},
+    {"len",      required_argument, 0, 'l'},
+    {"abort",    no_argument,       0, 'a'},
     {0, 0, 0, 0}
   };
 

Reply via email to