comparison toys/other/netcat.c @ 1658:e5e3cd5f8779 draft

Switch netcat to stop parsing command line at first nonoption argument instead of stopping after -l or -L. Hyejin Kim tried "toyboxd nc nc -p 1234 -l rm mv ps" (which attempted to run "nc rm mv ps") and "toybox nc -l -p 1234" (which attempted to run "-p 1234") and found the behavior confusing. So make it work like xargs, where all netcat options have to come before the start of any child command.
author Rob Landley <rob@landley.net>
date Wed, 14 Jan 2015 13:59:10 -0600
parents 5fac2769a159
children c1715c752e89
comparison
equal deleted inserted replaced
1657:910a958980dc 1658:e5e3cd5f8779
3 * Copyright 2007 Rob Landley <rob@landley.net> 3 * Copyright 2007 Rob Landley <rob@landley.net>
4 * 4 *
5 * TODO: udp, ipv6, genericize for telnet/microcom/tail-f 5 * TODO: udp, ipv6, genericize for telnet/microcom/tail-f
6 6
7 USE_NETCAT(OLDTOY(nc, netcat, TOYFLAG_BIN)) 7 USE_NETCAT(OLDTOY(nc, netcat, TOYFLAG_BIN))
8 USE_NETCAT(NEWTOY(netcat, USE_NETCAT_LISTEN("tl^L^")"w#p#s:q#f:", TOYFLAG_BIN)) 8 USE_NETCAT(NEWTOY(netcat, USE_NETCAT_LISTEN("^tlL")"w#p#s:q#f:", TOYFLAG_BIN))
9 9
10 config NETCAT 10 config NETCAT
11 bool "netcat" 11 bool "netcat"
12 default y 12 default y
13 help 13 help