diff options
author | Elliott Hughes <enh@google.com> | 2019-10-17 17:29:19 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2019-10-17 17:59:41 -0700 |
commit | d6ab6e21dbcc061adfc593b0493e775a558e5ece (patch) | |
tree | bd21e4784569c4094dd825bbc86f989cfb217c90 /android | |
parent | 6fd80576c4ee9361186d75a59b82bc9320684c0c (diff) | |
parent | 0b34a5637d91428ef5d87769a4c2698d7a1c2b0f (diff) | |
download | toybox-d6ab6e21dbcc061adfc593b0493e775a558e5ece.tar.gz |
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: I4397ea98faed959d1c14cbd4731b3ae9ab03d7d0
Diffstat (limited to 'android')
-rw-r--r-- | android/device/generated/config.h | 4 | ||||
-rw-r--r-- | android/device/generated/flags.h | 40 | ||||
-rw-r--r-- | android/device/generated/globals.h | 2 | ||||
-rw-r--r-- | android/device/generated/help.h | 8 | ||||
-rw-r--r-- | android/device/generated/newtoys.h | 6 | ||||
-rw-r--r-- | android/linux/generated/config.h | 4 | ||||
-rw-r--r-- | android/linux/generated/flags.h | 40 | ||||
-rw-r--r-- | android/linux/generated/globals.h | 2 | ||||
-rw-r--r-- | android/linux/generated/help.h | 8 | ||||
-rw-r--r-- | android/linux/generated/newtoys.h | 6 | ||||
-rw-r--r-- | android/mac/generated/config.h | 4 | ||||
-rw-r--r-- | android/mac/generated/flags.h | 40 | ||||
-rw-r--r-- | android/mac/generated/globals.h | 2 | ||||
-rw-r--r-- | android/mac/generated/help.h | 8 | ||||
-rw-r--r-- | android/mac/generated/newtoys.h | 6 |
15 files changed, 150 insertions, 30 deletions
diff --git a/android/device/generated/config.h b/android/device/generated/config.h index c5e2cda5..34ca773e 100644 --- a/android/device/generated/config.h +++ b/android/device/generated/config.h @@ -54,6 +54,8 @@ #define USE_TOYBOX_UTMPX(...) #define CFG_ACPI 1 #define USE_ACPI(...) __VA_ARGS__ +#define CFG_ARCH 0 +#define USE_ARCH(...) #define CFG_ARPING 0 #define USE_ARPING(...) #define CFG_ARP 0 @@ -166,6 +168,8 @@ #define USE_DIRNAME(...) __VA_ARGS__ #define CFG_DMESG 1 #define USE_DMESG(...) __VA_ARGS__ +#define CFG_DNSDOMAINNAME 0 +#define USE_DNSDOMAINNAME(...) #define CFG_DOS2UNIX 1 #define USE_DOS2UNIX(...) __VA_ARGS__ #define CFG_DUMPLEASES 0 diff --git a/android/device/generated/flags.h b/android/device/generated/flags.h index 2254fb80..02b70200 100644 --- a/android/device/generated/flags.h +++ b/android/device/generated/flags.h @@ -21,6 +21,14 @@ #undef FLAG_a #endif +// arch +#undef OPTSTR_arch +#define OPTSTR_arch 0 +#ifdef CLEANUP_arch +#undef CLEANUP_arch +#undef FOR_arch +#endif + // arp vi:nDsdap:A:H:[+Ap][!sd] #undef OPTSTR_arp #define OPTSTR_arp "vi:nDsdap:A:H:[+Ap][!sd]" @@ -305,9 +313,9 @@ #undef FOR_clear #endif -// cmp <2>2ls(silent)(quiet)[!ls] <2>2ls(silent)(quiet)[!ls] +// cmp <1>2ls(silent)(quiet)[!ls] <1>2ls(silent)(quiet)[!ls] #undef OPTSTR_cmp -#define OPTSTR_cmp "<2>2ls(silent)(quiet)[!ls]" +#define OPTSTR_cmp "<1>2ls(silent)(quiet)[!ls]" #ifdef CLEANUP_cmp #undef CLEANUP_cmp #undef FOR_cmp @@ -691,6 +699,14 @@ #undef FLAG_w #endif +// dnsdomainname >0 +#undef OPTSTR_dnsdomainname +#define OPTSTR_dnsdomainname ">0" +#ifdef CLEANUP_dnsdomainname +#undef CLEANUP_dnsdomainname +#undef FOR_dnsdomainname +#endif + // dos2unix #undef OPTSTR_dos2unix #define OPTSTR_dos2unix 0 @@ -3284,9 +3300,9 @@ #undef FLAG_a #endif -// xargs ^E:optrn#<1(max-args)s#0[!0E] ^E:optrn#<1(max-args)s#0[!0E] +// xargs ^E:P#optrn#<1(max-args)s#0[!0E] ^E:P#optrn#<1(max-args)s#0[!0E] #undef OPTSTR_xargs -#define OPTSTR_xargs "^E:optrn#<1(max-args)s#0[!0E]" +#define OPTSTR_xargs "^E:P#optrn#<1(max-args)s#0[!0E]" #ifdef CLEANUP_xargs #undef CLEANUP_xargs #undef FOR_xargs @@ -3297,6 +3313,7 @@ #undef FLAG_t #undef FLAG_p #undef FLAG_o +#undef FLAG_P #undef FLAG_E #endif @@ -3364,6 +3381,12 @@ #define FLAG_a (1<<4) #endif +#ifdef FOR_arch +#ifndef TT +#define TT this.arch +#endif +#endif + #ifdef FOR_arp #ifndef TT #define TT this.arp @@ -3936,6 +3959,12 @@ #define FLAG_w (1<<8) #endif +#ifdef FOR_dnsdomainname +#ifndef TT +#define TT this.dnsdomainname +#endif +#endif + #ifdef FOR_dos2unix #ifndef TT #define TT this.dos2unix @@ -6118,7 +6147,8 @@ #define FLAG_t (1<<4) #define FLAG_p (1<<5) #define FLAG_o (1<<6) -#define FLAG_E (1<<7) +#define FLAG_P (1<<7) +#define FLAG_E (1<<8) #endif #ifdef FOR_xxd diff --git a/android/device/generated/globals.h b/android/device/generated/globals.h index dfa399ca..c2b3d58e 100644 --- a/android/device/generated/globals.h +++ b/android/device/generated/globals.h @@ -1415,7 +1415,7 @@ struct wc_data { // toys/posix/xargs.c struct xargs_data { - long s, n; + long s, n, P; char *E; long entries, bytes; diff --git a/android/device/generated/help.h b/android/device/generated/help.h index 6902208b..bcd28a87 100644 --- a/android/device/generated/help.h +++ b/android/device/generated/help.h @@ -102,6 +102,8 @@ #define HELP_killall "usage: killall [-l] [-iqv] [-SIGNAL|-s SIGNAL] PROCESS_NAME...\n\nSend a signal (default: TERM) to all processes with the given names.\n\n-i Ask for confirmation before killing\n-l Print list of all available signals\n-q Don't print any warnings or error messages\n-s Send SIGNAL instead of SIGTERM\n-v Report if the signal was successfully sent\n-w Wait until all signaled processes are dead" +#define HELP_dnsdomainname "usage: dnsdomainname\n\nShow domain this system belongs to (same as hostname -d)." + #define HELP_hostname "usage: hostname [-bdsf] [-F FILENAME] [newname]\n\nGet/set the current hostname.\n\n-b Set hostname to 'localhost' if otherwise unset\n-d Show DNS domain name (no host)\n-f Show fully-qualified name (host+domain, FQDN)\n-F Set hostname to contents of FILENAME\n-s Show short host name (no domain)" #define HELP_zcat "usage: zcat [FILE...]\n\nDecompress files to stdout. Like `gzip -dc`.\n\n-f Force: allow read from tty" @@ -434,7 +436,7 @@ #define HELP_arp "usage: arp\n[-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME]\n[-v] [-i IF] -d HOSTNAME [pub]\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [temp]\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [netmask MASK] pub\n[-v] [-H HWTYPE] [-i IF] -Ds HOSTNAME IFACE [netmask MASK] pub\n\nManipulate ARP cache\n\n-a Display (all) hosts\n-s Set new ARP entry\n-d Delete a specified entry\n-v Verbose\n-n Don't resolve names\n-i IF Network interface\n-D Read <hwaddr> from given device\n-A,-p AF Protocol family\n-H HWTYPE Hardware address type" -#define HELP_xargs "usage: xargs [-0prt] [-s NUM] [-n NUM] [-E STR] COMMAND...\n\nRun command line one or more times, appending arguments from stdin.\n\nIf command exits with 255, don't launch another even if arguments remain.\n\n-0 Each argument is NULL terminated, no whitespace or quote processing\n-E Stop at line matching string\n-n Max number of arguments per command\n-o Open tty for COMMAND's stdin (default /dev/null)\n-p Prompt for y/n from tty before running each command\n-r Don't run command with empty input\n-s Size in bytes per command line\n-t Trace, print command line to stderr" +#define HELP_xargs "usage: xargs [-0prt] [-s NUM] [-n NUM] [-E STR] COMMAND...\n\nRun command line one or more times, appending arguments from stdin.\n\nIf COMMAND exits with 255, don't launch another even if arguments remain.\n\n-0 Each argument is NULL terminated, no whitespace or quote processing\n-E Stop at line matching string\n-n Max number of arguments per command\n-o Open tty for COMMAND's stdin (default /dev/null)\n-p Prompt for y/n from tty before running each command\n-r Don't run command with empty input (otherwise always run command once)\n-s Size in bytes per command line\n-t Trace, print command line to stderr" #define HELP_who "usage: who\n\nPrint information about logged in users." @@ -450,6 +452,8 @@ #define HELP_uname "usage: uname [-asnrvm]\n\nPrint system information.\n\n-s System name\n-n Network (domain) name\n-r Kernel Release number\n-v Kernel Version\n-m Machine (hardware) name\n-a All of the above" +#define HELP_arch "usage: arch\n\nPrint machine (hardware) name, same as uname -m." + #define HELP_ulimit "usage: ulimit [-P PID] [-SHRacdefilmnpqrstuv] [LIMIT]\n\nPrint or set resource limits for process number PID. If no LIMIT specified\n(or read-only -ap selected) display current value (sizes in bytes).\nDefault is ulimit -P $PPID -Sf\" (show soft filesize of your shell).\n\n-S Set/show soft limit -H Set/show hard (maximum) limit\n-a Show all limits -c Core file size\n-d Process data segment -e Max scheduling priority\n-f Output file size -i Pending signal count\n-l Locked memory -m Resident Set Size\n-n Number of open files -p Pipe buffer\n-q Posix message queue -r Max Real-time priority\n-R Realtime latency (usec) -s Stack size\n-t Total CPU time (in seconds) -u Maximum processes (under this UID)\n-v Virtual memory size -P PID to affect (default $PPID)" #define HELP_tty "usage: tty [-s]\n\nShow filename of terminal connected to stdin.\n\nPrints \"not a tty\" and exits with nonzero status if no terminal\nis connected to stdin.\n\n-s Silent, exit code only" @@ -578,7 +582,7 @@ #define HELP_comm "usage: comm [-123] FILE1 FILE2\n\nRead FILE1 and FILE2, which should be ordered, and produce three text\ncolumns as output: lines only in FILE1; lines only in FILE2; and lines\nin both files. Filename \"-\" is a synonym for stdin.\n\n-1 Suppress the output column of lines unique to FILE1\n-2 Suppress the output column of lines unique to FILE2\n-3 Suppress the output column of lines duplicated in FILE1 and FILE2" -#define HELP_cmp "usage: cmp [-l] [-s] FILE1 FILE2\n\nCompare the contents of two files.\n\n-l Show all differing bytes\n-s Silent" +#define HELP_cmp "usage: cmp [-l] [-s] FILE1 [FILE2 [SKIP1 [SKIP2]]]\n\nCompare the contents of two files. (Or stdin and file if only one given.)\n\n-l Show all differing bytes\n-s Silent" #define HELP_crc32 "usage: crc32 [file...]\n\nOutput crc32 checksum for each file." diff --git a/android/device/generated/newtoys.h b/android/device/generated/newtoys.h index 0f6410a6..68fda2a7 100644 --- a/android/device/generated/newtoys.h +++ b/android/device/generated/newtoys.h @@ -7,6 +7,7 @@ USE_TEST(OLDTOY([, test, TOYFLAG_NOFORK|TOYFLAG_NOHELP)) USE_ACPI(NEWTOY(acpi, "abctV", TOYFLAG_USR|TOYFLAG_BIN)) USE_GROUPADD(OLDTOY(addgroup, groupadd, TOYFLAG_NEEDROOT|TOYFLAG_SBIN)) USE_USERADD(OLDTOY(adduser, useradd, TOYFLAG_NEEDROOT|TOYFLAG_UMASK|TOYFLAG_SBIN)) +USE_ARCH(NEWTOY(arch, 0, TOYFLAG_USR|TOYFLAG_BIN)) USE_ARP(NEWTOY(arp, "vi:nDsdap:A:H:[+Ap][!sd]", TOYFLAG_USR|TOYFLAG_BIN)) USE_ARPING(NEWTOY(arping, "<1>1s:I:w#<0c#<0AUDbqf[+AU][+Df]", TOYFLAG_USR|TOYFLAG_SBIN)) USE_ASCII(NEWTOY(ascii, 0, TOYFLAG_USR|TOYFLAG_BIN)) @@ -34,7 +35,7 @@ USE_CHRT(NEWTOY(chrt, "^mp#<0iRbrfo[!ibrfo]", TOYFLAG_USR|TOYFLAG_BIN)) USE_CHVT(NEWTOY(chvt, "<1", TOYFLAG_USR|TOYFLAG_BIN)) USE_CKSUM(NEWTOY(cksum, "HIPLN", TOYFLAG_BIN)) USE_CLEAR(NEWTOY(clear, NULL, TOYFLAG_USR|TOYFLAG_BIN)) -USE_CMP(NEWTOY(cmp, "<2>2ls(silent)(quiet)[!ls]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2))) +USE_CMP(NEWTOY(cmp, "<1>2ls(silent)(quiet)[!ls]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2))) USE_COMM(NEWTOY(comm, "<2>2321", TOYFLAG_USR|TOYFLAG_BIN)) USE_COUNT(NEWTOY(count, NULL, TOYFLAG_USR|TOYFLAG_BIN)) USE_CP(NEWTOY(cp, "<2"USE_CP_PRESERVE("(preserve):;")"D(parents)RHLPprdaslvnF(remove-destination)fi[-HLPd][-ni]", TOYFLAG_BIN)) @@ -60,6 +61,7 @@ USE_DHCPD(NEWTOY(dhcpd, ">1P#<0>65535fi:S46[!46]", TOYFLAG_SBIN|TOYFLAG_ROOTONLY USE_DIFF(NEWTOY(diff, "<2>2(color)(strip-trailing-cr)B(ignore-blank-lines)d(minimal)b(ignore-space-change)ut(expand-tabs)w(ignore-all-space)i(ignore-case)T(initial-tab)s(report-identical-files)q(brief)a(text)L(label)*S(starting-file):N(new-file)r(recursive)U(unified)#<0=3", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2))) USE_DIRNAME(NEWTOY(dirname, "<1", TOYFLAG_USR|TOYFLAG_BIN)) USE_DMESG(NEWTOY(dmesg, "w(follow)CSTtrs#<1n#c[!Ttr][!Cc][!Sw]", TOYFLAG_BIN)) +USE_DNSDOMAINNAME(NEWTOY(dnsdomainname, ">0", TOYFLAG_BIN)) USE_DOS2UNIX(NEWTOY(dos2unix, 0, TOYFLAG_BIN)) USE_DU(NEWTOY(du, "d#<0=-1hmlcaHkKLsx[-HL][-kKmh]", TOYFLAG_USR|TOYFLAG_BIN)) USE_DUMPLEASES(NEWTOY(dumpleases, ">0arf:[!ar]", TOYFLAG_USR|TOYFLAG_BIN)) @@ -292,7 +294,7 @@ USE_WGET(NEWTOY(wget, "(no-check-certificate)O:", TOYFLAG_USR|TOYFLAG_BIN)) USE_WHICH(NEWTOY(which, "<1a", TOYFLAG_USR|TOYFLAG_BIN)) USE_WHO(NEWTOY(who, "a", TOYFLAG_USR|TOYFLAG_BIN)) USE_WHOAMI(OLDTOY(whoami, logname, TOYFLAG_USR|TOYFLAG_BIN)) -USE_XARGS(NEWTOY(xargs, "^E:optrn#<1(max-args)s#0[!0E]", TOYFLAG_USR|TOYFLAG_BIN)) +USE_XARGS(NEWTOY(xargs, "^E:P#optrn#<1(max-args)s#0[!0E]", TOYFLAG_USR|TOYFLAG_BIN)) USE_XXD(NEWTOY(xxd, ">1c#l#o#g#<1=2iprs#[!rs]", TOYFLAG_USR|TOYFLAG_BIN)) USE_XZCAT(NEWTOY(xzcat, NULL, TOYFLAG_USR|TOYFLAG_BIN)) USE_YES(NEWTOY(yes, NULL, TOYFLAG_USR|TOYFLAG_BIN)) diff --git a/android/linux/generated/config.h b/android/linux/generated/config.h index c2f4d693..270d17a7 100644 --- a/android/linux/generated/config.h +++ b/android/linux/generated/config.h @@ -20,6 +20,8 @@ #define USE_TOYBOX_PRLIMIT(...) #define CFG_TOYBOX_GETRANDOM 0 #define USE_TOYBOX_GETRANDOM(...) +#define CFG_ARCH 0 +#define USE_ARCH(...) #define CFG_BASENAME 1 #define USE_BASENAME(...) __VA_ARGS__ #define CFG_CAL 0 @@ -48,6 +50,8 @@ #define USE_CP(...) __VA_ARGS__ #define CFG_CP_PRESERVE 1 #define USE_CP_PRESERVE(...) __VA_ARGS__ +#define CFG_DNSDOMAINNAME 0 +#define USE_DNSDOMAINNAME(...) #define CFG_MV 1 #define USE_MV(...) __VA_ARGS__ #define CFG_INSTALL 0 diff --git a/android/linux/generated/flags.h b/android/linux/generated/flags.h index 21ce7dfe..6b01df3a 100644 --- a/android/linux/generated/flags.h +++ b/android/linux/generated/flags.h @@ -21,6 +21,14 @@ #undef FLAG_a #endif +// arch +#undef OPTSTR_arch +#define OPTSTR_arch 0 +#ifdef CLEANUP_arch +#undef CLEANUP_arch +#undef FOR_arch +#endif + // arp vi:nDsdap:A:H:[+Ap][!sd] #undef OPTSTR_arp #define OPTSTR_arp "vi:nDsdap:A:H:[+Ap][!sd]" @@ -305,9 +313,9 @@ #undef FOR_clear #endif -// cmp <2>2ls(silent)(quiet)[!ls] <2>2ls(silent)(quiet)[!ls] +// cmp <1>2ls(silent)(quiet)[!ls] <1>2ls(silent)(quiet)[!ls] #undef OPTSTR_cmp -#define OPTSTR_cmp "<2>2ls(silent)(quiet)[!ls]" +#define OPTSTR_cmp "<1>2ls(silent)(quiet)[!ls]" #ifdef CLEANUP_cmp #undef CLEANUP_cmp #undef FOR_cmp @@ -691,6 +699,14 @@ #undef FLAG_w #endif +// dnsdomainname >0 +#undef OPTSTR_dnsdomainname +#define OPTSTR_dnsdomainname ">0" +#ifdef CLEANUP_dnsdomainname +#undef CLEANUP_dnsdomainname +#undef FOR_dnsdomainname +#endif + // dos2unix #undef OPTSTR_dos2unix #define OPTSTR_dos2unix 0 @@ -3284,9 +3300,9 @@ #undef FLAG_a #endif -// xargs ^E:optrn#<1(max-args)s#0[!0E] ^E:optrn#<1(max-args)s#0[!0E] +// xargs ^E:P#optrn#<1(max-args)s#0[!0E] ^E:P#optrn#<1(max-args)s#0[!0E] #undef OPTSTR_xargs -#define OPTSTR_xargs "^E:optrn#<1(max-args)s#0[!0E]" +#define OPTSTR_xargs "^E:P#optrn#<1(max-args)s#0[!0E]" #ifdef CLEANUP_xargs #undef CLEANUP_xargs #undef FOR_xargs @@ -3297,6 +3313,7 @@ #undef FLAG_t #undef FLAG_p #undef FLAG_o +#undef FLAG_P #undef FLAG_E #endif @@ -3364,6 +3381,12 @@ #define FLAG_a (FORCED_FLAG<<4) #endif +#ifdef FOR_arch +#ifndef TT +#define TT this.arch +#endif +#endif + #ifdef FOR_arp #ifndef TT #define TT this.arp @@ -3936,6 +3959,12 @@ #define FLAG_w (FORCED_FLAG<<8) #endif +#ifdef FOR_dnsdomainname +#ifndef TT +#define TT this.dnsdomainname +#endif +#endif + #ifdef FOR_dos2unix #ifndef TT #define TT this.dos2unix @@ -6118,7 +6147,8 @@ #define FLAG_t (1<<4) #define FLAG_p (1<<5) #define FLAG_o (1<<6) -#define FLAG_E (1<<7) +#define FLAG_P (1<<7) +#define FLAG_E (1<<8) #endif #ifdef FOR_xxd diff --git a/android/linux/generated/globals.h b/android/linux/generated/globals.h index dfa399ca..c2b3d58e 100644 --- a/android/linux/generated/globals.h +++ b/android/linux/generated/globals.h @@ -1415,7 +1415,7 @@ struct wc_data { // toys/posix/xargs.c struct xargs_data { - long s, n; + long s, n, P; char *E; long entries, bytes; diff --git a/android/linux/generated/help.h b/android/linux/generated/help.h index 5543eaa6..3497a1d4 100644 --- a/android/linux/generated/help.h +++ b/android/linux/generated/help.h @@ -102,6 +102,8 @@ #define HELP_killall "usage: killall [-l] [-iqv] [-SIGNAL|-s SIGNAL] PROCESS_NAME...\n\nSend a signal (default: TERM) to all processes with the given names.\n\n-i Ask for confirmation before killing\n-l Print list of all available signals\n-q Don't print any warnings or error messages\n-s Send SIGNAL instead of SIGTERM\n-v Report if the signal was successfully sent\n-w Wait until all signaled processes are dead" +#define HELP_dnsdomainname "usage: dnsdomainname\n\nShow domain this system belongs to (same as hostname -d)." + #define HELP_hostname "usage: hostname [-bdsf] [-F FILENAME] [newname]\n\nGet/set the current hostname.\n\n-b Set hostname to 'localhost' if otherwise unset\n-d Show DNS domain name (no host)\n-f Show fully-qualified name (host+domain, FQDN)\n-F Set hostname to contents of FILENAME\n-s Show short host name (no domain)" #define HELP_zcat "usage: zcat [FILE...]\n\nDecompress files to stdout. Like `gzip -dc`.\n\n-f Force: allow read from tty" @@ -438,7 +440,7 @@ #define HELP_arp "usage: arp\n[-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME]\n[-v] [-i IF] -d HOSTNAME [pub]\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [temp]\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [netmask MASK] pub\n[-v] [-H HWTYPE] [-i IF] -Ds HOSTNAME IFACE [netmask MASK] pub\n\nManipulate ARP cache\n\n-a Display (all) hosts\n-s Set new ARP entry\n-d Delete a specified entry\n-v Verbose\n-n Don't resolve names\n-i IF Network interface\n-D Read <hwaddr> from given device\n-A,-p AF Protocol family\n-H HWTYPE Hardware address type" -#define HELP_xargs "usage: xargs [-0prt] [-s NUM] [-n NUM] [-E STR] COMMAND...\n\nRun command line one or more times, appending arguments from stdin.\n\nIf command exits with 255, don't launch another even if arguments remain.\n\n-0 Each argument is NULL terminated, no whitespace or quote processing\n-E Stop at line matching string\n-n Max number of arguments per command\n-o Open tty for COMMAND's stdin (default /dev/null)\n-p Prompt for y/n from tty before running each command\n-r Don't run command with empty input\n-s Size in bytes per command line\n-t Trace, print command line to stderr" +#define HELP_xargs "usage: xargs [-0prt] [-s NUM] [-n NUM] [-E STR] COMMAND...\n\nRun command line one or more times, appending arguments from stdin.\n\nIf COMMAND exits with 255, don't launch another even if arguments remain.\n\n-0 Each argument is NULL terminated, no whitespace or quote processing\n-E Stop at line matching string\n-n Max number of arguments per command\n-o Open tty for COMMAND's stdin (default /dev/null)\n-p Prompt for y/n from tty before running each command\n-r Don't run command with empty input (otherwise always run command once)\n-s Size in bytes per command line\n-t Trace, print command line to stderr" #define HELP_who "usage: who\n\nPrint information about logged in users." @@ -454,6 +456,8 @@ #define HELP_uname "usage: uname [-asnrvm]\n\nPrint system information.\n\n-s System name\n-n Network (domain) name\n-r Kernel Release number\n-v Kernel Version\n-m Machine (hardware) name\n-a All of the above" +#define HELP_arch "usage: arch\n\nPrint machine (hardware) name, same as uname -m." + #define HELP_ulimit "usage: ulimit [-P PID] [-SHRacdefilmnpqrstuv] [LIMIT]\n\nPrint or set resource limits for process number PID. If no LIMIT specified\n(or read-only -ap selected) display current value (sizes in bytes).\nDefault is ulimit -P $PPID -Sf\" (show soft filesize of your shell).\n\n-S Set/show soft limit -H Set/show hard (maximum) limit\n-a Show all limits -c Core file size\n-d Process data segment -e Max scheduling priority\n-f Output file size -i Pending signal count\n-l Locked memory -m Resident Set Size\n-n Number of open files -p Pipe buffer\n-q Posix message queue -r Max Real-time priority\n-R Realtime latency (usec) -s Stack size\n-t Total CPU time (in seconds) -u Maximum processes (under this UID)\n-v Virtual memory size -P PID to affect (default $PPID)" #define HELP_tty "usage: tty [-s]\n\nShow filename of terminal connected to stdin.\n\nPrints \"not a tty\" and exits with nonzero status if no terminal\nis connected to stdin.\n\n-s Silent, exit code only" @@ -586,7 +590,7 @@ #define HELP_comm "usage: comm [-123] FILE1 FILE2\n\nRead FILE1 and FILE2, which should be ordered, and produce three text\ncolumns as output: lines only in FILE1; lines only in FILE2; and lines\nin both files. Filename \"-\" is a synonym for stdin.\n\n-1 Suppress the output column of lines unique to FILE1\n-2 Suppress the output column of lines unique to FILE2\n-3 Suppress the output column of lines duplicated in FILE1 and FILE2" -#define HELP_cmp "usage: cmp [-l] [-s] FILE1 FILE2\n\nCompare the contents of two files.\n\n-l Show all differing bytes\n-s Silent" +#define HELP_cmp "usage: cmp [-l] [-s] FILE1 [FILE2 [SKIP1 [SKIP2]]]\n\nCompare the contents of two files. (Or stdin and file if only one given.)\n\n-l Show all differing bytes\n-s Silent" #define HELP_crc32 "usage: crc32 [file...]\n\nOutput crc32 checksum for each file." diff --git a/android/linux/generated/newtoys.h b/android/linux/generated/newtoys.h index 0f6410a6..68fda2a7 100644 --- a/android/linux/generated/newtoys.h +++ b/android/linux/generated/newtoys.h @@ -7,6 +7,7 @@ USE_TEST(OLDTOY([, test, TOYFLAG_NOFORK|TOYFLAG_NOHELP)) USE_ACPI(NEWTOY(acpi, "abctV", TOYFLAG_USR|TOYFLAG_BIN)) USE_GROUPADD(OLDTOY(addgroup, groupadd, TOYFLAG_NEEDROOT|TOYFLAG_SBIN)) USE_USERADD(OLDTOY(adduser, useradd, TOYFLAG_NEEDROOT|TOYFLAG_UMASK|TOYFLAG_SBIN)) +USE_ARCH(NEWTOY(arch, 0, TOYFLAG_USR|TOYFLAG_BIN)) USE_ARP(NEWTOY(arp, "vi:nDsdap:A:H:[+Ap][!sd]", TOYFLAG_USR|TOYFLAG_BIN)) USE_ARPING(NEWTOY(arping, "<1>1s:I:w#<0c#<0AUDbqf[+AU][+Df]", TOYFLAG_USR|TOYFLAG_SBIN)) USE_ASCII(NEWTOY(ascii, 0, TOYFLAG_USR|TOYFLAG_BIN)) @@ -34,7 +35,7 @@ USE_CHRT(NEWTOY(chrt, "^mp#<0iRbrfo[!ibrfo]", TOYFLAG_USR|TOYFLAG_BIN)) USE_CHVT(NEWTOY(chvt, "<1", TOYFLAG_USR|TOYFLAG_BIN)) USE_CKSUM(NEWTOY(cksum, "HIPLN", TOYFLAG_BIN)) USE_CLEAR(NEWTOY(clear, NULL, TOYFLAG_USR|TOYFLAG_BIN)) -USE_CMP(NEWTOY(cmp, "<2>2ls(silent)(quiet)[!ls]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2))) +USE_CMP(NEWTOY(cmp, "<1>2ls(silent)(quiet)[!ls]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2))) USE_COMM(NEWTOY(comm, "<2>2321", TOYFLAG_USR|TOYFLAG_BIN)) USE_COUNT(NEWTOY(count, NULL, TOYFLAG_USR|TOYFLAG_BIN)) USE_CP(NEWTOY(cp, "<2"USE_CP_PRESERVE("(preserve):;")"D(parents)RHLPprdaslvnF(remove-destination)fi[-HLPd][-ni]", TOYFLAG_BIN)) @@ -60,6 +61,7 @@ USE_DHCPD(NEWTOY(dhcpd, ">1P#<0>65535fi:S46[!46]", TOYFLAG_SBIN|TOYFLAG_ROOTONLY USE_DIFF(NEWTOY(diff, "<2>2(color)(strip-trailing-cr)B(ignore-blank-lines)d(minimal)b(ignore-space-change)ut(expand-tabs)w(ignore-all-space)i(ignore-case)T(initial-tab)s(report-identical-files)q(brief)a(text)L(label)*S(starting-file):N(new-file)r(recursive)U(unified)#<0=3", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2))) USE_DIRNAME(NEWTOY(dirname, "<1", TOYFLAG_USR|TOYFLAG_BIN)) USE_DMESG(NEWTOY(dmesg, "w(follow)CSTtrs#<1n#c[!Ttr][!Cc][!Sw]", TOYFLAG_BIN)) +USE_DNSDOMAINNAME(NEWTOY(dnsdomainname, ">0", TOYFLAG_BIN)) USE_DOS2UNIX(NEWTOY(dos2unix, 0, TOYFLAG_BIN)) USE_DU(NEWTOY(du, "d#<0=-1hmlcaHkKLsx[-HL][-kKmh]", TOYFLAG_USR|TOYFLAG_BIN)) USE_DUMPLEASES(NEWTOY(dumpleases, ">0arf:[!ar]", TOYFLAG_USR|TOYFLAG_BIN)) @@ -292,7 +294,7 @@ USE_WGET(NEWTOY(wget, "(no-check-certificate)O:", TOYFLAG_USR|TOYFLAG_BIN)) USE_WHICH(NEWTOY(which, "<1a", TOYFLAG_USR|TOYFLAG_BIN)) USE_WHO(NEWTOY(who, "a", TOYFLAG_USR|TOYFLAG_BIN)) USE_WHOAMI(OLDTOY(whoami, logname, TOYFLAG_USR|TOYFLAG_BIN)) -USE_XARGS(NEWTOY(xargs, "^E:optrn#<1(max-args)s#0[!0E]", TOYFLAG_USR|TOYFLAG_BIN)) +USE_XARGS(NEWTOY(xargs, "^E:P#optrn#<1(max-args)s#0[!0E]", TOYFLAG_USR|TOYFLAG_BIN)) USE_XXD(NEWTOY(xxd, ">1c#l#o#g#<1=2iprs#[!rs]", TOYFLAG_USR|TOYFLAG_BIN)) USE_XZCAT(NEWTOY(xzcat, NULL, TOYFLAG_USR|TOYFLAG_BIN)) USE_YES(NEWTOY(yes, NULL, TOYFLAG_USR|TOYFLAG_BIN)) diff --git a/android/mac/generated/config.h b/android/mac/generated/config.h index e9a8c437..8e23d5ed 100644 --- a/android/mac/generated/config.h +++ b/android/mac/generated/config.h @@ -20,6 +20,8 @@ #define USE_TOYBOX_PRLIMIT(...) #define CFG_TOYBOX_GETRANDOM 0 #define USE_TOYBOX_GETRANDOM(...) +#define CFG_ARCH 0 +#define USE_ARCH(...) #define CFG_BASENAME 1 #define USE_BASENAME(...) __VA_ARGS__ #define CFG_CAL 0 @@ -48,6 +50,8 @@ #define USE_CP(...) __VA_ARGS__ #define CFG_CP_PRESERVE 1 #define USE_CP_PRESERVE(...) __VA_ARGS__ +#define CFG_DNSDOMAINNAME 0 +#define USE_DNSDOMAINNAME(...) #define CFG_MV 1 #define USE_MV(...) __VA_ARGS__ #define CFG_INSTALL 0 diff --git a/android/mac/generated/flags.h b/android/mac/generated/flags.h index a982a8d1..83c22e08 100644 --- a/android/mac/generated/flags.h +++ b/android/mac/generated/flags.h @@ -21,6 +21,14 @@ #undef FLAG_a #endif +// arch +#undef OPTSTR_arch +#define OPTSTR_arch 0 +#ifdef CLEANUP_arch +#undef CLEANUP_arch +#undef FOR_arch +#endif + // arp vi:nDsdap:A:H:[+Ap][!sd] #undef OPTSTR_arp #define OPTSTR_arp "vi:nDsdap:A:H:[+Ap][!sd]" @@ -305,9 +313,9 @@ #undef FOR_clear #endif -// cmp <2>2ls(silent)(quiet)[!ls] <2>2ls(silent)(quiet)[!ls] +// cmp <1>2ls(silent)(quiet)[!ls] <1>2ls(silent)(quiet)[!ls] #undef OPTSTR_cmp -#define OPTSTR_cmp "<2>2ls(silent)(quiet)[!ls]" +#define OPTSTR_cmp "<1>2ls(silent)(quiet)[!ls]" #ifdef CLEANUP_cmp #undef CLEANUP_cmp #undef FOR_cmp @@ -691,6 +699,14 @@ #undef FLAG_w #endif +// dnsdomainname >0 +#undef OPTSTR_dnsdomainname +#define OPTSTR_dnsdomainname ">0" +#ifdef CLEANUP_dnsdomainname +#undef CLEANUP_dnsdomainname +#undef FOR_dnsdomainname +#endif + // dos2unix #undef OPTSTR_dos2unix #define OPTSTR_dos2unix 0 @@ -3284,9 +3300,9 @@ #undef FLAG_a #endif -// xargs ^E:optrn#<1(max-args)s#0[!0E] ^E:optrn#<1(max-args)s#0[!0E] +// xargs ^E:P#optrn#<1(max-args)s#0[!0E] ^E:P#optrn#<1(max-args)s#0[!0E] #undef OPTSTR_xargs -#define OPTSTR_xargs "^E:optrn#<1(max-args)s#0[!0E]" +#define OPTSTR_xargs "^E:P#optrn#<1(max-args)s#0[!0E]" #ifdef CLEANUP_xargs #undef CLEANUP_xargs #undef FOR_xargs @@ -3297,6 +3313,7 @@ #undef FLAG_t #undef FLAG_p #undef FLAG_o +#undef FLAG_P #undef FLAG_E #endif @@ -3364,6 +3381,12 @@ #define FLAG_a (FORCED_FLAG<<4) #endif +#ifdef FOR_arch +#ifndef TT +#define TT this.arch +#endif +#endif + #ifdef FOR_arp #ifndef TT #define TT this.arp @@ -3936,6 +3959,12 @@ #define FLAG_w (FORCED_FLAG<<8) #endif +#ifdef FOR_dnsdomainname +#ifndef TT +#define TT this.dnsdomainname +#endif +#endif + #ifdef FOR_dos2unix #ifndef TT #define TT this.dos2unix @@ -6118,7 +6147,8 @@ #define FLAG_t (1<<4) #define FLAG_p (1<<5) #define FLAG_o (1<<6) -#define FLAG_E (1<<7) +#define FLAG_P (1<<7) +#define FLAG_E (1<<8) #endif #ifdef FOR_xxd diff --git a/android/mac/generated/globals.h b/android/mac/generated/globals.h index dfa399ca..c2b3d58e 100644 --- a/android/mac/generated/globals.h +++ b/android/mac/generated/globals.h @@ -1415,7 +1415,7 @@ struct wc_data { // toys/posix/xargs.c struct xargs_data { - long s, n; + long s, n, P; char *E; long entries, bytes; diff --git a/android/mac/generated/help.h b/android/mac/generated/help.h index 5543eaa6..3497a1d4 100644 --- a/android/mac/generated/help.h +++ b/android/mac/generated/help.h @@ -102,6 +102,8 @@ #define HELP_killall "usage: killall [-l] [-iqv] [-SIGNAL|-s SIGNAL] PROCESS_NAME...\n\nSend a signal (default: TERM) to all processes with the given names.\n\n-i Ask for confirmation before killing\n-l Print list of all available signals\n-q Don't print any warnings or error messages\n-s Send SIGNAL instead of SIGTERM\n-v Report if the signal was successfully sent\n-w Wait until all signaled processes are dead" +#define HELP_dnsdomainname "usage: dnsdomainname\n\nShow domain this system belongs to (same as hostname -d)." + #define HELP_hostname "usage: hostname [-bdsf] [-F FILENAME] [newname]\n\nGet/set the current hostname.\n\n-b Set hostname to 'localhost' if otherwise unset\n-d Show DNS domain name (no host)\n-f Show fully-qualified name (host+domain, FQDN)\n-F Set hostname to contents of FILENAME\n-s Show short host name (no domain)" #define HELP_zcat "usage: zcat [FILE...]\n\nDecompress files to stdout. Like `gzip -dc`.\n\n-f Force: allow read from tty" @@ -438,7 +440,7 @@ #define HELP_arp "usage: arp\n[-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME]\n[-v] [-i IF] -d HOSTNAME [pub]\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [temp]\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [netmask MASK] pub\n[-v] [-H HWTYPE] [-i IF] -Ds HOSTNAME IFACE [netmask MASK] pub\n\nManipulate ARP cache\n\n-a Display (all) hosts\n-s Set new ARP entry\n-d Delete a specified entry\n-v Verbose\n-n Don't resolve names\n-i IF Network interface\n-D Read <hwaddr> from given device\n-A,-p AF Protocol family\n-H HWTYPE Hardware address type" -#define HELP_xargs "usage: xargs [-0prt] [-s NUM] [-n NUM] [-E STR] COMMAND...\n\nRun command line one or more times, appending arguments from stdin.\n\nIf command exits with 255, don't launch another even if arguments remain.\n\n-0 Each argument is NULL terminated, no whitespace or quote processing\n-E Stop at line matching string\n-n Max number of arguments per command\n-o Open tty for COMMAND's stdin (default /dev/null)\n-p Prompt for y/n from tty before running each command\n-r Don't run command with empty input\n-s Size in bytes per command line\n-t Trace, print command line to stderr" +#define HELP_xargs "usage: xargs [-0prt] [-s NUM] [-n NUM] [-E STR] COMMAND...\n\nRun command line one or more times, appending arguments from stdin.\n\nIf COMMAND exits with 255, don't launch another even if arguments remain.\n\n-0 Each argument is NULL terminated, no whitespace or quote processing\n-E Stop at line matching string\n-n Max number of arguments per command\n-o Open tty for COMMAND's stdin (default /dev/null)\n-p Prompt for y/n from tty before running each command\n-r Don't run command with empty input (otherwise always run command once)\n-s Size in bytes per command line\n-t Trace, print command line to stderr" #define HELP_who "usage: who\n\nPrint information about logged in users." @@ -454,6 +456,8 @@ #define HELP_uname "usage: uname [-asnrvm]\n\nPrint system information.\n\n-s System name\n-n Network (domain) name\n-r Kernel Release number\n-v Kernel Version\n-m Machine (hardware) name\n-a All of the above" +#define HELP_arch "usage: arch\n\nPrint machine (hardware) name, same as uname -m." + #define HELP_ulimit "usage: ulimit [-P PID] [-SHRacdefilmnpqrstuv] [LIMIT]\n\nPrint or set resource limits for process number PID. If no LIMIT specified\n(or read-only -ap selected) display current value (sizes in bytes).\nDefault is ulimit -P $PPID -Sf\" (show soft filesize of your shell).\n\n-S Set/show soft limit -H Set/show hard (maximum) limit\n-a Show all limits -c Core file size\n-d Process data segment -e Max scheduling priority\n-f Output file size -i Pending signal count\n-l Locked memory -m Resident Set Size\n-n Number of open files -p Pipe buffer\n-q Posix message queue -r Max Real-time priority\n-R Realtime latency (usec) -s Stack size\n-t Total CPU time (in seconds) -u Maximum processes (under this UID)\n-v Virtual memory size -P PID to affect (default $PPID)" #define HELP_tty "usage: tty [-s]\n\nShow filename of terminal connected to stdin.\n\nPrints \"not a tty\" and exits with nonzero status if no terminal\nis connected to stdin.\n\n-s Silent, exit code only" @@ -586,7 +590,7 @@ #define HELP_comm "usage: comm [-123] FILE1 FILE2\n\nRead FILE1 and FILE2, which should be ordered, and produce three text\ncolumns as output: lines only in FILE1; lines only in FILE2; and lines\nin both files. Filename \"-\" is a synonym for stdin.\n\n-1 Suppress the output column of lines unique to FILE1\n-2 Suppress the output column of lines unique to FILE2\n-3 Suppress the output column of lines duplicated in FILE1 and FILE2" -#define HELP_cmp "usage: cmp [-l] [-s] FILE1 FILE2\n\nCompare the contents of two files.\n\n-l Show all differing bytes\n-s Silent" +#define HELP_cmp "usage: cmp [-l] [-s] FILE1 [FILE2 [SKIP1 [SKIP2]]]\n\nCompare the contents of two files. (Or stdin and file if only one given.)\n\n-l Show all differing bytes\n-s Silent" #define HELP_crc32 "usage: crc32 [file...]\n\nOutput crc32 checksum for each file." diff --git a/android/mac/generated/newtoys.h b/android/mac/generated/newtoys.h index 0f6410a6..68fda2a7 100644 --- a/android/mac/generated/newtoys.h +++ b/android/mac/generated/newtoys.h @@ -7,6 +7,7 @@ USE_TEST(OLDTOY([, test, TOYFLAG_NOFORK|TOYFLAG_NOHELP)) USE_ACPI(NEWTOY(acpi, "abctV", TOYFLAG_USR|TOYFLAG_BIN)) USE_GROUPADD(OLDTOY(addgroup, groupadd, TOYFLAG_NEEDROOT|TOYFLAG_SBIN)) USE_USERADD(OLDTOY(adduser, useradd, TOYFLAG_NEEDROOT|TOYFLAG_UMASK|TOYFLAG_SBIN)) +USE_ARCH(NEWTOY(arch, 0, TOYFLAG_USR|TOYFLAG_BIN)) USE_ARP(NEWTOY(arp, "vi:nDsdap:A:H:[+Ap][!sd]", TOYFLAG_USR|TOYFLAG_BIN)) USE_ARPING(NEWTOY(arping, "<1>1s:I:w#<0c#<0AUDbqf[+AU][+Df]", TOYFLAG_USR|TOYFLAG_SBIN)) USE_ASCII(NEWTOY(ascii, 0, TOYFLAG_USR|TOYFLAG_BIN)) @@ -34,7 +35,7 @@ USE_CHRT(NEWTOY(chrt, "^mp#<0iRbrfo[!ibrfo]", TOYFLAG_USR|TOYFLAG_BIN)) USE_CHVT(NEWTOY(chvt, "<1", TOYFLAG_USR|TOYFLAG_BIN)) USE_CKSUM(NEWTOY(cksum, "HIPLN", TOYFLAG_BIN)) USE_CLEAR(NEWTOY(clear, NULL, TOYFLAG_USR|TOYFLAG_BIN)) -USE_CMP(NEWTOY(cmp, "<2>2ls(silent)(quiet)[!ls]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2))) +USE_CMP(NEWTOY(cmp, "<1>2ls(silent)(quiet)[!ls]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2))) USE_COMM(NEWTOY(comm, "<2>2321", TOYFLAG_USR|TOYFLAG_BIN)) USE_COUNT(NEWTOY(count, NULL, TOYFLAG_USR|TOYFLAG_BIN)) USE_CP(NEWTOY(cp, "<2"USE_CP_PRESERVE("(preserve):;")"D(parents)RHLPprdaslvnF(remove-destination)fi[-HLPd][-ni]", TOYFLAG_BIN)) @@ -60,6 +61,7 @@ USE_DHCPD(NEWTOY(dhcpd, ">1P#<0>65535fi:S46[!46]", TOYFLAG_SBIN|TOYFLAG_ROOTONLY USE_DIFF(NEWTOY(diff, "<2>2(color)(strip-trailing-cr)B(ignore-blank-lines)d(minimal)b(ignore-space-change)ut(expand-tabs)w(ignore-all-space)i(ignore-case)T(initial-tab)s(report-identical-files)q(brief)a(text)L(label)*S(starting-file):N(new-file)r(recursive)U(unified)#<0=3", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2))) USE_DIRNAME(NEWTOY(dirname, "<1", TOYFLAG_USR|TOYFLAG_BIN)) USE_DMESG(NEWTOY(dmesg, "w(follow)CSTtrs#<1n#c[!Ttr][!Cc][!Sw]", TOYFLAG_BIN)) +USE_DNSDOMAINNAME(NEWTOY(dnsdomainname, ">0", TOYFLAG_BIN)) USE_DOS2UNIX(NEWTOY(dos2unix, 0, TOYFLAG_BIN)) USE_DU(NEWTOY(du, "d#<0=-1hmlcaHkKLsx[-HL][-kKmh]", TOYFLAG_USR|TOYFLAG_BIN)) USE_DUMPLEASES(NEWTOY(dumpleases, ">0arf:[!ar]", TOYFLAG_USR|TOYFLAG_BIN)) @@ -292,7 +294,7 @@ USE_WGET(NEWTOY(wget, "(no-check-certificate)O:", TOYFLAG_USR|TOYFLAG_BIN)) USE_WHICH(NEWTOY(which, "<1a", TOYFLAG_USR|TOYFLAG_BIN)) USE_WHO(NEWTOY(who, "a", TOYFLAG_USR|TOYFLAG_BIN)) USE_WHOAMI(OLDTOY(whoami, logname, TOYFLAG_USR|TOYFLAG_BIN)) -USE_XARGS(NEWTOY(xargs, "^E:optrn#<1(max-args)s#0[!0E]", TOYFLAG_USR|TOYFLAG_BIN)) +USE_XARGS(NEWTOY(xargs, "^E:P#optrn#<1(max-args)s#0[!0E]", TOYFLAG_USR|TOYFLAG_BIN)) USE_XXD(NEWTOY(xxd, ">1c#l#o#g#<1=2iprs#[!rs]", TOYFLAG_USR|TOYFLAG_BIN)) USE_XZCAT(NEWTOY(xzcat, NULL, TOYFLAG_USR|TOYFLAG_BIN)) USE_YES(NEWTOY(yes, NULL, TOYFLAG_USR|TOYFLAG_BIN)) |