aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-04-28 20:23:44 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-04-28 20:23:44 +0000
commit76bba3c1a8d2bd33f4ac9f1f5a3f8aebe59ddc92 (patch)
tree95cab695760fe2fc7e7e40cee6bd6d249ac97619
parent6730c35aa3511f62b40481bcfc99e4fbc8699f8c (diff)
parent793a3cae970b45acde49093360d746726f25474e (diff)
downloadtoybox-android10-android13-mainline-tzdata-release.tar.gz
Change-Id: I4fd26bba211b2146523c79ef4ebc9b752ab025e0
-rw-r--r--.config (renamed from .config-device)7
-rw-r--r--.config-linux337
-rw-r--r--.config-mac337
-rw-r--r--Android.bp363
-rw-r--r--Config.in4
-rw-r--r--Makefile24
-rw-r--r--TEST_MAPPING7
-rw-r--r--android/device/generated/globals.h1576
-rw-r--r--android/device/generated/newtoys.h301
-rw-r--r--android/device/generated/tags.h140
-rw-r--r--android/linux/generated/config.h646
-rw-r--r--android/linux/generated/flags.h6200
-rw-r--r--android/linux/generated/globals.h1576
-rw-r--r--android/linux/generated/help.h612
-rw-r--r--android/mac/generated/config.h646
-rw-r--r--android/mac/generated/flags.h6200
-rw-r--r--android/mac/generated/help.h612
-rw-r--r--android/mac/generated/newtoys.h301
-rw-r--r--android/mac/generated/tags.h140
-rwxr-xr-xconfigure4
-rw-r--r--generated/config.h (renamed from android/device/generated/config.h)14
-rw-r--r--generated/flags.h (renamed from android/device/generated/flags.h)422
-rw-r--r--generated/globals.h (renamed from android/mac/generated/globals.h)172
-rw-r--r--generated/help.h (renamed from android/device/generated/help.h)610
-rw-r--r--generated/newtoys.h (renamed from android/linux/generated/newtoys.h)66
-rw-r--r--generated/tags.h (renamed from android/linux/generated/tags.h)80
-rw-r--r--kconfig/Makefile2
-rw-r--r--kconfig/macos_miniconfig4
-rw-r--r--kconfig/symbol.c2
-rw-r--r--lib/args.c10
-rw-r--r--lib/commas.c22
-rw-r--r--lib/deflate.c16
-rw-r--r--lib/dirtree.c34
-rw-r--r--lib/env.c120
-rw-r--r--lib/help.c2
-rw-r--r--lib/lib.c286
-rw-r--r--lib/lib.h55
-rw-r--r--lib/linestack.c2
-rw-r--r--lib/llist.c22
-rw-r--r--lib/lsm.h1
-rw-r--r--lib/net.c16
-rw-r--r--lib/password.c9
-rw-r--r--lib/pending.h3
-rw-r--r--lib/portability.c363
-rw-r--r--lib/portability.h60
-rw-r--r--lib/toyflags.h11
-rw-r--r--lib/tty.c99
-rw-r--r--lib/xwrap.c82
-rw-r--r--main.c15
-rwxr-xr-xregenerate.sh24
-rwxr-xr-xrun-tests-on-android.sh81
-rw-r--r--scripts/config2help.c21
-rwxr-xr-xscripts/cross.sh54
-rwxr-xr-xscripts/genconfig.sh8
-rwxr-xr-xscripts/install.sh4
-rwxr-xr-xscripts/make.sh24
-rwxr-xr-xscripts/mcm-buildall.sh160
-rwxr-xr-xscripts/mkroot.sh511
-rw-r--r--scripts/portability.sh2
-rw-r--r--scripts/runtest.sh38
-rwxr-xr-xscripts/test.sh4
-rwxr-xr-xtests/blkid.test65
-rwxr-xr-xtests/chgrp.test3
-rwxr-xr-xtests/chown.test6
-rwxr-xr-xtests/cmp.test12
-rwxr-xr-xtests/cp.test28
-rwxr-xr-xtests/cut.test4
-rw-r--r--tests/date.test18
-rw-r--r--tests/dd.test17
-rwxr-xr-xtests/demo_number.test2
-rw-r--r--tests/diff.test5
-rwxr-xr-xtests/du.test9
-rwxr-xr-xtests/echo.test11
-rwxr-xr-xtests/env.test10
-rwxr-xr-xtests/file.test47
-rw-r--r--tests/files/bc/power.txt1
-rw-r--r--tests/files/bc/power_results.txt1
-rwxr-xr-xtests/files/elf/ndk-elf-note-fullbin9824 -> 0 bytes
-rwxr-xr-xtests/files/elf/ndk-elf-note-shortbin10976 -> 0 bytes
-rw-r--r--tests/files/java.classbin182 -> 0 bytes
-rw-r--r--tests/files/tar/tar.tarbin10240 -> 0 bytes
-rwxr-xr-xtests/find.test60
-rwxr-xr-xtests/grep.test34
-rwxr-xr-xtests/hostname.test11
-rwxr-xr-xtests/ifconfig.test16
-rw-r--r--tests/kill.test8
-rw-r--r--tests/killall.test19
-rwxr-xr-xtests/link.test2
-rwxr-xr-xtests/ln.test14
-rwxr-xr-xtests/losetup.test35
-rwxr-xr-xtests/ls.test5
-rwxr-xr-x[-rw-r--r--]tests/lsattr.test0
-rw-r--r--tests/man.test222
-rwxr-xr-xtests/mktemp.test65
-rw-r--r--tests/modinfo.test44
-rw-r--r--tests/more.test5
-rwxr-xr-xtests/mv.test20
-rwxr-xr-xtests/nl.test7
-rw-r--r--tests/pidof.test29
-rwxr-xr-xtests/printf.test16
-rwxr-xr-xtests/ps.test11
-rwxr-xr-xtests/readlink.test1
-rwxr-xr-xtests/rm.test2
-rwxr-xr-xtests/sed.test12
-rwxr-xr-xtests/split.test4
-rwxr-xr-xtests/tail.test1
-rw-r--r--tests/tar.test254
-rw-r--r--tests/timeout.test15
-rw-r--r--tests/touch.test8
-rwxr-xr-xtests/truncate.test7
-rw-r--r--tests/xargs.test29
-rw-r--r--toybox-tests.xml28
-rw-r--r--toys.h1
-rw-r--r--toys/android/getprop.c119
-rw-r--r--toys/android/setprop.c44
-rw-r--r--toys/android/start.c59
-rw-r--r--toys/example/demo_number.c9
-rw-r--r--toys/lsb/hostname.c35
-rw-r--r--toys/lsb/killall.c41
-rw-r--r--toys/lsb/md5sum.c56
-rw-r--r--toys/lsb/mktemp.c22
-rw-r--r--toys/lsb/pidof.c5
-rw-r--r--toys/net/ftpget.c6
-rw-r--r--toys/net/ifconfig.c5
-rw-r--r--toys/net/netcat.c85
-rw-r--r--toys/net/ping.c2
-rw-r--r--toys/net/sntp.c48
-rw-r--r--toys/other/blkid.c76
-rw-r--r--toys/other/help.c4
-rw-r--r--toys/other/hexedit.c7
-rw-r--r--toys/other/losetup.c63
-rw-r--r--toys/other/lsattr.c10
-rw-r--r--toys/other/makedevs.c10
-rw-r--r--toys/other/modinfo.c43
-rw-r--r--toys/other/nbd_client.c2
-rw-r--r--toys/other/printenv.c2
-rw-r--r--toys/other/readlink.c31
-rw-r--r--toys/other/rev.c26
-rw-r--r--toys/other/stat.c73
-rw-r--r--toys/other/tac.c41
-rw-r--r--toys/other/timeout.c12
-rw-r--r--toys/pending/arping.c10
-rw-r--r--toys/pending/bc.c32
-rw-r--r--toys/pending/bootchartd.c38
-rw-r--r--toys/pending/crontab.c17
-rw-r--r--toys/pending/dd.c152
-rw-r--r--toys/pending/dhcp6.c10
-rw-r--r--toys/pending/diff.c119
-rw-r--r--toys/pending/gzip.c (renamed from toys/lsb/gzip.c)65
-rw-r--r--toys/pending/host.c44
-rw-r--r--toys/pending/ip.c120
-rw-r--r--toys/pending/lsof.c2
-rw-r--r--toys/pending/man.c213
-rw-r--r--toys/pending/more.c41
-rw-r--r--toys/pending/sh.c1238
-rw-r--r--toys/pending/tar.c815
-rw-r--r--toys/pending/tcpsvd.c5
-rw-r--r--toys/pending/telnet.c2
-rw-r--r--toys/pending/telnetd.c7
-rw-r--r--toys/pending/tftpd.c5
-rw-r--r--toys/pending/traceroute.c16
-rw-r--r--toys/pending/vi.c1478
-rw-r--r--toys/pending/wget.c94
-rw-r--r--toys/posix/basename.c2
-rw-r--r--toys/posix/cmp.c7
-rw-r--r--toys/posix/cp.c65
-rw-r--r--toys/posix/echo.c21
-rw-r--r--toys/posix/env.c28
-rw-r--r--toys/posix/file.c81
-rw-r--r--toys/posix/find.c191
-rw-r--r--toys/posix/getconf.c11
-rw-r--r--toys/posix/grep.c51
-rw-r--r--toys/posix/head.c7
-rw-r--r--toys/posix/kill.c10
-rw-r--r--toys/posix/ln.c43
-rw-r--r--toys/posix/ls.c102
-rw-r--r--toys/posix/nl.c53
-rw-r--r--toys/posix/patch.c39
-rw-r--r--toys/posix/printf.c11
-rw-r--r--toys/posix/ps.c55
-rw-r--r--toys/posix/rm.c20
-rw-r--r--toys/posix/rmdir.c7
-rw-r--r--toys/posix/sed.c122
-rw-r--r--toys/posix/sort.c47
-rw-r--r--toys/posix/tail.c41
-rw-r--r--toys/posix/tar.c949
-rw-r--r--toys/posix/test.c3
-rw-r--r--toys/posix/time.c2
-rw-r--r--toys/posix/uname.c16
-rw-r--r--toys/posix/uudecode.c21
-rw-r--r--toys/posix/xargs.c136
-rw-r--r--www/0bsd-mckusick.txt180
-rw-r--r--www/design.html59
-rwxr-xr-xwww/faq.html50
-rw-r--r--www/header.html3
-rwxr-xr-xwww/license.html15
-rwxr-xr-xwww/news.html426
-rwxr-xr-xwww/roadmap.html225
198 files changed, 4280 insertions, 29066 deletions
diff --git a/.config-device b/.config
index 395cf6a5..eb82ddec 100644
--- a/.config-device
+++ b/.config
@@ -40,7 +40,6 @@ CONFIG_TOYBOX_UID_USR=500
#
CONFIG_ACPI=y
-# CONFIG_ARCH is not set
# CONFIG_ARPING is not set
# CONFIG_ARP is not set
# CONFIG_ASCII is not set
@@ -97,7 +96,6 @@ CONFIG_DF=y
CONFIG_DIFF=y
CONFIG_DIRNAME=y
CONFIG_DMESG=y
-# CONFIG_DNSDOMAINNAME is not set
CONFIG_DOS2UNIX=y
# CONFIG_DUMPLEASES is not set
CONFIG_DU=y
@@ -129,6 +127,7 @@ CONFIG_FSYNC=y
CONFIG_GETCONF=y
CONFIG_GETENFORCE=y
CONFIG_GETFATTR=y
+# CONFIG_GETPROP is not set
# CONFIG_GETTY is not set
CONFIG_GREP=y
# CONFIG_GROUPADD is not set
@@ -188,7 +187,6 @@ CONFIG_LSUSB=y
CONFIG_LS=y
CONFIG_LS_Z=y
CONFIG_MAKEDEVS=y
-# CONFIG_MAN is not set
# CONFIG_MCOOKIE is not set
CONFIG_MD5SUM=y
# CONFIG_MDEV_CONF is not set
@@ -264,6 +262,7 @@ CONFIG_SENDEVENT=y
CONFIG_SEQ=y
CONFIG_SETENFORCE=y
CONFIG_SETFATTR=y
+CONFIG_SETPROP=y
CONFIG_SETSID=y
CONFIG_SHA1SUM=y
CONFIG_SHA224SUM=y
@@ -281,7 +280,9 @@ CONFIG_SORT_BIG=y
CONFIG_SORT_FLOAT=y
CONFIG_SORT=y
CONFIG_SPLIT=y
+CONFIG_START=y
CONFIG_STAT=y
+CONFIG_STOP=y
CONFIG_STRINGS=y
CONFIG_STTY=y
# CONFIG_SU is not set
diff --git a/.config-linux b/.config-linux
deleted file mode 100644
index e84c7fee..00000000
--- a/.config-linux
+++ /dev/null
@@ -1,337 +0,0 @@
-#
-# Hand-maintained .config file.
-#
-
-#
-# General settings.
-#
-
-# CONFIG_TOYBOX_ANDROID_SCHEDPOLICY is not set
-# CONFIG_TOYBOX_CONTAINER is not set
-# CONFIG_TOYBOX_DEBUG is not set
-# CONFIG_TOYBOX_FALLOCATE is not set
-# CONFIG_TOYBOX_FIFREEZE is not set
-CONFIG_TOYBOX_FLOAT=y
-CONFIG_TOYBOX_FORK=y
-# CONFIG_TOYBOX_FREE is not set
-# CONFIG_TOYBOX_GETRANDOM is not set
-CONFIG_TOYBOX_HELP_DASHDASH=y
-CONFIG_TOYBOX_HELP=y
-CONFIG_TOYBOX_I18N=y
-CONFIG_TOYBOX_ICONV=y
-CONFIG_TOYBOX_LIBCRYPTO=y
-CONFIG_TOYBOX_LIBZ=y
-CONFIG_TOYBOX_LSM_NONE=y
-# CONFIG_TOYBOX_MUSL_NOMMU_IS_BROKEN is not set
-# CONFIG_TOYBOX_NORECURSE is not set
-# CONFIG_TOYBOX_ON_ANDROID is not set
-# CONFIG_TOYBOX_PEDANTIC_ARGS is not set
-# CONFIG_TOYBOX_PRLIMIT is not set
-# CONFIG_TOYBOX_SELINUX is not set
-# CONFIG_TOYBOX_SHADOW is not set
-# CONFIG_TOYBOX_SMACK is not set
-CONFIG_TOYBOX_SUID=y
-CONFIG_TOYBOX_UID_SYS=100
-CONFIG_TOYBOX_UID_USR=500
-# CONFIG_TOYBOX_UTMPX is not set
-CONFIG_TOYBOX=y
-
-#
-# Selected toys.
-#
-
-# CONFIG_ACPI is not set
-# CONFIG_ARCH is not set
-# CONFIG_ARPING is not set
-# CONFIG_ARP is not set
-# CONFIG_ASCII is not set
-# CONFIG_BASE64 is not set
-CONFIG_BASENAME=y
-CONFIG_BC=y
-# CONFIG_BLKID is not set
-# CONFIG_BLOCKDEV is not set
-# CONFIG_BOOTCHARTD is not set
-# CONFIG_BRCTL is not set
-# CONFIG_BUNZIP2 is not set
-# CONFIG_BZCAT is not set
-# CONFIG_CAL is not set
-# CONFIG_CATV is not set
-CONFIG_CAT_V=y
-CONFIG_CAT=y
-# CONFIG_CD is not set
-# CONFIG_CHATTR is not set
-# CONFIG_CHCON is not set
-# CONFIG_CHGRP is not set
-CONFIG_CHMOD=y
-# CONFIG_CHOWN is not set
-# CONFIG_CHROOT is not set
-# CONFIG_CHRT is not set
-# CONFIG_CHVT is not set
-# CONFIG_CKSUM is not set
-# CONFIG_CLEAR is not set
-CONFIG_CMP=y
-CONFIG_COMM=y
-# CONFIG_COUNT is not set
-# CONFIG_CPIO is not set
-CONFIG_CP_PRESERVE=y
-CONFIG_CP=y
-# CONFIG_CRC32 is not set
-# CONFIG_CROND is not set
-# CONFIG_CRONTAB is not set
-CONFIG_CUT=y
-CONFIG_DATE=y
-CONFIG_DD=y
-# CONFIG_DEALLOCVT is not set
-# CONFIG_DEBUG_DHCP is not set
-# CONFIG_DEMO_MANY_OPTIONS is not set
-# CONFIG_DEMO_NUMBER is not set
-# CONFIG_DEMO_SCANKEY is not set
-# CONFIG_DEMO_UTF8TOWC is not set
-# CONFIG_DEVMEM is not set
-# CONFIG_DF is not set
-# CONFIG_DHCP6 is not set
-# CONFIG_DHCPD is not set
-# CONFIG_DHCP is not set
-CONFIG_DIFF=y
-CONFIG_DIRNAME=y
-# CONFIG_DMESG is not set
-# CONFIG_DNSDOMAINNAME is not set
-CONFIG_DOS2UNIX=y
-# CONFIG_DUMPLEASES is not set
-CONFIG_DU=y
-CONFIG_ECHO=y
-CONFIG_EGREP=y
-# CONFIG_EJECT is not set
-CONFIG_ENV=y
-# CONFIG_EXIT is not set
-# CONFIG_EXPAND is not set
-CONFIG_EXPR=y
-# CONFIG_FACTOR is not set
-# CONFIG_FALLOCATE is not set
-# CONFIG_FALSE is not set
-# CONFIG_FDISK is not set
-# CONFIG_FGREP is not set
-# CONFIG_FILE is not set
-CONFIG_FIND=y
-# CONFIG_FLOCK is not set
-# CONFIG_FMT is not set
-# CONFIG_FOLD is not set
-# CONFIG_FREE is not set
-# CONFIG_FREERAMDISK is not set
-# CONFIG_FSCK is not set
-# CONFIG_FSFREEZE is not set
-# CONFIG_FSTYPE is not set
-# CONFIG_FSYNC is not set
-# CONFIG_FTPGET is not set
-# CONFIG_FTPPUT is not set
-CONFIG_GETCONF=y
-# CONFIG_GETENFORCE is not set
-# CONFIG_GETFATTR is not set
-# CONFIG_GETTY is not set
-CONFIG_GREP=y
-# CONFIG_GROUPADD is not set
-# CONFIG_GROUPDEL is not set
-# CONFIG_GROUPS is not set
-# CONFIG_GUNZIP is not set
-# CONFIG_GZIP is not set
-CONFIG_HEAD=y
-# CONFIG_HELLO is not set
-# CONFIG_HELP_EXTRAS is not set
-# CONFIG_HELP is not set
-# CONFIG_HEXEDIT is not set
-# CONFIG_HOSTID is not set
-# CONFIG_HOST is not set
-CONFIG_HOSTNAME=y
-# CONFIG_HWCLOCK is not set
-# CONFIG_I2CDETECT is not set
-# CONFIG_I2CDUMP is not set
-# CONFIG_I2CGET is not set
-# CONFIG_I2CSET is not set
-# CONFIG_ICONV is not set
-CONFIG_ID=y
-# CONFIG_ID_Z is not set
-# CONFIG_IFCONFIG is not set
-# CONFIG_INIT is not set
-# CONFIG_INOTIFYD is not set
-# CONFIG_INSMOD is not set
-# CONFIG_INSTALL is not set
-# CONFIG_IONICE is not set
-# CONFIG_IORENICE is not set
-# CONFIG_IOTOP is not set
-# CONFIG_IPCRM is not set
-# CONFIG_IPCS is not set
-# CONFIG_IP is not set
-# CONFIG_KILLALL5 is not set
-# CONFIG_KILLALL is not set
-# CONFIG_KILL is not set
-# CONFIG_KLOGD is not set
-# CONFIG_KLOGD_SOURCE_RING_BUFFER is not set
-# CONFIG_LAST is not set
-# CONFIG_LINK is not set
-CONFIG_LN=y
-# CONFIG_LOAD_POLICY is not set
-# CONFIG_LOGGER is not set
-# CONFIG_LOGIN is not set
-# CONFIG_LOG is not set
-# CONFIG_LOGNAME is not set
-# CONFIG_LOGWRAPPER is not set
-# CONFIG_LOSETUP is not set
-# CONFIG_LSATTR is not set
-# CONFIG_LSMOD is not set
-# CONFIG_LSOF is not set
-# CONFIG_LSPCI is not set
-# CONFIG_LSPCI_TEXT is not set
-# CONFIG_LSUSB is not set
-CONFIG_LS=y
-# CONFIG_MAKEDEVS is not set
-# CONFIG_MAN is not set
-# CONFIG_MCOOKIE is not set
-CONFIG_MD5SUM=y
-# CONFIG_MDEV_CONF is not set
-# CONFIG_MDEV is not set
-CONFIG_MICROCOM=y
-# CONFIG_MIX is not set
-CONFIG_MKDIR=y
-# CONFIG_MKDIR_Z is not set
-# CONFIG_MKE2FS_EXTENDED is not set
-# CONFIG_MKE2FS_GEN is not set
-# CONFIG_MKE2FS is not set
-# CONFIG_MKE2FS_JOURNAL is not set
-# CONFIG_MKE2FS_LABEL is not set
-# CONFIG_MKFIFO is not set
-# CONFIG_MKFIFO_Z is not set
-# CONFIG_MKNOD is not set
-# CONFIG_MKNOD_Z is not set
-# CONFIG_MKPASSWD is not set
-# CONFIG_MKSWAP is not set
-CONFIG_MKTEMP=y
-# CONFIG_MODINFO is not set
-# CONFIG_MODPROBE is not set
-# CONFIG_MORE is not set
-# CONFIG_MOUNT is not set
-# CONFIG_MOUNTPOINT is not set
-CONFIG_MV=y
-# CONFIG_NBD_CLIENT is not set
-# CONFIG_NETCAT is not set
-# CONFIG_NETCAT_LISTEN is not set
-# CONFIG_NETSTAT is not set
-# CONFIG_NICE is not set
-# CONFIG_NL is not set
-# CONFIG_NOHUP is not set
-CONFIG_NPROC=y
-# CONFIG_NSENTER is not set
-CONFIG_OD=y
-# CONFIG_ONEIT is not set
-# CONFIG_OPENVT is not set
-# CONFIG_PARTPROBE is not set
-# CONFIG_PASSWD is not set
-# CONFIG_PASSWD_SAD is not set
-CONFIG_PASTE=y
-CONFIG_PATCH=y
-CONFIG_PGREP=y
-# CONFIG_PIDOF is not set
-# CONFIG_PING is not set
-# CONFIG_PIVOT_ROOT is not set
-CONFIG_PKILL=y
-# CONFIG_PMAP is not set
-# CONFIG_PRINTENV is not set
-# CONFIG_PRINTF is not set
-CONFIG_PS=y
-# CONFIG_PWDX is not set
-CONFIG_PWD=y
-# CONFIG_READAHEAD is not set
-CONFIG_READLINK=y
-CONFIG_REALPATH=y
-# CONFIG_REBOOT is not set
-# CONFIG_RENICE is not set
-# CONFIG_RESET is not set
-# CONFIG_RESTORECON is not set
-# CONFIG_REV is not set
-# CONFIG_RFKILL is not set
-CONFIG_RMDIR=y
-# CONFIG_RMMOD is not set
-CONFIG_RM=y
-# CONFIG_ROUTE is not set
-# CONFIG_RUNCON is not set
-CONFIG_SED=y
-# CONFIG_SENDEVENT is not set
-CONFIG_SEQ=y
-# CONFIG_SETENFORCE is not set
-# CONFIG_SETFATTR is not set
-CONFIG_SETSID=y
-CONFIG_SHA1SUM=y
-# CONFIG_SHA224SUM is not set
-CONFIG_SHA256SUM=y
-# CONFIG_SHA384SUM is not set
-CONFIG_SHA512SUM=y
-# CONFIG_SH is not set
-# CONFIG_SHRED is not set
-# CONFIG_SKELETON_ALIAS is not set
-# CONFIG_SKELETON is not set
-CONFIG_SLEEP=y
-# CONFIG_SNTP is not set
-CONFIG_SORT_FLOAT=y
-CONFIG_SORT=y
-# CONFIG_SPLIT is not set
-CONFIG_STAT=y
-# CONFIG_STRINGS is not set
-# CONFIG_STTY is not set
-# CONFIG_SU is not set
-# CONFIG_SULOGIN is not set
-# CONFIG_SWAPOFF is not set
-# CONFIG_SWAPON is not set
-# CONFIG_SWITCH_ROOT is not set
-# CONFIG_SYNC is not set
-# CONFIG_SYSCTL is not set
-# CONFIG_SYSLOGD is not set
-# CONFIG_TAC is not set
-CONFIG_TAIL=y
-CONFIG_TAR=y
-# CONFIG_TASKSET is not set
-# CONFIG_TCPSVD is not set
-CONFIG_TEE=y
-# CONFIG_TELNETD is not set
-# CONFIG_TELNET is not set
-# CONFIG_TEST is not set
-# CONFIG_TFTPD is not set
-# CONFIG_TFTP is not set
-# CONFIG_TIME is not set
-CONFIG_TIMEOUT=y
-# CONFIG_TOP is not set
-CONFIG_TOUCH=y
-# CONFIG_TRACEROUTE is not set
-CONFIG_TRUE=y
-CONFIG_TRUNCATE=y
-CONFIG_TR=y
-# CONFIG_TTY is not set
-# CONFIG_TUNCTL is not set
-# CONFIG_ULIMIT is not set
-# CONFIG_UMOUNT is not set
-CONFIG_UNAME=y
-CONFIG_UNIQ=y
-CONFIG_UNIX2DOS=y
-# CONFIG_UNLINK is not set
-# CONFIG_UNSHARE is not set
-# CONFIG_UPTIME is not set
-# CONFIG_USERADD is not set
-# CONFIG_USERDEL is not set
-# CONFIG_USLEEP is not set
-# CONFIG_UUDECODE is not set
-# CONFIG_UUENCODE is not set
-# CONFIG_UUIDGEN is not set
-# CONFIG_VCONFIG is not set
-# CONFIG_VI is not set
-# CONFIG_VMSTAT is not set
-# CONFIG_WATCH is not set
-CONFIG_WC=y
-# CONFIG_WGET is not set
-CONFIG_WHICH=y
-CONFIG_WHOAMI=y
-# CONFIG_WHO is not set
-# CONFIG_W is not set
-# CONFIG_XARGS_PEDANTIC is not set
-CONFIG_XARGS=y
-CONFIG_XXD=y
-# CONFIG_XZCAT is not set
-# CONFIG_YES is not set
-# CONFIG_ZCAT is not set
diff --git a/.config-mac b/.config-mac
deleted file mode 100644
index d9265cf6..00000000
--- a/.config-mac
+++ /dev/null
@@ -1,337 +0,0 @@
-#
-# Hand-maintained .config file.
-#
-
-#
-# General settings.
-#
-
-# CONFIG_TOYBOX_ANDROID_SCHEDPOLICY is not set
-# CONFIG_TOYBOX_CONTAINER is not set
-# CONFIG_TOYBOX_DEBUG is not set
-# CONFIG_TOYBOX_FALLOCATE is not set
-# CONFIG_TOYBOX_FIFREEZE is not set
-CONFIG_TOYBOX_FLOAT=y
-CONFIG_TOYBOX_FORK=y
-# CONFIG_TOYBOX_FREE is not set
-# CONFIG_TOYBOX_GETRANDOM is not set
-CONFIG_TOYBOX_HELP_DASHDASH=y
-CONFIG_TOYBOX_HELP=y
-CONFIG_TOYBOX_I18N=y
-CONFIG_TOYBOX_ICONV=y
-CONFIG_TOYBOX_LIBCRYPTO=y
-CONFIG_TOYBOX_LIBZ=y
-CONFIG_TOYBOX_LSM_NONE=y
-# CONFIG_TOYBOX_MUSL_NOMMU_IS_BROKEN is not set
-# CONFIG_TOYBOX_NORECURSE is not set
-# CONFIG_TOYBOX_ON_ANDROID is not set
-# CONFIG_TOYBOX_PEDANTIC_ARGS is not set
-# CONFIG_TOYBOX_PRLIMIT is not set
-# CONFIG_TOYBOX_SELINUX is not set
-# CONFIG_TOYBOX_SHADOW is not set
-# CONFIG_TOYBOX_SMACK is not set
-CONFIG_TOYBOX_SUID=y
-CONFIG_TOYBOX_UID_SYS=100
-CONFIG_TOYBOX_UID_USR=500
-# CONFIG_TOYBOX_UTMPX is not set
-CONFIG_TOYBOX=y
-
-#
-# Selected toys.
-#
-
-# CONFIG_ACPI is not set
-# CONFIG_ARCH is not set
-# CONFIG_ARPING is not set
-# CONFIG_ARP is not set
-# CONFIG_ASCII is not set
-# CONFIG_BASE64 is not set
-CONFIG_BASENAME=y
-CONFIG_BC=y
-# CONFIG_BLKID is not set
-# CONFIG_BLOCKDEV is not set
-# CONFIG_BOOTCHARTD is not set
-# CONFIG_BRCTL is not set
-# CONFIG_BUNZIP2 is not set
-# CONFIG_BZCAT is not set
-# CONFIG_CAL is not set
-# CONFIG_CATV is not set
-CONFIG_CAT_V=y
-CONFIG_CAT=y
-# CONFIG_CD is not set
-# CONFIG_CHATTR is not set
-# CONFIG_CHCON is not set
-# CONFIG_CHGRP is not set
-CONFIG_CHMOD=y
-# CONFIG_CHOWN is not set
-# CONFIG_CHROOT is not set
-# CONFIG_CHRT is not set
-# CONFIG_CHVT is not set
-# CONFIG_CKSUM is not set
-# CONFIG_CLEAR is not set
-CONFIG_CMP=y
-CONFIG_COMM=y
-# CONFIG_COUNT is not set
-# CONFIG_CPIO is not set
-CONFIG_CP_PRESERVE=y
-CONFIG_CP=y
-# CONFIG_CRC32 is not set
-# CONFIG_CROND is not set
-# CONFIG_CRONTAB is not set
-CONFIG_CUT=y
-CONFIG_DATE=y
-CONFIG_DD=y
-# CONFIG_DEALLOCVT is not set
-# CONFIG_DEBUG_DHCP is not set
-# CONFIG_DEMO_MANY_OPTIONS is not set
-# CONFIG_DEMO_NUMBER is not set
-# CONFIG_DEMO_SCANKEY is not set
-# CONFIG_DEMO_UTF8TOWC is not set
-# CONFIG_DEVMEM is not set
-# CONFIG_DF is not set
-# CONFIG_DHCP6 is not set
-# CONFIG_DHCPD is not set
-# CONFIG_DHCP is not set
-CONFIG_DIFF=y
-CONFIG_DIRNAME=y
-# CONFIG_DMESG is not set
-# CONFIG_DNSDOMAINNAME is not set
-CONFIG_DOS2UNIX=y
-# CONFIG_DUMPLEASES is not set
-CONFIG_DU=y
-CONFIG_ECHO=y
-CONFIG_EGREP=y
-# CONFIG_EJECT is not set
-CONFIG_ENV=y
-# CONFIG_EXIT is not set
-# CONFIG_EXPAND is not set
-CONFIG_EXPR=y
-# CONFIG_FACTOR is not set
-# CONFIG_FALLOCATE is not set
-# CONFIG_FALSE is not set
-# CONFIG_FDISK is not set
-# CONFIG_FGREP is not set
-# CONFIG_FILE is not set
-CONFIG_FIND=y
-# CONFIG_FLOCK is not set
-# CONFIG_FMT is not set
-# CONFIG_FOLD is not set
-# CONFIG_FREE is not set
-# CONFIG_FREERAMDISK is not set
-# CONFIG_FSCK is not set
-# CONFIG_FSFREEZE is not set
-# CONFIG_FSTYPE is not set
-# CONFIG_FSYNC is not set
-# CONFIG_FTPGET is not set
-# CONFIG_FTPPUT is not set
-CONFIG_GETCONF=y
-# CONFIG_GETENFORCE is not set
-# CONFIG_GETFATTR is not set
-# CONFIG_GETTY is not set
-CONFIG_GREP=y
-# CONFIG_GROUPADD is not set
-# CONFIG_GROUPDEL is not set
-# CONFIG_GROUPS is not set
-# CONFIG_GUNZIP is not set
-# CONFIG_GZIP is not set
-CONFIG_HEAD=y
-# CONFIG_HELLO is not set
-# CONFIG_HELP_EXTRAS is not set
-# CONFIG_HELP is not set
-# CONFIG_HEXEDIT is not set
-# CONFIG_HOSTID is not set
-# CONFIG_HOST is not set
-CONFIG_HOSTNAME=y
-# CONFIG_HWCLOCK is not set
-# CONFIG_I2CDETECT is not set
-# CONFIG_I2CDUMP is not set
-# CONFIG_I2CGET is not set
-# CONFIG_I2CSET is not set
-# CONFIG_ICONV is not set
-CONFIG_ID=y
-# CONFIG_ID_Z is not set
-# CONFIG_IFCONFIG is not set
-# CONFIG_INIT is not set
-# CONFIG_INOTIFYD is not set
-# CONFIG_INSMOD is not set
-# CONFIG_INSTALL is not set
-# CONFIG_IONICE is not set
-# CONFIG_IORENICE is not set
-# CONFIG_IOTOP is not set
-# CONFIG_IPCRM is not set
-# CONFIG_IPCS is not set
-# CONFIG_IP is not set
-# CONFIG_KILLALL5 is not set
-# CONFIG_KILLALL is not set
-# CONFIG_KILL is not set
-# CONFIG_KLOGD is not set
-# CONFIG_KLOGD_SOURCE_RING_BUFFER is not set
-# CONFIG_LAST is not set
-# CONFIG_LINK is not set
-CONFIG_LN=y
-# CONFIG_LOAD_POLICY is not set
-# CONFIG_LOGGER is not set
-# CONFIG_LOGIN is not set
-# CONFIG_LOG is not set
-# CONFIG_LOGNAME is not set
-# CONFIG_LOGWRAPPER is not set
-# CONFIG_LOSETUP is not set
-# CONFIG_LSATTR is not set
-# CONFIG_LSMOD is not set
-# CONFIG_LSOF is not set
-# CONFIG_LSPCI is not set
-# CONFIG_LSPCI_TEXT is not set
-# CONFIG_LSUSB is not set
-CONFIG_LS=y
-# CONFIG_MAKEDEVS is not set
-# CONFIG_MAN is not set
-# CONFIG_MCOOKIE is not set
-CONFIG_MD5SUM=y
-# CONFIG_MDEV_CONF is not set
-# CONFIG_MDEV is not set
-CONFIG_MICROCOM=y
-# CONFIG_MIX is not set
-CONFIG_MKDIR=y
-# CONFIG_MKDIR_Z is not set
-# CONFIG_MKE2FS_EXTENDED is not set
-# CONFIG_MKE2FS_GEN is not set
-# CONFIG_MKE2FS is not set
-# CONFIG_MKE2FS_JOURNAL is not set
-# CONFIG_MKE2FS_LABEL is not set
-# CONFIG_MKFIFO is not set
-# CONFIG_MKFIFO_Z is not set
-# CONFIG_MKNOD is not set
-# CONFIG_MKNOD_Z is not set
-# CONFIG_MKPASSWD is not set
-# CONFIG_MKSWAP is not set
-CONFIG_MKTEMP=y
-# CONFIG_MODINFO is not set
-# CONFIG_MODPROBE is not set
-# CONFIG_MORE is not set
-# CONFIG_MOUNT is not set
-# CONFIG_MOUNTPOINT is not set
-CONFIG_MV=y
-# CONFIG_NBD_CLIENT is not set
-# CONFIG_NETCAT is not set
-# CONFIG_NETCAT_LISTEN is not set
-# CONFIG_NETSTAT is not set
-# CONFIG_NICE is not set
-# CONFIG_NL is not set
-# CONFIG_NOHUP is not set
-# CONFIG_NPROC is not set
-# CONFIG_NSENTER is not set
-CONFIG_OD=y
-# CONFIG_ONEIT is not set
-# CONFIG_OPENVT is not set
-# CONFIG_PARTPROBE is not set
-# CONFIG_PASSWD is not set
-# CONFIG_PASSWD_SAD is not set
-CONFIG_PASTE=y
-CONFIG_PATCH=y
-# CONFIG_PGREP is not set
-# CONFIG_PIDOF is not set
-# CONFIG_PING is not set
-# CONFIG_PIVOT_ROOT is not set
-# CONFIG_PKILL is not set
-# CONFIG_PMAP is not set
-# CONFIG_PRINTENV is not set
-# CONFIG_PRINTF is not set
-# CONFIG_PS is not set
-# CONFIG_PWDX is not set
-CONFIG_PWD=y
-# CONFIG_READAHEAD is not set
-CONFIG_READLINK=y
-CONFIG_REALPATH=y
-# CONFIG_REBOOT is not set
-# CONFIG_RENICE is not set
-# CONFIG_RESET is not set
-# CONFIG_RESTORECON is not set
-# CONFIG_REV is not set
-# CONFIG_RFKILL is not set
-CONFIG_RMDIR=y
-# CONFIG_RMMOD is not set
-CONFIG_RM=y
-# CONFIG_ROUTE is not set
-# CONFIG_RUNCON is not set
-CONFIG_SED=y
-# CONFIG_SENDEVENT is not set
-CONFIG_SEQ=y
-# CONFIG_SETENFORCE is not set
-# CONFIG_SETFATTR is not set
-CONFIG_SETSID=y
-CONFIG_SHA1SUM=y
-# CONFIG_SHA224SUM is not set
-CONFIG_SHA256SUM=y
-# CONFIG_SHA384SUM is not set
-CONFIG_SHA512SUM=y
-# CONFIG_SH is not set
-# CONFIG_SHRED is not set
-# CONFIG_SKELETON_ALIAS is not set
-# CONFIG_SKELETON is not set
-CONFIG_SLEEP=y
-# CONFIG_SNTP is not set
-CONFIG_SORT_FLOAT=y
-CONFIG_SORT=y
-# CONFIG_SPLIT is not set
-CONFIG_STAT=y
-# CONFIG_STRINGS is not set
-# CONFIG_STTY is not set
-# CONFIG_SU is not set
-# CONFIG_SULOGIN is not set
-# CONFIG_SWAPOFF is not set
-# CONFIG_SWAPON is not set
-# CONFIG_SWITCH_ROOT is not set
-# CONFIG_SYNC is not set
-# CONFIG_SYSCTL is not set
-# CONFIG_SYSLOGD is not set
-# CONFIG_TAC is not set
-CONFIG_TAIL=y
-CONFIG_TAR=y
-# CONFIG_TASKSET is not set
-# CONFIG_TCPSVD is not set
-CONFIG_TEE=y
-# CONFIG_TELNETD is not set
-# CONFIG_TELNET is not set
-# CONFIG_TEST is not set
-# CONFIG_TFTPD is not set
-# CONFIG_TFTP is not set
-# CONFIG_TIME is not set
-CONFIG_TIMEOUT=y
-# CONFIG_TOP is not set
-CONFIG_TOUCH=y
-# CONFIG_TRACEROUTE is not set
-CONFIG_TRUE=y
-CONFIG_TRUNCATE=y
-CONFIG_TR=y
-# CONFIG_TTY is not set
-# CONFIG_TUNCTL is not set
-# CONFIG_ULIMIT is not set
-# CONFIG_UMOUNT is not set
-CONFIG_UNAME=y
-CONFIG_UNIQ=y
-CONFIG_UNIX2DOS=y
-# CONFIG_UNLINK is not set
-# CONFIG_UNSHARE is not set
-# CONFIG_UPTIME is not set
-# CONFIG_USERADD is not set
-# CONFIG_USERDEL is not set
-# CONFIG_USLEEP is not set
-# CONFIG_UUDECODE is not set
-# CONFIG_UUENCODE is not set
-# CONFIG_UUIDGEN is not set
-# CONFIG_VCONFIG is not set
-# CONFIG_VI is not set
-# CONFIG_VMSTAT is not set
-# CONFIG_WATCH is not set
-CONFIG_WC=y
-# CONFIG_WGET is not set
-CONFIG_WHICH=y
-CONFIG_WHOAMI=y
-# CONFIG_WHO is not set
-# CONFIG_W is not set
-# CONFIG_XARGS_PEDANTIC is not set
-CONFIG_XARGS=y
-CONFIG_XXD=y
-# CONFIG_XZCAT is not set
-# CONFIG_YES is not set
-# CONFIG_ZCAT is not set
diff --git a/Android.bp b/Android.bp
index 3fe0f8d0..91da3ad3 100644
--- a/Android.bp
+++ b/Android.bp
@@ -14,42 +14,40 @@
// limitations under the License.
//
-/*
-
- --- To sync with upstream:
-
- # Update source and regenerate generated files.
- git remote add toybox https://github.com/landley/toybox.git
- git fetch toybox && git merge toybox/master && ./regenerate.sh
-
- # Make any necessary Android.bp changes and rebuild.
- mm -j32
-
- # Run all the tests.
- ./run-tests-on-android.sh
- # Run a single test.
- ./run-tests-on-android.sh wc
+//
+// To sync with upstream:
+//
- # Upload changes.
- git commit -a --amend
- git push aosp HEAD:refs/for/master # Push to gerrit for review.
- git push aosp HEAD:master # Push directly, avoiding gerrit.
+// # Update.
+// git remote add toybox https://github.com/landley/toybox.git
+// git fetch toybox
+// git merge toybox/master
+// # Regenerate generated files.
+// NOBUILD=1 scripts/make.sh
- --- To add a toy:
+// # Make any necessary Android.bp changes and rebuild.
+// mm -j32
- # Edit the three .config-* files to enable the toy you want for the targets
- # you want it on, and regenerate the generated files:
- ./regenerate.sh
+// # Run tests.
+// ./run-tests-on-android.sh
+// # Run a single test.
+// ./run-tests-on-android.sh wc
- # Edit the relevant `srcs` below, depending on where the toy should be
- # available.
+// # Upload changes.
+// git commit -a --amend
+// git push aosp HEAD:refs/for/master # Push to gerrit for review.
+// git push aosp HEAD:master # Push directly, avoiding gerrit.
- # If you just want to use the toy via "toybox x" rather than "x", you can
- # stop now. If you want this toy to have a symbolic link in /system/bin,
- # add the toy to symlinks.
+//
+// To add a toy:
+//
-*/
+// Edit .config to enable the toy you want to add.
+// make clean && make # Regenerate the generated files.
+// # Edit `srcs` below to add the toy.
+// # If you just want to use it as "toybox x" rather than "x", you can stop now.
+// # If you want this toy to have a symbolic link in /system/bin, add the toy to symlinks.
cc_defaults {
name: "toybox-defaults",
@@ -57,7 +55,6 @@ cc_defaults {
"lib/args.c",
"lib/commas.c",
"lib/dirtree.c",
- "lib/env.c",
"lib/help.c",
"lib/lib.c",
"lib/linestack.c",
@@ -67,18 +64,92 @@ cc_defaults {
"lib/tty.c",
"lib/xwrap.c",
"main.c",
+ "toys/android/getenforce.c",
+ "toys/android/load_policy.c",
+ "toys/android/log.c",
+ "toys/android/restorecon.c",
+ "toys/android/runcon.c",
+ "toys/android/sendevent.c",
+ "toys/android/setenforce.c",
+ "toys/android/setprop.c",
+ "toys/android/start.c",
+ "toys/lsb/dmesg.c",
"toys/lsb/hostname.c",
+ "toys/lsb/killall.c",
"toys/lsb/md5sum.c",
+ "toys/lsb/mknod.c",
"toys/lsb/mktemp.c",
+ "toys/lsb/mount.c",
+ "toys/lsb/pidof.c",
"toys/lsb/seq.c",
+ "toys/lsb/sync.c",
+ "toys/lsb/umount.c",
+ "toys/net/ifconfig.c",
"toys/net/microcom.c",
+ "toys/net/netcat.c",
+ "toys/net/netstat.c",
+ "toys/net/ping.c",
+ "toys/net/rfkill.c",
+ "toys/net/tunctl.c",
+ "toys/other/acpi.c",
+ "toys/other/base64.c",
+ "toys/other/blkid.c",
+ "toys/other/blockdev.c",
+ "toys/other/chcon.c",
+ "toys/other/chroot.c",
+ "toys/other/chrt.c",
+ "toys/other/clear.c",
+ "toys/other/devmem.c",
"toys/other/dos2unix.c",
+ "toys/other/fallocate.c",
+ "toys/other/flock.c",
+ "toys/other/fmt.c",
+ "toys/other/free.c",
+ "toys/other/freeramdisk.c",
+ "toys/other/fsfreeze.c",
+ "toys/other/fsync.c",
+ "toys/other/help.c",
+ "toys/other/hwclock.c",
+ "toys/other/i2ctools.c",
+ "toys/other/inotifyd.c",
+ "toys/other/insmod.c",
+ "toys/other/ionice.c",
+ "toys/other/losetup.c",
+ "toys/other/lsattr.c",
+ "toys/other/lsmod.c",
+ "toys/other/lspci.c",
+ "toys/other/lsusb.c",
+ "toys/other/makedevs.c",
+ "toys/other/mkswap.c",
+ "toys/other/modinfo.c",
+ "toys/other/mountpoint.c",
+ "toys/other/nbd_client.c",
+ "toys/other/nsenter.c",
+ "toys/other/partprobe.c",
+ "toys/other/pivot_root.c",
+ "toys/other/pmap.c",
+ "toys/other/printenv.c",
+ "toys/other/pwdx.c",
"toys/other/readlink.c",
"toys/other/realpath.c",
+ "toys/other/rev.c",
+ "toys/other/rmmod.c",
+ "toys/other/setfattr.c",
"toys/other/setsid.c",
"toys/other/stat.c",
+ "toys/other/swapoff.c",
+ "toys/other/swapon.c",
+ "toys/other/sysctl.c",
+ "toys/other/tac.c",
+ "toys/other/taskset.c",
"toys/other/timeout.c",
"toys/other/truncate.c",
+ "toys/other/uptime.c",
+ "toys/other/usleep.c",
+ "toys/other/uuidgen.c",
+ "toys/other/vconfig.c",
+ "toys/other/vmstat.c",
+ "toys/other/watch.c",
"toys/other/which.c",
"toys/other/xxd.c",
"toys/other/yes.c",
@@ -86,43 +157,75 @@ cc_defaults {
"toys/pending/dd.c",
"toys/pending/diff.c",
"toys/pending/expr.c",
+ "toys/pending/getfattr.c",
+ "toys/pending/gzip.c",
+ "toys/pending/lsof.c",
+ "toys/pending/modprobe.c",
+ "toys/pending/more.c",
+ "toys/pending/stty.c",
+ "toys/pending/tar.c",
"toys/pending/tr.c",
+ "toys/pending/traceroute.c",
"toys/posix/basename.c",
+ "toys/posix/cal.c",
"toys/posix/cat.c",
+ "toys/posix/chgrp.c",
"toys/posix/chmod.c",
+ "toys/posix/cksum.c",
"toys/posix/cmp.c",
"toys/posix/comm.c",
"toys/posix/cp.c",
+ "toys/posix/cpio.c",
"toys/posix/cut.c",
"toys/posix/date.c",
+ "toys/posix/df.c",
"toys/posix/dirname.c",
"toys/posix/du.c",
"toys/posix/echo.c",
"toys/posix/env.c",
+ "toys/posix/expand.c",
+ "toys/posix/false.c",
+ "toys/posix/file.c",
"toys/posix/find.c",
"toys/posix/getconf.c",
"toys/posix/grep.c",
"toys/posix/head.c",
+ "toys/posix/iconv.c",
"toys/posix/id.c",
+ "toys/posix/kill.c",
"toys/posix/ln.c",
"toys/posix/ls.c",
"toys/posix/mkdir.c",
+ "toys/posix/mkfifo.c",
+ "toys/posix/nice.c",
+ "toys/posix/nl.c",
+ "toys/posix/nohup.c",
"toys/posix/od.c",
"toys/posix/paste.c",
"toys/posix/patch.c",
+ "toys/posix/printf.c",
+ "toys/posix/ps.c",
"toys/posix/pwd.c",
+ "toys/posix/renice.c",
"toys/posix/rm.c",
"toys/posix/rmdir.c",
"toys/posix/sed.c",
"toys/posix/sleep.c",
"toys/posix/sort.c",
+ "toys/posix/split.c",
+ "toys/posix/strings.c",
"toys/posix/tail.c",
- "toys/posix/tar.c",
"toys/posix/tee.c",
+ "toys/posix/time.c",
"toys/posix/touch.c",
"toys/posix/true.c",
+ "toys/posix/tty.c",
+ "toys/posix/ulimit.c",
"toys/posix/uname.c",
"toys/posix/uniq.c",
+ "toys/posix/unlink.c",
+ "toys/posix/uudecode.c",
+ "toys/posix/uuencode.c",
"toys/posix/wc.c",
"toys/posix/xargs.c",
],
@@ -139,7 +242,6 @@ cc_defaults {
"-Wno-sign-compare",
"-Wno-string-plus-int",
"-Wno-unused-parameter",
- "-Wno-unused-variable",
"-funsigned-char",
"-ffunction-sections",
"-fdata-sections",
@@ -151,150 +253,12 @@ cc_defaults {
// because libnetd_client.so is C++.
stl: "none",
- shared_libs: [
- "libcrypto",
- "libz",
- ],
-
+ // not usable on Android?: freeramdisk fsfreeze makedevs nbd-client
+ // partprobe pivot_root pwdx rev rfkill vconfig
+ // currently prefer external/efs2progs: blkid chattr lsattr
+ // currently prefer external/iputils: ping ping6
target: {
- linux_glibc: {
- local_include_dirs: ["android/linux"],
- },
-
- darwin: {
- local_include_dirs: ["android/mac"],
- cflags: [
- // You can't have toybox cp(1) on macOS before 10.13.
- "-mmacosx-version-min=10.13",
- "-UMACOSX_DEPLOYMENT_TARGET",
- "-DMACOSX_DEPLOYMENT_TARGET=10.13",
- // macOS' getgroups(3) signature differs.
- "-Wno-pointer-sign",
- // diff.c defines MIN and MAX which (only on macOS) we're
- // also getting from <sys/param.h>.
- "-Wno-macro-redefined",
- ],
- },
-
- linux: {
- srcs: [
- "toys/posix/ps.c",
- "toys/other/taskset.c",
- ],
- },
-
android: {
- local_include_dirs: ["android/device"],
- srcs: [
- "toys/android/getenforce.c",
- "toys/android/load_policy.c",
- "toys/android/log.c",
- "toys/android/restorecon.c",
- "toys/android/runcon.c",
- "toys/android/sendevent.c",
- "toys/android/setenforce.c",
- "toys/lsb/dmesg.c",
- "toys/lsb/gzip.c",
- "toys/lsb/killall.c",
- "toys/lsb/mknod.c",
- "toys/lsb/mount.c",
- "toys/lsb/pidof.c",
- "toys/lsb/sync.c",
- "toys/lsb/umount.c",
- "toys/net/ifconfig.c",
- "toys/net/netcat.c",
- "toys/net/netstat.c",
- "toys/net/ping.c",
- "toys/net/rfkill.c",
- "toys/net/tunctl.c",
- "toys/other/acpi.c",
- "toys/other/base64.c",
- "toys/other/blkid.c",
- "toys/other/blockdev.c",
- "toys/other/chcon.c",
- "toys/other/chroot.c",
- "toys/other/chrt.c",
- "toys/other/clear.c",
- "toys/other/devmem.c",
- "toys/other/fallocate.c",
- "toys/other/flock.c",
- "toys/other/fmt.c",
- "toys/other/free.c",
- "toys/other/freeramdisk.c",
- "toys/other/fsfreeze.c",
- "toys/other/fsync.c",
- "toys/other/help.c",
- "toys/other/hwclock.c",
- "toys/other/i2ctools.c",
- "toys/other/inotifyd.c",
- "toys/other/insmod.c",
- "toys/other/ionice.c",
- "toys/other/losetup.c",
- "toys/other/lsattr.c",
- "toys/other/lsmod.c",
- "toys/other/lspci.c",
- "toys/other/lsusb.c",
- "toys/other/makedevs.c",
- "toys/other/mkswap.c",
- "toys/other/modinfo.c",
- "toys/other/mountpoint.c",
- "toys/other/nbd_client.c",
- "toys/other/nsenter.c",
- "toys/other/partprobe.c",
- "toys/other/pivot_root.c",
- "toys/other/pmap.c",
- "toys/other/printenv.c",
- "toys/other/pwdx.c",
- "toys/other/rev.c",
- "toys/other/rmmod.c",
- "toys/other/setfattr.c",
- "toys/other/swapoff.c",
- "toys/other/swapon.c",
- "toys/other/sysctl.c",
- "toys/other/tac.c",
- "toys/other/uptime.c",
- "toys/other/usleep.c",
- "toys/other/uuidgen.c",
- "toys/other/vconfig.c",
- "toys/other/vmstat.c",
- "toys/other/watch.c",
- "toys/pending/getfattr.c",
- "toys/pending/lsof.c",
- "toys/pending/modprobe.c",
- "toys/pending/more.c",
- "toys/pending/stty.c",
- "toys/pending/traceroute.c",
- "toys/posix/cal.c",
- "toys/posix/chgrp.c",
- "toys/posix/cksum.c",
- "toys/posix/cpio.c",
- "toys/posix/df.c",
- "toys/posix/expand.c",
- "toys/posix/false.c",
- "toys/posix/file.c",
- "toys/posix/iconv.c",
- "toys/posix/kill.c",
- "toys/posix/mkfifo.c",
- "toys/posix/nice.c",
- "toys/posix/nl.c",
- "toys/posix/nohup.c",
- "toys/posix/printf.c",
- "toys/posix/renice.c",
- "toys/posix/split.c",
- "toys/posix/strings.c",
- "toys/posix/time.c",
- "toys/posix/tty.c",
- "toys/posix/ulimit.c",
- "toys/posix/unlink.c",
- "toys/posix/uudecode.c",
- "toys/posix/uuencode.c",
- ],
-
- // not usable on Android?: freeramdisk fsfreeze makedevs nbd-client
- // partprobe pivot_root pwdx rev rfkill vconfig
- // currently prefer external/efs2progs: blkid chattr lsattr
- // currently prefer external/iputils: ping ping6
-
symlinks: [
"acpi",
"base64",
@@ -326,13 +290,11 @@ cc_defaults {
"dos2unix",
"du",
"echo",
- "egrep",
"env",
"expand",
"expr",
"fallocate",
"false",
- "fgrep",
"file",
"find",
"flock",
@@ -341,7 +303,6 @@ cc_defaults {
"fsync",
"getconf",
"getenforce",
- "grep",
"groups",
"gunzip",
"gzip",
@@ -380,6 +341,7 @@ cc_defaults {
"mktemp",
"microcom",
"modinfo",
+ "modprobe",
"more",
"mount",
"mountpoint",
@@ -415,6 +377,7 @@ cc_defaults {
"sendevent",
"seq",
"setenforce",
+ "setprop",
"setsid",
"sha1sum",
"sha224sum",
@@ -424,7 +387,9 @@ cc_defaults {
"sleep",
"sort",
"split",
+ "start",
"stat",
+ "stop",
"strings",
"stty",
"swapoff",
@@ -466,16 +431,22 @@ cc_defaults {
"yes",
"zcat",
],
-
- shared_libs: [
- "liblog",
- "libprocessgroup",
- "libselinux",
- ],
},
},
}
+toybox_libraries = [
+ "liblog",
+ "libselinux",
+ // libcutils dependency is needed only for <cutils/sched_policy.h>
+ // inclusion from lib/portability.h. When it's changed to include
+ // <processgroup/sched_policy.h> this dependency should be dropped
+ "libcutils",
+ "libprocessgroup",
+ "libcrypto",
+ "libz",
+]
+
//###########################################
// toybox for /system, /vendor, and /recovery
//###########################################
@@ -485,29 +456,17 @@ cc_binary {
defaults: ["toybox-defaults"],
host_supported: true,
recovery_available: true,
+ shared_libs: toybox_libraries,
+ target: {
+ darwin: {
+ enabled: false,
+ },
+ },
}
cc_binary {
name: "toybox_vendor",
defaults: ["toybox-defaults"],
+ shared_libs: toybox_libraries,
vendor: true,
}
-
-//###########################################
-// Running the toybox tests
-//###########################################
-
-sh_test {
- name: "toybox-tests",
- src: "run-tests-on-android.sh",
- filename: "run-tests-on-android.sh",
- test_suites: ["general-tests"],
- host_supported: true,
- device_supported: false,
- test_config: "toybox-tests.xml",
- data: [
- "tests/**/*",
- "scripts/runtest.sh",
- ],
-}
-
diff --git a/Config.in b/Config.in
index 67583372..16a04f90 100644
--- a/Config.in
+++ b/Config.in
@@ -20,10 +20,8 @@ config TOYBOX
--long Show path to each command
- To install command symlinks with paths, try:
+ To install command symlinks, try:
for i in $(/bin/toybox --long); do ln -s /bin/toybox $i; done
- or all in one directory:
- for i in $(./toybox); do ln -s toybox $i; done; PATH=$PWD:$PATH
Most toybox commands also understand the following arguments:
diff --git a/Makefile b/Makefile
index 69d24870..1c1c4a4c 100644
--- a/Makefile
+++ b/Makefile
@@ -20,18 +20,17 @@ toybox generated/unstripped/toybox: toybox_stuff
.PHONY: clean distclean baseline bloatcheck install install_flat \
uinstall uninstall_flat tests help toybox_stuff change \
- list list_working list_pending root run_root
+ list list_working list_pending
include kconfig/Makefile
-include .singlemake
$(KCONFIG_CONFIG): $(KCONFIG_TOP)
- @if [ -e "$(KCONFIG_CONFIG)" ]; then make silentoldconfig; \
+ @if [ -e "$(KCONFG_CONFIG)" ]; then make silentoldconfig; \
else echo "Not configured (run 'make defconfig' or 'make menuconfig')";\
exit 1; fi
$(KCONFIG_TOP): generated/Config.in generated/Config.probed
-generated/Config.probed: generated/Config.in
generated/Config.in: toys/*/*.c scripts/genconfig.sh
scripts/genconfig.sh
@@ -60,28 +59,15 @@ uninstall:
change:
scripts/change.sh
-root_clean:
- @rm -rf root
- @echo root cleaned
-
clean::
- @rm -rf toybox generated change .singleconfig* cross-log-*.*
- @echo cleaned
+ rm -rf toybox generated change .singleconfig*
# If singlemake was in generated/ "make clean; make test_ls" wouldn't work.
-distclean: clean root_clean
- @rm -f toybox* .config* .singlemake
- @echo removed .config
+distclean: clean
+ rm -f toybox_old .config* .singlemake
tests:
scripts/test.sh
-root:
- scripts/mkroot.sh $(MAKEFLAGS)
-
-run_root:
- C=$$(basename "$$CROSS_COMPILE" | sed 's/-.*//'); \
- cd root/"$${C:-host}" && ./qemu-*.sh $(MAKEFLAGS) || exit 1
-
help::
@cat scripts/help.txt
diff --git a/TEST_MAPPING b/TEST_MAPPING
deleted file mode 100644
index 73538380..00000000
--- a/TEST_MAPPING
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "presubmit": [
- {
- "name": "toybox-tests"
- }
- ]
-}
diff --git a/android/device/generated/globals.h b/android/device/generated/globals.h
deleted file mode 100644
index 04334b61..00000000
--- a/android/device/generated/globals.h
+++ /dev/null
@@ -1,1576 +0,0 @@
-// toys/android/log.c
-
-struct log_data {
- char *t, *p;
-};
-
-// toys/example/demo_number.c
-
-struct demo_number_data {
- long D;
-};
-
-// toys/example/hello.c
-
-struct hello_data {
- int unused;
-};
-
-// toys/example/skeleton.c
-
-struct skeleton_data {
- union {
- struct {
- char *b;
- long c;
- struct arg_list *d;
- long e;
- char *also, *blubber;
- } s;
- struct {
- long b;
- } a;
- };
-
- int more_globals;
-};
-
-// toys/lsb/dmesg.c
-
-struct dmesg_data {
- long n, s;
-
- int use_color;
- time_t tea;
-};
-
-// toys/lsb/gzip.c
-
-struct gzip_data {
- int level;
-};
-
-// toys/lsb/hostname.c
-
-struct hostname_data {
- char *F;
-};
-
-// toys/lsb/killall.c
-
-struct killall_data {
- char *s;
-
- int signum;
- pid_t cur_pid;
- char **names;
- short *err;
- struct int_list { struct int_list *next; int val; } *pids;
-};
-
-// toys/lsb/md5sum.c
-
-struct md5sum_data {
- int sawline;
-
- // Crypto variables blanked after summing
- unsigned state[5];
- unsigned oldstate[5];
- uint64_t count;
- union {
- char c[64];
- unsigned i[16];
- } buffer;
-};
-
-// toys/lsb/mknod.c
-
-struct mknod_data {
- char *Z, *m;
-};
-
-// toys/lsb/mktemp.c
-
-struct mktemp_data {
- char *p, *tmpdir;
-};
-
-// toys/lsb/mount.c
-
-struct mount_data {
- struct arg_list *optlist;
- char *type;
- char *bigO;
-
- unsigned long flags;
- char *opts;
- int okuser;
-};
-
-// toys/lsb/passwd.c
-
-struct passwd_data {
- char *a;
-};
-
-// toys/lsb/pidof.c
-
-struct pidof_data {
- char *omit;
-};
-
-// toys/lsb/seq.c
-
-struct seq_data {
- char *s, *f;
-
- int precision;
-};
-
-// toys/lsb/su.c
-
-struct su_data {
- char *s;
- char *c;
-};
-
-// toys/lsb/umount.c
-
-struct umount_data {
- struct arg_list *t;
-
- char *types;
-};
-
-// toys/net/ftpget.c
-
-struct ftpget_data {
- char *u, *p, *P;
-
- int fd;
-};
-
-// toys/net/ifconfig.c
-
-struct ifconfig_data {
- int sockfd;
-};
-
-// toys/net/microcom.c
-
-struct microcom_data {
- char *s;
-
- int fd;
- struct termios original_stdin_state, original_fd_state;
-};
-
-// toys/net/netcat.c
-
-struct netcat_data {
- char *f, *s;
- long q, p, W, w;
-};
-
-// toys/net/netstat.c
-
-struct netstat_data {
- struct num_cache *inodes;
- int wpad;
-};;
-
-// toys/net/ping.c
-
-struct ping_data {
- char *I;
- long w, W, i, s, c, t, m;
-
- struct sockaddr *sa;
- int sock;
- unsigned long sent, recv, fugit, min, max;
-};
-
-// toys/net/sntp.c
-
-struct sntp_data {
- long r, t;
- char *p, *m, *M;
-};
-
-// toys/net/tunctl.c
-
-struct tunctl_data {
- char *u;
-};
-
-// toys/other/acpi.c
-
-struct acpi_data {
- int ac, bat, therm, cool;
- char *cpath;
-};
-
-// toys/other/base64.c
-
-struct base64_data {
- long w;
-
- unsigned total;
-};
-
-// toys/other/blkid.c
-
-struct blkid_data {
- struct arg_list *s;
-};
-
-// toys/other/blockdev.c
-
-struct blockdev_data {
- long setbsz, setra;
-};
-
-// toys/other/chrt.c
-
-struct chrt_data {
- long p;
-};
-
-// toys/other/dos2unix.c
-
-struct dos2unix_data {
- char *tempfile;
-};
-
-// toys/other/fallocate.c
-
-struct fallocate_data {
- long offset;
- long size;
-};
-
-// toys/other/fmt.c
-
-struct fmt_data {
- int width;
-
- int level, pos;
-};
-
-// toys/other/free.c
-
-struct free_data {
- unsigned bits;
- unsigned long long units;
- char *buf;
-};
-
-// toys/other/hexedit.c
-
-struct hexedit_data {
- char *data;
- long long len, base;
- int numlen, undo, undolen;
- unsigned height;
-};
-
-// toys/other/hwclock.c
-
-struct hwclock_data {
- char *f;
-
- int utc;
-};
-
-// toys/other/ionice.c
-
-struct ionice_data {
- long pid;
- long level;
- long class;
-};
-
-// toys/other/login.c
-
-struct login_data {
- char *h, *f;
-
- int login_timeout, login_fail_timeout;
-};
-
-// toys/other/losetup.c
-
-struct losetup_data {
- char *j;
- long o, S;
-
- int openflags;
- dev_t jdev;
- ino_t jino;
- char *dir;
-};
-
-// toys/other/lspci.c
-
-struct lspci_data {
- char *i;
- long n;
-
- FILE *db;
-};
-
-// toys/other/makedevs.c
-
-struct makedevs_data {
- char *d;
-};
-
-// toys/other/mix.c
-
-struct mix_data {
- long r, l;
- char *d, *c;
-};
-
-// toys/other/mkpasswd.c
-
-struct mkpasswd_data {
- long P;
- char *m, *S;
-};
-
-// toys/other/mkswap.c
-
-struct mkswap_data {
- char *L;
-};
-
-// toys/other/modinfo.c
-
-struct modinfo_data {
- char *F, *k, *b;
-
- long mod;
- int count;
-};
-
-// toys/other/nsenter.c
-
-struct nsenter_data {
- char *Uupnmi[6];
- long t;
-};
-
-// toys/other/oneit.c
-
-struct oneit_data {
- char *c;
-};
-
-// toys/other/setfattr.c
-
-struct setfattr_data {
- char *x, *v, *n;
-};
-
-// toys/other/shred.c
-
-struct shred_data {
- long o, n, s;
-};
-
-// toys/other/stat.c
-
-struct stat_data {
- char *c;
-
- union {
- struct stat st;
- struct statfs sf;
- } stat;
- char *file, *pattern;
- int patlen;
-};
-
-// toys/other/swapon.c
-
-struct swapon_data {
- long p;
-};
-
-// toys/other/switch_root.c
-
-struct switch_root_data {
- char *c;
-
- dev_t rootdev;
-};
-
-// toys/other/tac.c
-
-struct tac_data {
- struct double_list *dl;
-};
-
-// toys/other/timeout.c
-
-struct timeout_data {
- char *s, *k;
-
- int nextsig;
- pid_t pid;
- struct timeval ktv;
- struct itimerval itv;
-};
-
-// toys/other/truncate.c
-
-struct truncate_data {
- char *s;
-
- long size;
- int type;
-};
-
-// toys/other/watch.c
-
-struct watch_data {
- int n;
-
- pid_t pid, oldpid;
-};
-
-// toys/other/xxd.c
-
-struct xxd_data {
- long s, g, o, l, c;
-};
-
-// toys/pending/arp.c
-
-struct arp_data {
- char *hw_type;
- char *af_type_A;
- char *af_type_p;
- char *interface;
-
- int sockfd;
- char *device;
-};
-
-// toys/pending/arping.c
-
-struct arping_data {
- long count;
- unsigned long time_out;
- char *iface;
- char *src_ip;
-
- int sockfd;
- unsigned long start, end;
- unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
- unicast_flag;
-};
-
-// toys/pending/bc.c
-
-struct bc_data {
- // This actually needs to be a BcVm*, but the toybox build
- // system complains if I make it so. Instead, we'll just cast.
- char *vm;
-
- size_t nchars;
- char *file, sig, max_ibase;
- uint16_t line_len;
-};
-
-// toys/pending/bootchartd.c
-
-struct bootchartd_data {
- char buf[32];
- long smpl_period_usec;
- int proc_accounting;
- int is_login;
-
- pid_t cur_pid;
-};
-
-// toys/pending/brctl.c
-
-struct brctl_data {
- int sockfd;
-};
-
-// toys/pending/crond.c
-
-struct crond_data {
- char *crontabs_dir;
- char *logfile;
- int loglevel_d;
- int loglevel;
-
- time_t crontabs_dir_mtime;
- uint8_t flagd;
-};
-
-// toys/pending/crontab.c
-
-struct crontab_data {
- char *user;
- char *cdir;
-};
-
-// toys/pending/dd.c
-
-struct dd_data {
- int show_xfer, show_records;
- unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
- struct timeval start;
- struct {
- char *name;
- int fd;
- unsigned char *buff, *bp;
- long sz, count;
- unsigned long long offset;
- } in, out;
- unsigned conv, iflag, oflag;
-};;
-
-// toys/pending/dhcp.c
-
-struct dhcp_data {
- char *iface;
- char *pidfile;
- char *script;
- long retries;
- long timeout;
- long tryagain;
- struct arg_list *req_opt;
- char *req_ip;
- struct arg_list *pkt_opt;
- char *fdn_name;
- char *hostname;
- char *vendor_cls;
-};
-
-// toys/pending/dhcp6.c
-
-struct dhcp6_data {
- char *interface_name, *pidfile, *script;
- long retry, timeout, errortimeout;
- char *req_ip;
- int length, state, request_length, sock, sock1, status, retval, retries;
- struct timeval tv;
- uint8_t transction_id[3];
- struct sockaddr_in6 input_socket6;
-};
-
-// toys/pending/dhcpd.c
-
-struct dhcpd_data {
- char *iface;
- long port;
-};;
-
-// toys/pending/diff.c
-
-struct diff_data {
- long ct;
- char *start;
- struct arg_list *L_list;
-
- int dir_num, size, is_binary, status, change, len[2];
- int *offset[2];
- struct stat st[2];
-};
-
-// toys/pending/dumpleases.c
-
-struct dumpleases_data {
- char *file;
-};
-
-// toys/pending/expr.c
-
-struct expr_data {
- char **tok; // current token, not on the stack since recursive calls mutate it
-
- char *refree;
-};
-
-// toys/pending/fdisk.c
-
-struct fdisk_data {
- long sect_sz;
- long sectors;
- long heads;
- long cylinders;
-};
-
-// toys/pending/fold.c
-
-struct fold_data {
- int width;
-};
-
-// toys/pending/fsck.c
-
-struct fsck_data {
- int fd_num;
- char *t_list;
-
- struct double_list *devices;
- char *arr_flag;
- char **arr_type;
- int negate;
- int sum_status;
- int nr_run;
- int sig_num;
- long max_nr_run;
-};
-
-// toys/pending/getfattr.c
-
-struct getfattr_data {
- char *n;
-};
-
-// toys/pending/getty.c
-
-struct getty_data {
- char *issue_str;
- char *login_str;
- char *init_str;
- char *host_str;
- long timeout;
-
- char *tty_name;
- int speeds[20];
- int sc;
- struct termios termios;
- char buff[128];
-};
-
-// toys/pending/groupadd.c
-
-struct groupadd_data {
- long gid;
-};
-
-// toys/pending/host.c
-
-struct host_data {
- char *type_str;
-};
-
-// toys/pending/ip.c
-
-struct ip_data {
- char stats, singleline, flush, *filter_dev, gbuf[8192];
- int sockfd, connected, from_ok, route_cmd;
- int8_t addressfamily, is_addr;
-};
-
-// toys/pending/ipcrm.c
-
-struct ipcrm_data {
- struct arg_list *qkey;
- struct arg_list *qid;
- struct arg_list *skey;
- struct arg_list *sid;
- struct arg_list *mkey;
- struct arg_list *mid;
-};
-
-// toys/pending/ipcs.c
-
-struct ipcs_data {
- int id;
-};
-
-// toys/pending/klogd.c
-
-struct klogd_data {
- long level;
-
- int fd;
-};
-
-// toys/pending/last.c
-
-struct last_data {
- char *file;
-
- struct arg_list *list;
-};
-
-// toys/pending/lsof.c
-
-struct lsof_data {
- struct arg_list *p;
-
- struct stat *sought_files;
- struct double_list *all_sockets, *files;
- int last_shown_pid, shown_header;
-};
-
-// toys/pending/man.c
-
-struct man_data {
- char *M, *k;
-
- char any, cell, ex, *f, k_done, *line, *m, **sct, **scts, **sufs;
- regex_t reg;
-};
-
-// toys/pending/mke2fs.c
-
-struct mke2fs_data {
- // Command line arguments.
- long blocksize;
- long bytes_per_inode;
- long inodes; // Total inodes in filesystem.
- long reserved_percent; // Integer precent of space to reserve for root.
- char *gendir; // Where to read dirtree from.
-
- // Internal data.
- struct dirtree *dt; // Tree of files to copy into the new filesystem.
- unsigned treeblocks; // Blocks used by dt
- unsigned treeinodes; // Inodes used by dt
-
- unsigned blocks; // Total blocks in the filesystem.
- unsigned freeblocks; // Free blocks in the filesystem.
- unsigned inodespg; // Inodes per group
- unsigned groups; // Total number of block groups.
- unsigned blockbits; // Bits per block. (Also blocks per group.)
-
- // For gene2fs
- unsigned nextblock; // Next data block to allocate
- unsigned nextgroup; // Next group we'll be allocating from
- int fsfd; // File descriptor of filesystem (to output to).
-};
-
-// toys/pending/modprobe.c
-
-struct modprobe_data {
- struct arg_list *dirs;
-
- struct arg_list *probes;
- struct arg_list *dbase[256];
- char *cmdopts;
- int nudeps;
- uint8_t symreq;
-};
-
-// toys/pending/more.c
-
-struct more_data {
- struct termios inf;
- int cin_fd;
-};
-
-// toys/pending/openvt.c
-
-struct openvt_data {
- unsigned long vt_num;
-};
-
-// toys/pending/route.c
-
-struct route_data {
- char *family;
-};
-
-// toys/pending/sh.c
-
-struct sh_data {
- char *command;
-
- long lineno;
-
- struct double_list functions;
- unsigned options;
-
- // Running jobs.
- struct sh_job {
- struct sh_job *next, *prev;
- unsigned jobno;
-
- // Every pipeline has at least one set of arguments or it's Not A Thing
- struct sh_arg {
- char **v;
- int c;
- } pipeline;
-
- // null terminated array of running processes in pipeline
- struct sh_process {
- struct string_list *delete; // expanded strings
- int pid, exit; // status? Stopped? Exited?
- struct sh_arg arg;
- } *procs, *proc;
- } *jobs, *job;
- unsigned jobcnt;
-};
-
-// toys/pending/stty.c
-
-struct stty_data {
- char *device;
-
- int fd, col;
- unsigned output_cols;
-};
-
-// toys/pending/sulogin.c
-
-struct sulogin_data {
- long timeout;
- struct termios crntio;
-};
-
-// toys/pending/syslogd.c
-
-struct syslogd_data {
- char *socket;
- char *config_file;
- char *unix_socket;
- char *logfile;
- long interval;
- long rot_size;
- long rot_count;
- char *remote_log;
- long log_prio;
-
- struct unsocks *lsocks; // list of listen sockets
- struct logfile *lfiles; // list of write logfiles
- int sigfd[2];
-};
-
-// toys/pending/tcpsvd.c
-
-struct tcpsvd_data {
- char *name;
- char *user;
- long bn;
- char *nmsg;
- long cn;
-
- int maxc;
- int count_all;
- int udp;
-};
-
-// toys/pending/telnet.c
-
-struct telnet_data {
- int port;
- int sfd;
- char buff[128];
- int pbuff;
- char iac[256];
- int piac;
- char *ttype;
- struct termios def_term;
- struct termios raw_term;
- uint8_t term_ok;
- uint8_t term_mode;
- uint8_t flags;
- unsigned win_width;
- unsigned win_height;
-};
-
-// toys/pending/telnetd.c
-
-struct telnetd_data {
- char *login_path;
- char *issue_path;
- int port;
- char *host_addr;
- long w_sec;
-
- int gmax_fd;
- pid_t fork_pid;
-};
-
-// toys/pending/tftp.c
-
-struct tftp_data {
- char *local_file;
- char *remote_file;
- long block_size;
-
- struct sockaddr_storage inaddr;
- int af;
-};
-
-// toys/pending/tftpd.c
-
-struct tftpd_data {
- char *user;
-
- long sfd;
- struct passwd *pw;
-};
-
-// toys/pending/tr.c
-
-struct tr_data {
- short map[256]; //map of chars
- int len1, len2;
-};
-
-// toys/pending/traceroute.c
-
-struct traceroute_data {
- long max_ttl;
- long port;
- long ttl_probes;
- char *src_ip;
- long tos;
- long wait_time;
- struct arg_list *loose_source;
- long pause_time;
- long first_ttl;
- char *iface;
-
- uint32_t gw_list[9];
- int recv_sock;
- int snd_sock;
- unsigned msg_len;
- char *packet;
- uint32_t ident;
- int istraceroute6;
-};
-
-// toys/pending/useradd.c
-
-struct useradd_data {
- char *dir;
- char *gecos;
- char *shell;
- char *u_grp;
- long uid;
-
- long gid;
-};
-
-// toys/pending/vi.c
-
-struct vi_data {
- int cur_col;
- int cur_row;
- int scr_row;
- int drawn_row;
- int drawn_col;
- unsigned screen_height;
- unsigned screen_width;
- int vi_mode;
- int count0;
- int count1;
- int vi_mov_flag;
- int modified;
- char vi_reg;
- char *last_search;
- int tabstop;
- int list;
-};
-
-// toys/pending/wget.c
-
-struct wget_data {
- char *filename;
-};
-
-// toys/posix/basename.c
-
-struct basename_data {
- char *s;
-};
-
-// toys/posix/chgrp.c
-
-struct chgrp_data {
- uid_t owner;
- gid_t group;
- char *owner_name, *group_name;
- int symfollow;
-};
-
-// toys/posix/chmod.c
-
-struct chmod_data {
- char *mode;
-};
-
-// toys/posix/cksum.c
-
-struct cksum_data {
- unsigned crc_table[256];
-};
-
-// toys/posix/cmp.c
-
-struct cmp_data {
- int fd;
- char *name;
-};
-
-// toys/posix/cp.c
-
-struct cp_data {
- union {
- // install's options
- struct {
- char *g, *o, *m;
- } i;
- // cp's options
- struct {
- char *preserve;
- } c;
- };
-
- char *destname;
- struct stat top;
- int (*callback)(struct dirtree *try);
- uid_t uid;
- gid_t gid;
- int pflags;
-};
-
-// toys/posix/cpio.c
-
-struct cpio_data {
- char *F, *p, *H;
-};
-
-// toys/posix/cut.c
-
-struct cut_data {
- char *d, *O;
- struct arg_list *select[5]; // we treat them the same, so loop through
-
- int pairs;
- regex_t reg;
-};
-
-// toys/posix/date.c
-
-struct date_data {
- char *r, *D, *d;
-
- unsigned nano;
-};
-
-// toys/posix/df.c
-
-struct df_data {
- struct arg_list *t;
-
- long units;
- int column_widths[5];
- int header_shown;
-};
-
-// toys/posix/du.c
-
-struct du_data {
- long d;
-
- unsigned long depth, total;
- dev_t st_dev;
- void *inodes;
-};
-
-// toys/posix/env.c
-
-struct env_data {
- struct arg_list *u;
-};;
-
-// toys/posix/expand.c
-
-struct expand_data {
- struct arg_list *t;
-
- unsigned tabcount, *tab;
-};
-
-// toys/posix/file.c
-
-struct file_data {
- int max_name_len;
-
- off_t len;
-};
-
-// toys/posix/find.c
-
-struct find_data {
- char **filter;
- struct double_list *argdata;
- int topdir, xdev, depth;
- time_t now;
- long max_bytes;
- char *start;
-};
-
-// toys/posix/grep.c
-
-struct grep_data {
- long m, A, B, C;
- struct arg_list *f, *e, *M, *S, *exclude_dir;
- char *color;
-
- char *purple, *cyan, *red, *green, *grey;
- struct double_list *reg;
- char indelim, outdelim;
- int found, tried;
-};
-
-// toys/posix/head.c
-
-struct head_data {
- long c, n;
-
- int file_no;
-};
-
-// toys/posix/iconv.c
-
-struct iconv_data {
- char *f, *t;
-
- void *ic;
-};
-
-// toys/posix/id.c
-
-struct id_data {
- int is_groups;
-};
-
-// toys/posix/kill.c
-
-struct kill_data {
- char *s;
- struct arg_list *o;
-};
-
-// toys/posix/ln.c
-
-struct ln_data {
- char *t;
-};
-
-// toys/posix/logger.c
-
-struct logger_data {
- char *p, *t;
-};
-
-// toys/posix/ls.c
-
-struct ls_data {
- long l;
- char *color;
-
- struct dirtree *files, *singledir;
- unsigned screen_width;
- int nl_title;
- char *escmore;
-};
-
-// toys/posix/mkdir.c
-
-struct mkdir_data {
- char *m, *Z;
-};
-
-// toys/posix/mkfifo.c
-
-struct mkfifo_data {
- char *m;
- char *Z;
-
- mode_t mode;
-};
-
-// toys/posix/nice.c
-
-struct nice_data {
- long n;
-};
-
-// toys/posix/nl.c
-
-struct nl_data {
- char *s, *n, *b;
- long w, l, v;
-
- // Count of consecutive blank lines for -l has to persist between files
- long lcount;
- long slen;
-};
-
-// toys/posix/od.c
-
-struct od_data {
- struct arg_list *t;
- char *A;
- long N, w, j;
-
- int address_idx;
- unsigned types, leftover, star;
- char *buf; // Points to buffers[0] or buffers[1].
- char *bufs[2]; // Used to detect duplicate lines.
- off_t pos;
-};
-
-// toys/posix/paste.c
-
-struct paste_data {
- char *d;
-
- int files;
-};
-
-// toys/posix/patch.c
-
-struct patch_data {
- char *i, *d;
- long p, g;
-
- struct double_list *current_hunk;
- long oldline, oldlen, newline, newlen;
- long linenum;
- int context, state, filein, fileout, filepatch, hunknum;
- char *tempname;
-};
-
-// toys/posix/ps.c
-
-struct ps_data {
- union {
- struct {
- struct arg_list *G, *g, *U, *u, *t, *s, *p, *O, *o, *P, *k;
- } ps;
- struct {
- long n, m, d, s;
- struct arg_list *u, *p, *o, *k, *O;
- } top;
- struct {
- char *L;
- struct arg_list *G, *g, *P, *s, *t, *U, *u;
- char *d;
-
- void *regexes, *snapshot;
- int signal;
- pid_t self, match;
- } pgrep;
- };
-
- struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
- struct dirtree *threadparent;
- unsigned width, height;
- dev_t tty;
- void *fields, *kfields;
- long long ticks, bits, time;
- int kcount, forcek, sortpos;
- int (*match_process)(long long *slot);
- void (*show_process)(void *tb);
-};
-
-// toys/posix/renice.c
-
-struct renice_data {
- long n;
-};
-
-// toys/posix/sed.c
-
-struct sed_data {
- char *i;
- struct arg_list *f, *e;
-
- // processed pattern list
- struct double_list *pattern;
-
- char *nextline, *remember;
- void *restart, *lastregex;
- long nextlen, rememberlen, count;
- int fdout, noeol;
- unsigned xx;
- char delim;
-};
-
-// toys/posix/sort.c
-
-struct sort_data {
- char *t;
- struct arg_list *k;
- char *o, *T, S;
-
- void *key_list;
- int linecount;
- char **lines;
- char *name;
-};
-
-// toys/posix/split.c
-
-struct split_data {
- long l, b, a;
-
- char *outfile;
-};
-
-// toys/posix/strings.c
-
-struct strings_data {
- long n;
- char *t;
-};
-
-// toys/posix/tail.c
-
-struct tail_data {
- long n, c;
-
- int file_no, last_fd;
- struct xnotify *not;
-};
-
-// toys/posix/tar.c
-
-struct tar_data {
- char *f, *C;
- struct arg_list *T, *X;
- char *to_command, *owner, *group, *mtime, *mode;
- struct arg_list *exclude;
-
- struct double_list *incl, *excl, *seen;
- struct string_list *dirs;
- char *cwd;
- int fd, ouid, ggid, hlc, warn, adev, aino, sparselen;
- long long *sparse;
- time_t mtt;
-
- // hardlinks seen so far (hlc many)
- struct {
- char *arg;
- ino_t ino;
- dev_t dev;
- } *hlx;
-
- // Parsed information about a tar header.
- struct tar_header {
- char *name, *link_target, *uname, *gname;
- long long size, ssize;
- uid_t uid;
- gid_t gid;
- mode_t mode;
- time_t mtime;
- dev_t device;
- } hdr;
-};
-
-// toys/posix/tee.c
-
-struct tee_data {
- void *outputs;
-};
-
-// toys/posix/touch.c
-
-struct touch_data {
- char *t, *r, *d;
-};
-
-// toys/posix/ulimit.c
-
-struct ulimit_data {
- long P;
-};
-
-// toys/posix/uniq.c
-
-struct uniq_data {
- long w, s, f;
-
- long repeats;
-};
-
-// toys/posix/uudecode.c
-
-struct uudecode_data {
- char *o;
-};
-
-// toys/posix/wc.c
-
-struct wc_data {
- unsigned long totals[4];
-};
-
-// toys/posix/xargs.c
-
-struct xargs_data {
- long s, n, P;
- char *E;
-
- long entries, bytes;
- char delim;
- FILE *tty;
-};
-
-extern union global_union {
- struct log_data log;
- struct demo_number_data demo_number;
- struct hello_data hello;
- struct skeleton_data skeleton;
- struct dmesg_data dmesg;
- struct gzip_data gzip;
- struct hostname_data hostname;
- struct killall_data killall;
- struct md5sum_data md5sum;
- struct mknod_data mknod;
- struct mktemp_data mktemp;
- struct mount_data mount;
- struct passwd_data passwd;
- struct pidof_data pidof;
- struct seq_data seq;
- struct su_data su;
- struct umount_data umount;
- struct ftpget_data ftpget;
- struct ifconfig_data ifconfig;
- struct microcom_data microcom;
- struct netcat_data netcat;
- struct netstat_data netstat;
- struct ping_data ping;
- struct sntp_data sntp;
- struct tunctl_data tunctl;
- struct acpi_data acpi;
- struct base64_data base64;
- struct blkid_data blkid;
- struct blockdev_data blockdev;
- struct chrt_data chrt;
- struct dos2unix_data dos2unix;
- struct fallocate_data fallocate;
- struct fmt_data fmt;
- struct free_data free;
- struct hexedit_data hexedit;
- struct hwclock_data hwclock;
- struct ionice_data ionice;
- struct login_data login;
- struct losetup_data losetup;
- struct lspci_data lspci;
- struct makedevs_data makedevs;
- struct mix_data mix;
- struct mkpasswd_data mkpasswd;
- struct mkswap_data mkswap;
- struct modinfo_data modinfo;
- struct nsenter_data nsenter;
- struct oneit_data oneit;
- struct setfattr_data setfattr;
- struct shred_data shred;
- struct stat_data stat;
- struct swapon_data swapon;
- struct switch_root_data switch_root;
- struct tac_data tac;
- struct timeout_data timeout;
- struct truncate_data truncate;
- struct watch_data watch;
- struct xxd_data xxd;
- struct arp_data arp;
- struct arping_data arping;
- struct bc_data bc;
- struct bootchartd_data bootchartd;
- struct brctl_data brctl;
- struct crond_data crond;
- struct crontab_data crontab;
- struct dd_data dd;
- struct dhcp_data dhcp;
- struct dhcp6_data dhcp6;
- struct dhcpd_data dhcpd;
- struct diff_data diff;
- struct dumpleases_data dumpleases;
- struct expr_data expr;
- struct fdisk_data fdisk;
- struct fold_data fold;
- struct fsck_data fsck;
- struct getfattr_data getfattr;
- struct getty_data getty;
- struct groupadd_data groupadd;
- struct host_data host;
- struct ip_data ip;
- struct ipcrm_data ipcrm;
- struct ipcs_data ipcs;
- struct klogd_data klogd;
- struct last_data last;
- struct lsof_data lsof;
- struct man_data man;
- struct mke2fs_data mke2fs;
- struct modprobe_data modprobe;
- struct more_data more;
- struct openvt_data openvt;
- struct route_data route;
- struct sh_data sh;
- struct stty_data stty;
- struct sulogin_data sulogin;
- struct syslogd_data syslogd;
- struct tcpsvd_data tcpsvd;
- struct telnet_data telnet;
- struct telnetd_data telnetd;
- struct tftp_data tftp;
- struct tftpd_data tftpd;
- struct tr_data tr;
- struct traceroute_data traceroute;
- struct useradd_data useradd;
- struct vi_data vi;
- struct wget_data wget;
- struct basename_data basename;
- struct chgrp_data chgrp;
- struct chmod_data chmod;
- struct cksum_data cksum;
- struct cmp_data cmp;
- struct cp_data cp;
- struct cpio_data cpio;
- struct cut_data cut;
- struct date_data date;
- struct df_data df;
- struct du_data du;
- struct env_data env;
- struct expand_data expand;
- struct file_data file;
- struct find_data find;
- struct grep_data grep;
- struct head_data head;
- struct iconv_data iconv;
- struct id_data id;
- struct kill_data kill;
- struct ln_data ln;
- struct logger_data logger;
- struct ls_data ls;
- struct mkdir_data mkdir;
- struct mkfifo_data mkfifo;
- struct nice_data nice;
- struct nl_data nl;
- struct od_data od;
- struct paste_data paste;
- struct patch_data patch;
- struct ps_data ps;
- struct renice_data renice;
- struct sed_data sed;
- struct sort_data sort;
- struct split_data split;
- struct strings_data strings;
- struct tail_data tail;
- struct tar_data tar;
- struct tee_data tee;
- struct touch_data touch;
- struct ulimit_data ulimit;
- struct uniq_data uniq;
- struct uudecode_data uudecode;
- struct wc_data wc;
- struct xargs_data xargs;
-} this;
diff --git a/android/device/generated/newtoys.h b/android/device/generated/newtoys.h
deleted file mode 100644
index 62b1d24a..00000000
--- a/android/device/generated/newtoys.h
+++ /dev/null
@@ -1,301 +0,0 @@
-USE_TOYBOX(NEWTOY(toybox, NULL, TOYFLAG_STAYROOT))
-USE_SH(OLDTOY(-bash, sh, 0))
-USE_SH(OLDTOY(-sh, sh, 0))
-USE_SH(OLDTOY(-toysh, sh, 0))
-USE_TRUE(OLDTOY(:, true, TOYFLAG_NOFORK|TOYFLAG_NOHELP))
-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))
-USE_BASE64(NEWTOY(base64, "diw#<0=76[!dw]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_BASENAME(NEWTOY(basename, "^<1as:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SH(OLDTOY(bash, sh, TOYFLAG_BIN))
-USE_BC(NEWTOY(bc, "i(interactive)l(mathlib)q(quiet)s(standard)w(warn)", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_BLKID(NEWTOY(blkid, "ULs*[!LU]", TOYFLAG_BIN))
-USE_BLOCKDEV(NEWTOY(blockdev, "<1>1(setro)(setrw)(getro)(getss)(getbsz)(setbsz)#<0(getsz)(getsize)(getsize64)(getra)(setra)#<0(flushbufs)(rereadpt)",TOYFLAG_SBIN))
-USE_BOOTCHARTD(NEWTOY(bootchartd, 0, TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
-USE_BRCTL(NEWTOY(brctl, "<1", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_BUNZIP2(NEWTOY(bunzip2, "cftkv", TOYFLAG_USR|TOYFLAG_BIN))
-USE_BZCAT(NEWTOY(bzcat, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_CAL(NEWTOY(cal, ">2", TOYFLAG_USR|TOYFLAG_BIN))
-USE_CAT(NEWTOY(cat, "u"USE_CAT_V("vte"), TOYFLAG_BIN))
-USE_CATV(NEWTOY(catv, USE_CATV("vte"), TOYFLAG_USR|TOYFLAG_BIN))
-USE_SH(NEWTOY(cd, NULL, TOYFLAG_NOFORK))
-USE_CHATTR(NEWTOY(chattr, NULL, TOYFLAG_BIN))
-USE_CHCON(NEWTOY(chcon, "<2hvR", TOYFLAG_USR|TOYFLAG_BIN))
-USE_CHGRP(NEWTOY(chgrp, "<2hPLHRfv[-HLP]", TOYFLAG_BIN))
-USE_CHMOD(NEWTOY(chmod, "<2?vRf[-vf]", TOYFLAG_BIN))
-USE_CHOWN(OLDTOY(chown, chgrp, TOYFLAG_BIN))
-USE_CHROOT(NEWTOY(chroot, "^<1", TOYFLAG_USR|TOYFLAG_SBIN|TOYFLAG_ARGFAIL(125)))
-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, "<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))
-USE_CPIO(NEWTOY(cpio, "(no-preserve-owner)(trailer)mduH:p:|i|t|F:v(verbose)o|[!pio][!pot][!pF]", TOYFLAG_BIN))
-USE_CRC32(NEWTOY(crc32, 0, TOYFLAG_BIN))
-USE_CROND(NEWTOY(crond, "fbSl#<0=8d#<0L:c:[-bf][-LS][-ld]", TOYFLAG_USR|TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_CRONTAB(NEWTOY(crontab, "c:u:elr[!elr]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_STAYROOT))
-USE_CUT(NEWTOY(cut, "b*|c*|f*|F*|C*|O(output-delimiter):d:sDn[!cbf]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_DATE(NEWTOY(date, "d:D:r:u[!dr]", TOYFLAG_BIN))
-USE_DD(NEWTOY(dd, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_DEALLOCVT(NEWTOY(deallocvt, ">1", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_NEEDROOT))
-USE_GROUPDEL(OLDTOY(delgroup, groupdel, TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
-USE_USERDEL(OLDTOY(deluser, userdel, TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
-USE_DEMO_MANY_OPTIONS(NEWTOY(demo_many_options, "ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba", TOYFLAG_BIN))
-USE_DEMO_NUMBER(NEWTOY(demo_number, "D#=3<3hdbs", TOYFLAG_BIN))
-USE_DEMO_SCANKEY(NEWTOY(demo_scankey, 0, TOYFLAG_BIN))
-USE_DEMO_UTF8TOWC(NEWTOY(demo_utf8towc, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_DEVMEM(NEWTOY(devmem, "<1>3", TOYFLAG_USR|TOYFLAG_BIN))
-USE_DF(NEWTOY(df, "HPkhit*a[-HPkh]", TOYFLAG_SBIN))
-USE_DHCP(NEWTOY(dhcp, "V:H:F:x*r:O*A#<0=20T#<0=3t#<0=3s:p:i:SBRCaovqnbf", TOYFLAG_SBIN|TOYFLAG_ROOTONLY))
-USE_DHCP6(NEWTOY(dhcp6, "r:A#<0T#<0t#<0s:p:i:SRvqnbf", TOYFLAG_SBIN|TOYFLAG_ROOTONLY))
-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))
-USE_ECHO(NEWTOY(echo, "^?Een[-eE]", TOYFLAG_BIN|TOYFLAG_MAYFORK))
-USE_EGREP(OLDTOY(egrep, grep, TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
-USE_EJECT(NEWTOY(eject, ">1stT[!tT]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_ENV(NEWTOY(env, "^0iu*", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(125)))
-USE_SH(NEWTOY(exit, NULL, TOYFLAG_NOFORK))
-USE_EXPAND(NEWTOY(expand, "t*", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_EXPR(NEWTOY(expr, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_FACTOR(NEWTOY(factor, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_FALLOCATE(NEWTOY(fallocate, ">1l#|o#", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FALSE(NEWTOY(false, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP))
-USE_FDISK(NEWTOY(fdisk, "C#<0H#<0S#<0b#<512ul", TOYFLAG_SBIN))
-USE_FGREP(OLDTOY(fgrep, grep, TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
-USE_FILE(NEWTOY(file, "<1bhLs[!hL]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FIND(NEWTOY(find, "?^HL[-HL]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FLOCK(NEWTOY(flock, "<1>1nsux[-sux]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FMT(NEWTOY(fmt, "w#<0=75", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_FOLD(NEWTOY(fold, "bsuw#<1", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FREE(NEWTOY(free, "htgmkb[!htgmkb]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FREERAMDISK(NEWTOY(freeramdisk, "<1>1", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_FSCK(NEWTOY(fsck, "?t:ANPRTVsC#", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FSFREEZE(NEWTOY(fsfreeze, "<1>1f|u|[!fu]", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_FSTYPE(NEWTOY(fstype, "<1", TOYFLAG_BIN))
-USE_FSYNC(NEWTOY(fsync, "<1d", TOYFLAG_BIN))
-USE_FTPGET(NEWTOY(ftpget, "<2>3P:cp:u:vgslLmMdD[-gs][!gslLmMdD][!clL]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FTPPUT(OLDTOY(ftpput, ftpget, TOYFLAG_USR|TOYFLAG_BIN))
-USE_GETCONF(NEWTOY(getconf, ">2al", TOYFLAG_USR|TOYFLAG_BIN))
-USE_GETENFORCE(NEWTOY(getenforce, ">0", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_GETFATTR(NEWTOY(getfattr, "(only-values)dhn:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_GETTY(NEWTOY(getty, "<2t#<0H:I:l:f:iwnmLh",TOYFLAG_SBIN))
-USE_GREP(NEWTOY(grep, "(line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]", TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
-USE_GROUPADD(NEWTOY(groupadd, "<1>2g#<0S", TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
-USE_GROUPDEL(NEWTOY(groupdel, "<1>2", TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
-USE_GROUPS(NEWTOY(groups, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_GUNZIP(NEWTOY(gunzip, "cdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_GZIP(NEWTOY(gzip, "ncdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_REBOOT(OLDTOY(halt, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_HEAD(NEWTOY(head, "?n(lines)#<0=10c(bytes)#<0qv[-nc]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_HELLO(NEWTOY(hello, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_HELP(NEWTOY(help, ""USE_HELP_EXTRAS("ah"), TOYFLAG_BIN))
-USE_HEXEDIT(NEWTOY(hexedit, "<1>1r", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_HOST(NEWTOY(host, "<1>2avt:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_HOSTID(NEWTOY(hostid, ">0", TOYFLAG_USR|TOYFLAG_BIN))
-USE_HOSTNAME(NEWTOY(hostname, ">1bdsfF:[!bdsf]", TOYFLAG_BIN))
-USE_HWCLOCK(NEWTOY(hwclock, ">0(fast)f(rtc):u(utc)l(localtime)t(systz)s(hctosys)r(show)w(systohc)[-ul][!rtsw]", TOYFLAG_SBIN))
-USE_I2CDETECT(NEWTOY(i2cdetect, ">3aFly", TOYFLAG_USR|TOYFLAG_BIN))
-USE_I2CDUMP(NEWTOY(i2cdump, "<2>2fy", TOYFLAG_USR|TOYFLAG_BIN))
-USE_I2CGET(NEWTOY(i2cget, "<3>3fy", TOYFLAG_USR|TOYFLAG_BIN))
-USE_I2CSET(NEWTOY(i2cset, "<4fy", TOYFLAG_USR|TOYFLAG_BIN))
-USE_ICONV(NEWTOY(iconv, "cst:f:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_ID(NEWTOY(id, ">1"USE_ID_Z("Z")"nGgru[!"USE_ID_Z("Z")"Ggu]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_IFCONFIG(NEWTOY(ifconfig, "^?aS", TOYFLAG_SBIN))
-USE_INIT(NEWTOY(init, "", TOYFLAG_SBIN))
-USE_INOTIFYD(NEWTOY(inotifyd, "<2", TOYFLAG_USR|TOYFLAG_BIN))
-USE_INSMOD(NEWTOY(insmod, "<1", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_INSTALL(NEWTOY(install, "<1cdDpsvm:o:g:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_IONICE(NEWTOY(ionice, "^tc#<0>3=2n#<0>7=5p#", TOYFLAG_USR|TOYFLAG_BIN))
-USE_IORENICE(NEWTOY(iorenice, "?<1>3", TOYFLAG_USR|TOYFLAG_BIN))
-USE_IOTOP(NEWTOY(iotop, ">0AaKO" "Hk*o*p*u*s#<1=7d%<100=3000m#n#<1bq", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_STAYROOT|TOYFLAG_LOCALE))
-USE_IP(NEWTOY(ip, NULL, TOYFLAG_SBIN))
-USE_IP(OLDTOY(ipaddr, ip, TOYFLAG_SBIN))
-USE_IPCRM(NEWTOY(ipcrm, "m*M*s*S*q*Q*", TOYFLAG_USR|TOYFLAG_BIN))
-USE_IPCS(NEWTOY(ipcs, "acptulsqmi#", TOYFLAG_USR|TOYFLAG_BIN))
-USE_IP(OLDTOY(iplink, ip, TOYFLAG_SBIN))
-USE_IP(OLDTOY(iproute, ip, TOYFLAG_SBIN))
-USE_IP(OLDTOY(iprule, ip, TOYFLAG_SBIN))
-USE_IP(OLDTOY(iptunnel, ip, TOYFLAG_SBIN))
-USE_KILL(NEWTOY(kill, "?ls: ", TOYFLAG_BIN))
-USE_KILLALL(NEWTOY(killall, "?s:ilqvw", TOYFLAG_USR|TOYFLAG_BIN))
-USE_KILLALL5(NEWTOY(killall5, "?o*ls: [!lo][!ls]", TOYFLAG_SBIN))
-USE_KLOGD(NEWTOY(klogd, "c#<1>8n", TOYFLAG_SBIN))
-USE_LAST(NEWTOY(last, "f:W", TOYFLAG_BIN))
-USE_LINK(NEWTOY(link, "<2>2", TOYFLAG_USR|TOYFLAG_BIN))
-USE_LN(NEWTOY(ln, "<1t:Tvnfs", TOYFLAG_BIN))
-USE_LOAD_POLICY(NEWTOY(load_policy, "<1>1", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_LOG(NEWTOY(log, "<1p:t:", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_LOGGER(NEWTOY(logger, "st:p:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_LOGIN(NEWTOY(login, ">1f:ph:", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
-USE_LOGNAME(NEWTOY(logname, ">0", TOYFLAG_USR|TOYFLAG_BIN))
-USE_LOGWRAPPER(NEWTOY(logwrapper, 0, TOYFLAG_NOHELP|TOYFLAG_USR|TOYFLAG_BIN))
-USE_LOSETUP(NEWTOY(losetup, ">2S(sizelimit)#s(show)ro#j:fdcaD[!afj]", TOYFLAG_SBIN))
-USE_LS(NEWTOY(ls, "(color):;(full-time)(show-control-chars)ZgoACFHLRSabcdfhikl@mnpqrstux1[-Cxm1][-Cxml][-Cxmo][-Cxmg][-cu][-ftS][-HL][!qb]", TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_LSATTR(NEWTOY(lsattr, "vldaR", TOYFLAG_BIN))
-USE_LSMOD(NEWTOY(lsmod, NULL, TOYFLAG_SBIN))
-USE_LSOF(NEWTOY(lsof, "lp*t", TOYFLAG_USR|TOYFLAG_BIN))
-USE_LSPCI(NEWTOY(lspci, "emkn"USE_LSPCI_TEXT("@i:"), TOYFLAG_USR|TOYFLAG_BIN))
-USE_LSUSB(NEWTOY(lsusb, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_MAKEDEVS(NEWTOY(makedevs, "<1>1d:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MAN(NEWTOY(man, "k:M:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MCOOKIE(NEWTOY(mcookie, "v(verbose)V(version)", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MD5SUM(NEWTOY(md5sum, "bc(check)s(status)[!bc]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MDEV(NEWTOY(mdev, "s", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_UMASK))
-USE_MICROCOM(NEWTOY(microcom, "<1>1s:X", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MIX(NEWTOY(mix, "c:d:l#r#", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MKDIR(NEWTOY(mkdir, "<1"USE_MKDIR_Z("Z:")"vp(parent)(parents)m:", TOYFLAG_BIN|TOYFLAG_UMASK))
-USE_MKE2FS(NEWTOY(mke2fs, "<1>2g:Fnqm#N#i#b#", TOYFLAG_SBIN))
-USE_MKFIFO(NEWTOY(mkfifo, "<1"USE_MKFIFO_Z("Z:")"m:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MKNOD(NEWTOY(mknod, "<2>4m(mode):"USE_MKNOD_Z("Z:"), TOYFLAG_BIN|TOYFLAG_UMASK))
-USE_MKPASSWD(NEWTOY(mkpasswd, ">2S:m:P#=0<0", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MKSWAP(NEWTOY(mkswap, "<1>1L:", TOYFLAG_SBIN))
-USE_MKTEMP(NEWTOY(mktemp, ">1(tmpdir);:uqd(directory)p:t", TOYFLAG_BIN))
-USE_MODINFO(NEWTOY(modinfo, "<1b:k:F:0", TOYFLAG_SBIN))
-USE_MODPROBE(NEWTOY(modprobe, "alrqvsDbd*", TOYFLAG_SBIN))
-USE_MORE(NEWTOY(more, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_MOUNT(NEWTOY(mount, "?O:afnrvwt:o*[-rw]", TOYFLAG_BIN|TOYFLAG_STAYROOT))
-USE_MOUNTPOINT(NEWTOY(mountpoint, "<1qdx[-dx]", TOYFLAG_BIN))
-USE_MV(NEWTOY(mv, "<2vnF(remove-destination)fi[-ni]", TOYFLAG_BIN))
-USE_NBD_CLIENT(OLDTOY(nbd-client, nbd_client, TOYFLAG_USR|TOYFLAG_BIN))
-USE_NBD_CLIENT(NEWTOY(nbd_client, "<3>3ns", 0))
-USE_NETCAT(OLDTOY(nc, netcat, TOYFLAG_USR|TOYFLAG_BIN))
-USE_NETCAT(NEWTOY(netcat, USE_NETCAT_LISTEN("^tlL")"w#<1W#<1p#<1>65535q#<1s:f:46uU"USE_NETCAT_LISTEN("[!tlL][!Lw]")"[!46U]", TOYFLAG_BIN))
-USE_NETSTAT(NEWTOY(netstat, "pWrxwutneal", TOYFLAG_BIN))
-USE_NICE(NEWTOY(nice, "^<1n#", TOYFLAG_BIN))
-USE_NL(NEWTOY(nl, "v#=1l#w#<0=6Eb:n:s:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_NOHUP(NEWTOY(nohup, "<1^", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(125)))
-USE_NPROC(NEWTOY(nproc, "(all)", TOYFLAG_USR|TOYFLAG_BIN))
-USE_NSENTER(NEWTOY(nsenter, "<1F(no-fork)t#<1(target)i:(ipc);m:(mount);n:(net);p:(pid);u:(uts);U:(user);", TOYFLAG_USR|TOYFLAG_BIN))
-USE_OD(NEWTOY(od, "j#vw#<1=16N#xsodcbA:t*", TOYFLAG_USR|TOYFLAG_BIN))
-USE_ONEIT(NEWTOY(oneit, "^<1nc:p3[!pn]", TOYFLAG_SBIN))
-USE_OPENVT(NEWTOY(openvt, "c#<1>63sw", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
-USE_PARTPROBE(NEWTOY(partprobe, "<1", TOYFLAG_SBIN))
-USE_PASSWD(NEWTOY(passwd, ">1a:dlu", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
-USE_PASTE(NEWTOY(paste, "d:s", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_PATCH(NEWTOY(patch, "(no-backup-if-mismatch)(dry-run)"USE_TOYBOX_DEBUG("x")"g#fulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
-USE_PGREP(NEWTOY(pgrep, "?cld:u*U*t*s*P*g*G*fnovxL:[-no]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_PIDOF(NEWTOY(pidof, "<1so:x", TOYFLAG_BIN))
-USE_PING(NEWTOY(ping, "<1>1m#t#<0>255=64c#<0=3s#<0>4088=56i%W#<0=3w#<0qf46I:[-46]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_PING(OLDTOY(ping6, ping, TOYFLAG_USR|TOYFLAG_BIN))
-USE_PIVOT_ROOT(NEWTOY(pivot_root, "<2>2", TOYFLAG_SBIN))
-USE_PKILL(NEWTOY(pkill, "?Vu*U*t*s*P*g*G*fnovxl:[-no]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_PMAP(NEWTOY(pmap, "<1xq", TOYFLAG_USR|TOYFLAG_BIN))
-USE_REBOOT(OLDTOY(poweroff, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_PRINTENV(NEWTOY(printenv, "0(null)", TOYFLAG_BIN))
-USE_PRINTF(NEWTOY(printf, "<1?^", TOYFLAG_USR|TOYFLAG_BIN))
-USE_ULIMIT(OLDTOY(prlimit, ulimit, TOYFLAG_USR|TOYFLAG_BIN))
-USE_PS(NEWTOY(ps, "k(sort)*P(ppid)*aAdeflMno*O*p(pid)*s*t*Tu*U*g*G*wZ[!ol][+Ae][!oO]", TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_PWD(NEWTOY(pwd, ">0LP[-LP]", TOYFLAG_BIN))
-USE_PWDX(NEWTOY(pwdx, "<1a", TOYFLAG_USR|TOYFLAG_BIN))
-USE_READAHEAD(NEWTOY(readahead, NULL, TOYFLAG_BIN))
-USE_READLINK(NEWTOY(readlink, "<1nqmef(canonicalize)[-mef]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_REALPATH(NEWTOY(realpath, "<1", TOYFLAG_USR|TOYFLAG_BIN))
-USE_REBOOT(NEWTOY(reboot, "fn", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_RENICE(NEWTOY(renice, "<1gpun#|", TOYFLAG_USR|TOYFLAG_BIN))
-USE_RESET(NEWTOY(reset, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_RESTORECON(NEWTOY(restorecon, "<1DFnRrv", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_REV(NEWTOY(rev, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_RFKILL(NEWTOY(rfkill, "<1>2", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_RM(NEWTOY(rm, "fiRrv[-fi]", TOYFLAG_BIN))
-USE_RMDIR(NEWTOY(rmdir, "<1(ignore-fail-on-non-empty)p", TOYFLAG_BIN))
-USE_RMMOD(NEWTOY(rmmod, "<1wf", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_ROUTE(NEWTOY(route, "?neA:", TOYFLAG_BIN))
-USE_RUNCON(NEWTOY(runcon, "<2", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_SED(NEWTOY(sed, "(help)(version)e*f*i:;nErz(null-data)[+Er]", TOYFLAG_BIN|TOYFLAG_LOCALE|TOYFLAG_NOHELP))
-USE_SENDEVENT(NEWTOY(sendevent, "<4>4", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_SEQ(NEWTOY(seq, "<1>3?f:s:w[!fw]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SETENFORCE(NEWTOY(setenforce, "<1>1", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_SETFATTR(NEWTOY(setfattr, "hn:|v:x:|[!xv]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SETSID(NEWTOY(setsid, "^<1t", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SH(NEWTOY(sh, "c:i", TOYFLAG_BIN))
-USE_SHA1SUM(NEWTOY(sha1sum, "bc(check)s(status)[!bc]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TOYBOX_LIBCRYPTO(USE_SHA224SUM(OLDTOY(sha224sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_TOYBOX_LIBCRYPTO(USE_SHA256SUM(OLDTOY(sha256sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_TOYBOX_LIBCRYPTO(USE_SHA384SUM(OLDTOY(sha384sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_TOYBOX_LIBCRYPTO(USE_SHA512SUM(OLDTOY(sha512sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_SHRED(NEWTOY(shred, "<1zxus#<1n#<1o#<0f", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SKELETON(NEWTOY(skeleton, "(walrus)(blubber):;(also):e@d*c#b:a", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SKELETON_ALIAS(NEWTOY(skeleton_alias, "b#dq", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SLEEP(NEWTOY(sleep, "<1", TOYFLAG_BIN))
-USE_SNTP(NEWTOY(sntp, ">1M :m :Sp:t#<0=1>16asdDqr#<4>17=10[!as]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SORT(NEWTOY(sort, USE_SORT_FLOAT("g")"S:T:m" "o:k*t:" "xVbMcszdfirun", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
-USE_SPLIT(NEWTOY(split, ">2a#<1=2>9b#<1l#<1[!bl]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_STAT(NEWTOY(stat, "<1c:(format)fLt", TOYFLAG_BIN))
-USE_STRINGS(NEWTOY(strings, "t:an#=4<1fo", TOYFLAG_USR|TOYFLAG_BIN))
-USE_STTY(NEWTOY(stty, "?aF:g[!ag]", TOYFLAG_BIN))
-USE_SU(NEWTOY(su, "^lmpu:g:c:s:[!lmp]", TOYFLAG_BIN|TOYFLAG_ROOTONLY))
-USE_SULOGIN(NEWTOY(sulogin, "t#<0=0", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_SWAPOFF(NEWTOY(swapoff, "<1>1", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_SWAPON(NEWTOY(swapon, "<1>1p#<0>32767d", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_SWITCH_ROOT(NEWTOY(switch_root, "<2c:h", TOYFLAG_SBIN))
-USE_SYNC(NEWTOY(sync, NULL, TOYFLAG_BIN))
-USE_SYSCTL(NEWTOY(sysctl, "^neNqwpaA[!ap][!aq][!aw][+aA]", TOYFLAG_SBIN))
-USE_SYSLOGD(NEWTOY(syslogd,">0l#<1>8=8R:b#<0>99=1s#<0=200m#<0>71582787=20O:p:f:a:nSKLD", TOYFLAG_SBIN|TOYFLAG_STAYROOT))
-USE_TAC(NEWTOY(tac, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_TAIL(NEWTOY(tail, "?fc-n-[-cn]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TAR(NEWTOY(tar, "&(restrict)(full-time)(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(mode):(mtime):(group):(owner):(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):a[!txc][!jzJa]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TASKSET(NEWTOY(taskset, "<1^pa", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_STAYROOT))
-USE_TCPSVD(NEWTOY(tcpsvd, "^<3c#=30<1C:b#=20<0u:l:hEv", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TEE(NEWTOY(tee, "ia", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TELNET(NEWTOY(telnet, "<1>2", TOYFLAG_BIN))
-USE_TELNETD(NEWTOY(telnetd, "w#<0b:p#<0>65535=23f:l:FSKi[!wi]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TEST(NEWTOY(test, 0, TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
-USE_TFTP(NEWTOY(tftp, "<1b#<8>65464r:l:g|p|[!gp]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TFTPD(NEWTOY(tftpd, "rcu:l", TOYFLAG_BIN))
-USE_TIME(NEWTOY(time, "<1^pv", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TIMEOUT(NEWTOY(timeout, "<2^(foreground)(preserve-status)vk:s(signal):", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(125)))
-USE_TOP(NEWTOY(top, ">0O*" "Hk*o*p*u*s#<1d%<100=3000m#n#<1bq[!oO]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_TOUCH(NEWTOY(touch, "<1acd:fmr:t:h[!dtr]", TOYFLAG_BIN))
-USE_SH(OLDTOY(toysh, sh, TOYFLAG_BIN))
-USE_TR(NEWTOY(tr, "^>2<1Ccsd[+cC]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TRACEROUTE(NEWTOY(traceroute, "<1>2i:f#<1>255=1z#<0>86400=0g*w#<0>86400=5t#<0>255=0s:q#<1>255=3p#<1>65535=33434m#<1>255=30rvndlIUF64", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
-USE_TRACEROUTE(OLDTOY(traceroute6,traceroute, TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
-USE_TRUE(NEWTOY(true, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP))
-USE_TRUNCATE(NEWTOY(truncate, "<1s:|c", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TTY(NEWTOY(tty, "s", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TUNCTL(NEWTOY(tunctl, "<1>1t|d|u:T[!td]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TCPSVD(OLDTOY(udpsvd, tcpsvd, TOYFLAG_USR|TOYFLAG_BIN))
-USE_ULIMIT(NEWTOY(ulimit, ">1P#<1SHavutsrRqpnmlifedc[-SH][!apvutsrRqnmlifedc]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_UMOUNT(NEWTOY(umount, "cndDflrat*v[!na]", TOYFLAG_BIN|TOYFLAG_STAYROOT))
-USE_UNAME(NEWTOY(uname, "oamvrns[+os]", TOYFLAG_BIN))
-USE_UNIQ(NEWTOY(uniq, "f#s#w#zicdu", TOYFLAG_USR|TOYFLAG_BIN))
-USE_UNIX2DOS(NEWTOY(unix2dos, 0, TOYFLAG_BIN))
-USE_UNLINK(NEWTOY(unlink, "<1>1", TOYFLAG_USR|TOYFLAG_BIN))
-USE_UNSHARE(NEWTOY(unshare, "<1^f(fork);r(map-root-user);i:(ipc);m:(mount);n:(net);p:(pid);u:(uts);U:(user);", TOYFLAG_USR|TOYFLAG_BIN))
-USE_UPTIME(NEWTOY(uptime, ">0ps", TOYFLAG_USR|TOYFLAG_BIN))
-USE_USERADD(NEWTOY(useradd, "<1>2u#<0G:s:g:h:SDH", TOYFLAG_NEEDROOT|TOYFLAG_UMASK|TOYFLAG_SBIN))
-USE_USERDEL(NEWTOY(userdel, "<1>1r", TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
-USE_USLEEP(NEWTOY(usleep, "<1", TOYFLAG_BIN))
-USE_UUDECODE(NEWTOY(uudecode, ">1o:", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_UMASK))
-USE_UUENCODE(NEWTOY(uuencode, "<1>2m", TOYFLAG_USR|TOYFLAG_BIN))
-USE_UUIDGEN(NEWTOY(uuidgen, ">0r(random)", TOYFLAG_USR|TOYFLAG_BIN))
-USE_VCONFIG(NEWTOY(vconfig, "<2>4", TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
-USE_VI(NEWTOY(vi, "<1>1", TOYFLAG_USR|TOYFLAG_BIN))
-USE_VMSTAT(NEWTOY(vmstat, ">2n", TOYFLAG_BIN))
-USE_W(NEWTOY(w, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_WATCH(NEWTOY(watch, "^<1n%<100=2000tebx", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_WC(NEWTOY(wc, "mcwl", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-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: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))
-USE_ZCAT(NEWTOY(zcat, "cdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
diff --git a/android/device/generated/tags.h b/android/device/generated/tags.h
deleted file mode 100644
index e1e4d314..00000000
--- a/android/device/generated/tags.h
+++ /dev/null
@@ -1,140 +0,0 @@
-#define DD_conv_fsync 0
-#define _DD_conv_fsync (1<<0)
-#define DD_conv_noerror 1
-#define _DD_conv_noerror (1<<1)
-#define DD_conv_notrunc 2
-#define _DD_conv_notrunc (1<<2)
-#define DD_conv_sync 3
-#define _DD_conv_sync (1<<3)
-#define DD_iflag_count_bytes 0
-#define _DD_iflag_count_bytes (1<<0)
-#define DD_iflag_skip_bytes 1
-#define _DD_iflag_skip_bytes (1<<1)
-#define DD_oflag_seek_bytes 0
-#define _DD_oflag_seek_bytes (1<<0)
-#define CP_mode 0
-#define _CP_mode (1<<0)
-#define CP_ownership 1
-#define _CP_ownership (1<<1)
-#define CP_timestamps 2
-#define _CP_timestamps (1<<2)
-#define CP_context 3
-#define _CP_context (1<<3)
-#define CP_xattr 4
-#define _CP_xattr (1<<4)
-#define PS_PID 0
-#define _PS_PID (1<<0)
-#define PS_PPID 1
-#define _PS_PPID (1<<1)
-#define PS_PRI 2
-#define _PS_PRI (1<<2)
-#define PS_NI 3
-#define _PS_NI (1<<3)
-#define PS_ADDR 4
-#define _PS_ADDR (1<<4)
-#define PS_SZ 5
-#define _PS_SZ (1<<5)
-#define PS_RSS 6
-#define _PS_RSS (1<<6)
-#define PS_PGID 7
-#define _PS_PGID (1<<7)
-#define PS_VSZ 8
-#define _PS_VSZ (1<<8)
-#define PS_MAJFL 9
-#define _PS_MAJFL (1<<9)
-#define PS_MINFL 10
-#define _PS_MINFL (1<<10)
-#define PS_PR 11
-#define _PS_PR (1<<11)
-#define PS_PSR 12
-#define _PS_PSR (1<<12)
-#define PS_RTPRIO 13
-#define _PS_RTPRIO (1<<13)
-#define PS_SCH 14
-#define _PS_SCH (1<<14)
-#define PS_CPU 15
-#define _PS_CPU (1<<15)
-#define PS_TID 16
-#define _PS_TID (1<<16)
-#define PS_TCNT 17
-#define _PS_TCNT (1<<17)
-#define PS_BIT 18
-#define _PS_BIT (1<<18)
-#define PS_TTY 19
-#define _PS_TTY (1<<19)
-#define PS_WCHAN 20
-#define _PS_WCHAN (1<<20)
-#define PS_LABEL 21
-#define _PS_LABEL (1<<21)
-#define PS_COMM 22
-#define _PS_COMM (1<<22)
-#define PS_NAME 23
-#define _PS_NAME (1<<23)
-#define PS_COMMAND 24
-#define _PS_COMMAND (1<<24)
-#define PS_CMDLINE 25
-#define _PS_CMDLINE (1<<25)
-#define PS_ARGS 26
-#define _PS_ARGS (1<<26)
-#define PS_CMD 27
-#define _PS_CMD (1<<27)
-#define PS_UID 28
-#define _PS_UID (1<<28)
-#define PS_USER 29
-#define _PS_USER (1<<29)
-#define PS_RUID 30
-#define _PS_RUID (1<<30)
-#define PS_RUSER 31
-#define _PS_RUSER (1<<31)
-#define PS_GID 32
-#define _PS_GID (1LL<<32)
-#define PS_GROUP 33
-#define _PS_GROUP (1LL<<33)
-#define PS_RGID 34
-#define _PS_RGID (1LL<<34)
-#define PS_RGROUP 35
-#define _PS_RGROUP (1LL<<35)
-#define PS_TIME 36
-#define _PS_TIME (1LL<<36)
-#define PS_ELAPSED 37
-#define _PS_ELAPSED (1LL<<37)
-#define PS_TIME_ 38
-#define _PS_TIME_ (1LL<<38)
-#define PS_C 39
-#define _PS_C (1LL<<39)
-#define PS__VSZ 40
-#define _PS__VSZ (1LL<<40)
-#define PS__MEM 41
-#define _PS__MEM (1LL<<41)
-#define PS__CPU 42
-#define _PS__CPU (1LL<<42)
-#define PS_VIRT 43
-#define _PS_VIRT (1LL<<43)
-#define PS_RES 44
-#define _PS_RES (1LL<<44)
-#define PS_SHR 45
-#define _PS_SHR (1LL<<45)
-#define PS_READ 46
-#define _PS_READ (1LL<<46)
-#define PS_WRITE 47
-#define _PS_WRITE (1LL<<47)
-#define PS_IO 48
-#define _PS_IO (1LL<<48)
-#define PS_DREAD 49
-#define _PS_DREAD (1LL<<49)
-#define PS_DWRITE 50
-#define _PS_DWRITE (1LL<<50)
-#define PS_SWAP 51
-#define _PS_SWAP (1LL<<51)
-#define PS_DIO 52
-#define _PS_DIO (1LL<<52)
-#define PS_STIME 53
-#define _PS_STIME (1LL<<53)
-#define PS_F 54
-#define _PS_F (1LL<<54)
-#define PS_S 55
-#define _PS_S (1LL<<55)
-#define PS_STAT 56
-#define _PS_STAT (1LL<<56)
-#define PS_PCY 57
-#define _PS_PCY (1LL<<57)
diff --git a/android/linux/generated/config.h b/android/linux/generated/config.h
deleted file mode 100644
index 8b32ee61..00000000
--- a/android/linux/generated/config.h
+++ /dev/null
@@ -1,646 +0,0 @@
-#define CFG_TOYBOX_ANDROID_SCHEDPOLICY 0
-#define USE_TOYBOX_ANDROID_SCHEDPOLICY(...)
-#define CFG_TOYBOX_CONTAINER 0
-#define USE_TOYBOX_CONTAINER(...)
-#define CFG_TOYBOX_DEBUG 0
-#define USE_TOYBOX_DEBUG(...)
-#define CFG_TOYBOX_FALLOCATE 0
-#define USE_TOYBOX_FALLOCATE(...)
-#define CFG_TOYBOX_FIFREEZE 0
-#define USE_TOYBOX_FIFREEZE(...)
-#define CFG_TOYBOX_FLOAT 1
-#define USE_TOYBOX_FLOAT(...) __VA_ARGS__
-#define CFG_TOYBOX_FORK 1
-#define USE_TOYBOX_FORK(...) __VA_ARGS__
-#define CFG_TOYBOX_FREE 0
-#define USE_TOYBOX_FREE(...)
-#define CFG_TOYBOX_GETRANDOM 0
-#define USE_TOYBOX_GETRANDOM(...)
-#define CFG_TOYBOX_HELP_DASHDASH 1
-#define USE_TOYBOX_HELP_DASHDASH(...) __VA_ARGS__
-#define CFG_TOYBOX_HELP 1
-#define USE_TOYBOX_HELP(...) __VA_ARGS__
-#define CFG_TOYBOX_I18N 1
-#define USE_TOYBOX_I18N(...) __VA_ARGS__
-#define CFG_TOYBOX_ICONV 1
-#define USE_TOYBOX_ICONV(...) __VA_ARGS__
-#define CFG_TOYBOX_LIBCRYPTO 1
-#define USE_TOYBOX_LIBCRYPTO(...) __VA_ARGS__
-#define CFG_TOYBOX_LIBZ 1
-#define USE_TOYBOX_LIBZ(...) __VA_ARGS__
-#define CFG_TOYBOX_LSM_NONE 1
-#define USE_TOYBOX_LSM_NONE(...) __VA_ARGS__
-#define CFG_TOYBOX_MUSL_NOMMU_IS_BROKEN 0
-#define USE_TOYBOX_MUSL_NOMMU_IS_BROKEN(...)
-#define CFG_TOYBOX_NORECURSE 0
-#define USE_TOYBOX_NORECURSE(...)
-#define CFG_TOYBOX_ON_ANDROID 0
-#define USE_TOYBOX_ON_ANDROID(...)
-#define CFG_TOYBOX_PEDANTIC_ARGS 0
-#define USE_TOYBOX_PEDANTIC_ARGS(...)
-#define CFG_TOYBOX_PRLIMIT 0
-#define USE_TOYBOX_PRLIMIT(...)
-#define CFG_TOYBOX_SELINUX 0
-#define USE_TOYBOX_SELINUX(...)
-#define CFG_TOYBOX_SHADOW 0
-#define USE_TOYBOX_SHADOW(...)
-#define CFG_TOYBOX_SMACK 0
-#define USE_TOYBOX_SMACK(...)
-#define CFG_TOYBOX_SUID 1
-#define USE_TOYBOX_SUID(...) __VA_ARGS__
-#define CFG_TOYBOX_UID_SYS 100
-#define CFG_TOYBOX_UID_USR 500
-#define CFG_TOYBOX_UTMPX 0
-#define USE_TOYBOX_UTMPX(...)
-#define CFG_TOYBOX 1
-#define USE_TOYBOX(...) __VA_ARGS__
-#define CFG_ACPI 0
-#define USE_ACPI(...)
-#define CFG_ARCH 0
-#define USE_ARCH(...)
-#define CFG_ARPING 0
-#define USE_ARPING(...)
-#define CFG_ARP 0
-#define USE_ARP(...)
-#define CFG_ASCII 0
-#define USE_ASCII(...)
-#define CFG_BASE64 0
-#define USE_BASE64(...)
-#define CFG_BASENAME 1
-#define USE_BASENAME(...) __VA_ARGS__
-#define CFG_BC 1
-#define USE_BC(...) __VA_ARGS__
-#define CFG_BLKID 0
-#define USE_BLKID(...)
-#define CFG_BLOCKDEV 0
-#define USE_BLOCKDEV(...)
-#define CFG_BOOTCHARTD 0
-#define USE_BOOTCHARTD(...)
-#define CFG_BRCTL 0
-#define USE_BRCTL(...)
-#define CFG_BUNZIP2 0
-#define USE_BUNZIP2(...)
-#define CFG_BZCAT 0
-#define USE_BZCAT(...)
-#define CFG_CAL 0
-#define USE_CAL(...)
-#define CFG_CATV 0
-#define USE_CATV(...)
-#define CFG_CAT_V 1
-#define USE_CAT_V(...) __VA_ARGS__
-#define CFG_CAT 1
-#define USE_CAT(...) __VA_ARGS__
-#define CFG_CD 0
-#define USE_CD(...)
-#define CFG_CHATTR 0
-#define USE_CHATTR(...)
-#define CFG_CHCON 0
-#define USE_CHCON(...)
-#define CFG_CHGRP 0
-#define USE_CHGRP(...)
-#define CFG_CHMOD 1
-#define USE_CHMOD(...) __VA_ARGS__
-#define CFG_CHOWN 0
-#define USE_CHOWN(...)
-#define CFG_CHROOT 0
-#define USE_CHROOT(...)
-#define CFG_CHRT 0
-#define USE_CHRT(...)
-#define CFG_CHVT 0
-#define USE_CHVT(...)
-#define CFG_CKSUM 0
-#define USE_CKSUM(...)
-#define CFG_CLEAR 0
-#define USE_CLEAR(...)
-#define CFG_CMP 1
-#define USE_CMP(...) __VA_ARGS__
-#define CFG_COMM 1
-#define USE_COMM(...) __VA_ARGS__
-#define CFG_COUNT 0
-#define USE_COUNT(...)
-#define CFG_CPIO 0
-#define USE_CPIO(...)
-#define CFG_CP_PRESERVE 1
-#define USE_CP_PRESERVE(...) __VA_ARGS__
-#define CFG_CP 1
-#define USE_CP(...) __VA_ARGS__
-#define CFG_CRC32 0
-#define USE_CRC32(...)
-#define CFG_CROND 0
-#define USE_CROND(...)
-#define CFG_CRONTAB 0
-#define USE_CRONTAB(...)
-#define CFG_CUT 1
-#define USE_CUT(...) __VA_ARGS__
-#define CFG_DATE 1
-#define USE_DATE(...) __VA_ARGS__
-#define CFG_DD 1
-#define USE_DD(...) __VA_ARGS__
-#define CFG_DEALLOCVT 0
-#define USE_DEALLOCVT(...)
-#define CFG_DEBUG_DHCP 0
-#define USE_DEBUG_DHCP(...)
-#define CFG_DEMO_MANY_OPTIONS 0
-#define USE_DEMO_MANY_OPTIONS(...)
-#define CFG_DEMO_NUMBER 0
-#define USE_DEMO_NUMBER(...)
-#define CFG_DEMO_SCANKEY 0
-#define USE_DEMO_SCANKEY(...)
-#define CFG_DEMO_UTF8TOWC 0
-#define USE_DEMO_UTF8TOWC(...)
-#define CFG_DEVMEM 0
-#define USE_DEVMEM(...)
-#define CFG_DF 0
-#define USE_DF(...)
-#define CFG_DHCP6 0
-#define USE_DHCP6(...)
-#define CFG_DHCPD 0
-#define USE_DHCPD(...)
-#define CFG_DHCP 0
-#define USE_DHCP(...)
-#define CFG_DIFF 1
-#define USE_DIFF(...) __VA_ARGS__
-#define CFG_DIRNAME 1
-#define USE_DIRNAME(...) __VA_ARGS__
-#define CFG_DMESG 0
-#define USE_DMESG(...)
-#define CFG_DNSDOMAINNAME 0
-#define USE_DNSDOMAINNAME(...)
-#define CFG_DOS2UNIX 1
-#define USE_DOS2UNIX(...) __VA_ARGS__
-#define CFG_DUMPLEASES 0
-#define USE_DUMPLEASES(...)
-#define CFG_DU 1
-#define USE_DU(...) __VA_ARGS__
-#define CFG_ECHO 1
-#define USE_ECHO(...) __VA_ARGS__
-#define CFG_EGREP 1
-#define USE_EGREP(...) __VA_ARGS__
-#define CFG_EJECT 0
-#define USE_EJECT(...)
-#define CFG_ENV 1
-#define USE_ENV(...) __VA_ARGS__
-#define CFG_EXIT 0
-#define USE_EXIT(...)
-#define CFG_EXPAND 0
-#define USE_EXPAND(...)
-#define CFG_EXPR 1
-#define USE_EXPR(...) __VA_ARGS__
-#define CFG_FACTOR 0
-#define USE_FACTOR(...)
-#define CFG_FALLOCATE 0
-#define USE_FALLOCATE(...)
-#define CFG_FALSE 0
-#define USE_FALSE(...)
-#define CFG_FDISK 0
-#define USE_FDISK(...)
-#define CFG_FGREP 0
-#define USE_FGREP(...)
-#define CFG_FILE 0
-#define USE_FILE(...)
-#define CFG_FIND 1
-#define USE_FIND(...) __VA_ARGS__
-#define CFG_FLOCK 0
-#define USE_FLOCK(...)
-#define CFG_FMT 0
-#define USE_FMT(...)
-#define CFG_FOLD 0
-#define USE_FOLD(...)
-#define CFG_FREE 0
-#define USE_FREE(...)
-#define CFG_FREERAMDISK 0
-#define USE_FREERAMDISK(...)
-#define CFG_FSCK 0
-#define USE_FSCK(...)
-#define CFG_FSFREEZE 0
-#define USE_FSFREEZE(...)
-#define CFG_FSTYPE 0
-#define USE_FSTYPE(...)
-#define CFG_FSYNC 0
-#define USE_FSYNC(...)
-#define CFG_FTPGET 0
-#define USE_FTPGET(...)
-#define CFG_FTPPUT 0
-#define USE_FTPPUT(...)
-#define CFG_GETCONF 1
-#define USE_GETCONF(...) __VA_ARGS__
-#define CFG_GETENFORCE 0
-#define USE_GETENFORCE(...)
-#define CFG_GETFATTR 0
-#define USE_GETFATTR(...)
-#define CFG_GETTY 0
-#define USE_GETTY(...)
-#define CFG_GREP 1
-#define USE_GREP(...) __VA_ARGS__
-#define CFG_GROUPADD 0
-#define USE_GROUPADD(...)
-#define CFG_GROUPDEL 0
-#define USE_GROUPDEL(...)
-#define CFG_GROUPS 0
-#define USE_GROUPS(...)
-#define CFG_GUNZIP 0
-#define USE_GUNZIP(...)
-#define CFG_GZIP 0
-#define USE_GZIP(...)
-#define CFG_HEAD 1
-#define USE_HEAD(...) __VA_ARGS__
-#define CFG_HELLO 0
-#define USE_HELLO(...)
-#define CFG_HELP_EXTRAS 0
-#define USE_HELP_EXTRAS(...)
-#define CFG_HELP 0
-#define USE_HELP(...)
-#define CFG_HEXEDIT 0
-#define USE_HEXEDIT(...)
-#define CFG_HOSTID 0
-#define USE_HOSTID(...)
-#define CFG_HOST 0
-#define USE_HOST(...)
-#define CFG_HOSTNAME 1
-#define USE_HOSTNAME(...) __VA_ARGS__
-#define CFG_HWCLOCK 0
-#define USE_HWCLOCK(...)
-#define CFG_I2CDETECT 0
-#define USE_I2CDETECT(...)
-#define CFG_I2CDUMP 0
-#define USE_I2CDUMP(...)
-#define CFG_I2CGET 0
-#define USE_I2CGET(...)
-#define CFG_I2CSET 0
-#define USE_I2CSET(...)
-#define CFG_ICONV 0
-#define USE_ICONV(...)
-#define CFG_ID 1
-#define USE_ID(...) __VA_ARGS__
-#define CFG_ID_Z 0
-#define USE_ID_Z(...)
-#define CFG_IFCONFIG 0
-#define USE_IFCONFIG(...)
-#define CFG_INIT 0
-#define USE_INIT(...)
-#define CFG_INOTIFYD 0
-#define USE_INOTIFYD(...)
-#define CFG_INSMOD 0
-#define USE_INSMOD(...)
-#define CFG_INSTALL 0
-#define USE_INSTALL(...)
-#define CFG_IONICE 0
-#define USE_IONICE(...)
-#define CFG_IORENICE 0
-#define USE_IORENICE(...)
-#define CFG_IOTOP 0
-#define USE_IOTOP(...)
-#define CFG_IPCRM 0
-#define USE_IPCRM(...)
-#define CFG_IPCS 0
-#define USE_IPCS(...)
-#define CFG_IP 0
-#define USE_IP(...)
-#define CFG_KILLALL5 0
-#define USE_KILLALL5(...)
-#define CFG_KILLALL 0
-#define USE_KILLALL(...)
-#define CFG_KILL 0
-#define USE_KILL(...)
-#define CFG_KLOGD 0
-#define USE_KLOGD(...)
-#define CFG_KLOGD_SOURCE_RING_BUFFER 0
-#define USE_KLOGD_SOURCE_RING_BUFFER(...)
-#define CFG_LAST 0
-#define USE_LAST(...)
-#define CFG_LINK 0
-#define USE_LINK(...)
-#define CFG_LN 1
-#define USE_LN(...) __VA_ARGS__
-#define CFG_LOAD_POLICY 0
-#define USE_LOAD_POLICY(...)
-#define CFG_LOGGER 0
-#define USE_LOGGER(...)
-#define CFG_LOGIN 0
-#define USE_LOGIN(...)
-#define CFG_LOG 0
-#define USE_LOG(...)
-#define CFG_LOGNAME 0
-#define USE_LOGNAME(...)
-#define CFG_LOGWRAPPER 0
-#define USE_LOGWRAPPER(...)
-#define CFG_LOSETUP 0
-#define USE_LOSETUP(...)
-#define CFG_LSATTR 0
-#define USE_LSATTR(...)
-#define CFG_LSMOD 0
-#define USE_LSMOD(...)
-#define CFG_LSOF 0
-#define USE_LSOF(...)
-#define CFG_LSPCI 0
-#define USE_LSPCI(...)
-#define CFG_LSPCI_TEXT 0
-#define USE_LSPCI_TEXT(...)
-#define CFG_LSUSB 0
-#define USE_LSUSB(...)
-#define CFG_LS 1
-#define USE_LS(...) __VA_ARGS__
-#define CFG_MAKEDEVS 0
-#define USE_MAKEDEVS(...)
-#define CFG_MAN 0
-#define USE_MAN(...)
-#define CFG_MCOOKIE 0
-#define USE_MCOOKIE(...)
-#define CFG_MD5SUM 1
-#define USE_MD5SUM(...) __VA_ARGS__
-#define CFG_MDEV_CONF 0
-#define USE_MDEV_CONF(...)
-#define CFG_MDEV 0
-#define USE_MDEV(...)
-#define CFG_MICROCOM 1
-#define USE_MICROCOM(...) __VA_ARGS__
-#define CFG_MIX 0
-#define USE_MIX(...)
-#define CFG_MKDIR 1
-#define USE_MKDIR(...) __VA_ARGS__
-#define CFG_MKDIR_Z 0
-#define USE_MKDIR_Z(...)
-#define CFG_MKE2FS_EXTENDED 0
-#define USE_MKE2FS_EXTENDED(...)
-#define CFG_MKE2FS_GEN 0
-#define USE_MKE2FS_GEN(...)
-#define CFG_MKE2FS 0
-#define USE_MKE2FS(...)
-#define CFG_MKE2FS_JOURNAL 0
-#define USE_MKE2FS_JOURNAL(...)
-#define CFG_MKE2FS_LABEL 0
-#define USE_MKE2FS_LABEL(...)
-#define CFG_MKFIFO 0
-#define USE_MKFIFO(...)
-#define CFG_MKFIFO_Z 0
-#define USE_MKFIFO_Z(...)
-#define CFG_MKNOD 0
-#define USE_MKNOD(...)
-#define CFG_MKNOD_Z 0
-#define USE_MKNOD_Z(...)
-#define CFG_MKPASSWD 0
-#define USE_MKPASSWD(...)
-#define CFG_MKSWAP 0
-#define USE_MKSWAP(...)
-#define CFG_MKTEMP 1
-#define USE_MKTEMP(...) __VA_ARGS__
-#define CFG_MODINFO 0
-#define USE_MODINFO(...)
-#define CFG_MODPROBE 0
-#define USE_MODPROBE(...)
-#define CFG_MORE 0
-#define USE_MORE(...)
-#define CFG_MOUNT 0
-#define USE_MOUNT(...)
-#define CFG_MOUNTPOINT 0
-#define USE_MOUNTPOINT(...)
-#define CFG_MV 1
-#define USE_MV(...) __VA_ARGS__
-#define CFG_NBD_CLIENT 0
-#define USE_NBD_CLIENT(...)
-#define CFG_NETCAT 0
-#define USE_NETCAT(...)
-#define CFG_NETCAT_LISTEN 0
-#define USE_NETCAT_LISTEN(...)
-#define CFG_NETSTAT 0
-#define USE_NETSTAT(...)
-#define CFG_NICE 0
-#define USE_NICE(...)
-#define CFG_NL 0
-#define USE_NL(...)
-#define CFG_NOHUP 0
-#define USE_NOHUP(...)
-#define CFG_NPROC 1
-#define USE_NPROC(...) __VA_ARGS__
-#define CFG_NSENTER 0
-#define USE_NSENTER(...)
-#define CFG_OD 1
-#define USE_OD(...) __VA_ARGS__
-#define CFG_ONEIT 0
-#define USE_ONEIT(...)
-#define CFG_OPENVT 0
-#define USE_OPENVT(...)
-#define CFG_PARTPROBE 0
-#define USE_PARTPROBE(...)
-#define CFG_PASSWD 0
-#define USE_PASSWD(...)
-#define CFG_PASSWD_SAD 0
-#define USE_PASSWD_SAD(...)
-#define CFG_PASTE 1
-#define USE_PASTE(...) __VA_ARGS__
-#define CFG_PATCH 1
-#define USE_PATCH(...) __VA_ARGS__
-#define CFG_PGREP 1
-#define USE_PGREP(...) __VA_ARGS__
-#define CFG_PIDOF 0
-#define USE_PIDOF(...)
-#define CFG_PING 0
-#define USE_PING(...)
-#define CFG_PIVOT_ROOT 0
-#define USE_PIVOT_ROOT(...)
-#define CFG_PKILL 1
-#define USE_PKILL(...) __VA_ARGS__
-#define CFG_PMAP 0
-#define USE_PMAP(...)
-#define CFG_PRINTENV 0
-#define USE_PRINTENV(...)
-#define CFG_PRINTF 0
-#define USE_PRINTF(...)
-#define CFG_PS 1
-#define USE_PS(...) __VA_ARGS__
-#define CFG_PWDX 0
-#define USE_PWDX(...)
-#define CFG_PWD 1
-#define USE_PWD(...) __VA_ARGS__
-#define CFG_READAHEAD 0
-#define USE_READAHEAD(...)
-#define CFG_READLINK 1
-#define USE_READLINK(...) __VA_ARGS__
-#define CFG_REALPATH 1
-#define USE_REALPATH(...) __VA_ARGS__
-#define CFG_REBOOT 0
-#define USE_REBOOT(...)
-#define CFG_RENICE 0
-#define USE_RENICE(...)
-#define CFG_RESET 0
-#define USE_RESET(...)
-#define CFG_RESTORECON 0
-#define USE_RESTORECON(...)
-#define CFG_REV 0
-#define USE_REV(...)
-#define CFG_RFKILL 0
-#define USE_RFKILL(...)
-#define CFG_RMDIR 1
-#define USE_RMDIR(...) __VA_ARGS__
-#define CFG_RMMOD 0
-#define USE_RMMOD(...)
-#define CFG_RM 1
-#define USE_RM(...) __VA_ARGS__
-#define CFG_ROUTE 0
-#define USE_ROUTE(...)
-#define CFG_RUNCON 0
-#define USE_RUNCON(...)
-#define CFG_SED 1
-#define USE_SED(...) __VA_ARGS__
-#define CFG_SENDEVENT 0
-#define USE_SENDEVENT(...)
-#define CFG_SEQ 1
-#define USE_SEQ(...) __VA_ARGS__
-#define CFG_SETENFORCE 0
-#define USE_SETENFORCE(...)
-#define CFG_SETFATTR 0
-#define USE_SETFATTR(...)
-#define CFG_SETSID 1
-#define USE_SETSID(...) __VA_ARGS__
-#define CFG_SHA1SUM 1
-#define USE_SHA1SUM(...) __VA_ARGS__
-#define CFG_SHA224SUM 0
-#define USE_SHA224SUM(...)
-#define CFG_SHA256SUM 1
-#define USE_SHA256SUM(...) __VA_ARGS__
-#define CFG_SHA384SUM 0
-#define USE_SHA384SUM(...)
-#define CFG_SHA512SUM 1
-#define USE_SHA512SUM(...) __VA_ARGS__
-#define CFG_SH 0
-#define USE_SH(...)
-#define CFG_SHRED 0
-#define USE_SHRED(...)
-#define CFG_SKELETON_ALIAS 0
-#define USE_SKELETON_ALIAS(...)
-#define CFG_SKELETON 0
-#define USE_SKELETON(...)
-#define CFG_SLEEP 1
-#define USE_SLEEP(...) __VA_ARGS__
-#define CFG_SNTP 0
-#define USE_SNTP(...)
-#define CFG_SORT_FLOAT 1
-#define USE_SORT_FLOAT(...) __VA_ARGS__
-#define CFG_SORT 1
-#define USE_SORT(...) __VA_ARGS__
-#define CFG_SPLIT 0
-#define USE_SPLIT(...)
-#define CFG_STAT 1
-#define USE_STAT(...) __VA_ARGS__
-#define CFG_STRINGS 0
-#define USE_STRINGS(...)
-#define CFG_STTY 0
-#define USE_STTY(...)
-#define CFG_SU 0
-#define USE_SU(...)
-#define CFG_SULOGIN 0
-#define USE_SULOGIN(...)
-#define CFG_SWAPOFF 0
-#define USE_SWAPOFF(...)
-#define CFG_SWAPON 0
-#define USE_SWAPON(...)
-#define CFG_SWITCH_ROOT 0
-#define USE_SWITCH_ROOT(...)
-#define CFG_SYNC 0
-#define USE_SYNC(...)
-#define CFG_SYSCTL 0
-#define USE_SYSCTL(...)
-#define CFG_SYSLOGD 0
-#define USE_SYSLOGD(...)
-#define CFG_TAC 0
-#define USE_TAC(...)
-#define CFG_TAIL 1
-#define USE_TAIL(...) __VA_ARGS__
-#define CFG_TAR 1
-#define USE_TAR(...) __VA_ARGS__
-#define CFG_TASKSET 0
-#define USE_TASKSET(...)
-#define CFG_TCPSVD 0
-#define USE_TCPSVD(...)
-#define CFG_TEE 1
-#define USE_TEE(...) __VA_ARGS__
-#define CFG_TELNETD 0
-#define USE_TELNETD(...)
-#define CFG_TELNET 0
-#define USE_TELNET(...)
-#define CFG_TEST 0
-#define USE_TEST(...)
-#define CFG_TFTPD 0
-#define USE_TFTPD(...)
-#define CFG_TFTP 0
-#define USE_TFTP(...)
-#define CFG_TIME 0
-#define USE_TIME(...)
-#define CFG_TIMEOUT 1
-#define USE_TIMEOUT(...) __VA_ARGS__
-#define CFG_TOP 0
-#define USE_TOP(...)
-#define CFG_TOUCH 1
-#define USE_TOUCH(...) __VA_ARGS__
-#define CFG_TRACEROUTE 0
-#define USE_TRACEROUTE(...)
-#define CFG_TRUE 1
-#define USE_TRUE(...) __VA_ARGS__
-#define CFG_TRUNCATE 1
-#define USE_TRUNCATE(...) __VA_ARGS__
-#define CFG_TR 1
-#define USE_TR(...) __VA_ARGS__
-#define CFG_TTY 0
-#define USE_TTY(...)
-#define CFG_TUNCTL 0
-#define USE_TUNCTL(...)
-#define CFG_ULIMIT 0
-#define USE_ULIMIT(...)
-#define CFG_UMOUNT 0
-#define USE_UMOUNT(...)
-#define CFG_UNAME 1
-#define USE_UNAME(...) __VA_ARGS__
-#define CFG_UNIQ 1
-#define USE_UNIQ(...) __VA_ARGS__
-#define CFG_UNIX2DOS 1
-#define USE_UNIX2DOS(...) __VA_ARGS__
-#define CFG_UNLINK 0
-#define USE_UNLINK(...)
-#define CFG_UNSHARE 0
-#define USE_UNSHARE(...)
-#define CFG_UPTIME 0
-#define USE_UPTIME(...)
-#define CFG_USERADD 0
-#define USE_USERADD(...)
-#define CFG_USERDEL 0
-#define USE_USERDEL(...)
-#define CFG_USLEEP 0
-#define USE_USLEEP(...)
-#define CFG_UUDECODE 0
-#define USE_UUDECODE(...)
-#define CFG_UUENCODE 0
-#define USE_UUENCODE(...)
-#define CFG_UUIDGEN 0
-#define USE_UUIDGEN(...)
-#define CFG_VCONFIG 0
-#define USE_VCONFIG(...)
-#define CFG_VI 0
-#define USE_VI(...)
-#define CFG_VMSTAT 0
-#define USE_VMSTAT(...)
-#define CFG_WATCH 0
-#define USE_WATCH(...)
-#define CFG_WC 1
-#define USE_WC(...) __VA_ARGS__
-#define CFG_WGET 0
-#define USE_WGET(...)
-#define CFG_WHICH 1
-#define USE_WHICH(...) __VA_ARGS__
-#define CFG_WHOAMI 1
-#define USE_WHOAMI(...) __VA_ARGS__
-#define CFG_WHO 0
-#define USE_WHO(...)
-#define CFG_W 0
-#define USE_W(...)
-#define CFG_XARGS_PEDANTIC 0
-#define USE_XARGS_PEDANTIC(...)
-#define CFG_XARGS 1
-#define USE_XARGS(...) __VA_ARGS__
-#define CFG_XXD 1
-#define USE_XXD(...) __VA_ARGS__
-#define CFG_XZCAT 0
-#define USE_XZCAT(...)
-#define CFG_YES 0
-#define USE_YES(...)
-#define CFG_ZCAT 0
-#define USE_ZCAT(...)
diff --git a/android/linux/generated/flags.h b/android/linux/generated/flags.h
deleted file mode 100644
index 7331009a..00000000
--- a/android/linux/generated/flags.h
+++ /dev/null
@@ -1,6200 +0,0 @@
-#undef FORCED_FLAG
-#undef FORCED_FLAGLL
-#ifdef FORCE_FLAGS
-#define FORCED_FLAG 1
-#define FORCED_FLAGLL 1LL
-#else
-#define FORCED_FLAG 0
-#define FORCED_FLAGLL 0
-#endif
-
-// acpi abctV
-#undef OPTSTR_acpi
-#define OPTSTR_acpi "abctV"
-#ifdef CLEANUP_acpi
-#undef CLEANUP_acpi
-#undef FOR_acpi
-#undef FLAG_V
-#undef FLAG_t
-#undef FLAG_c
-#undef FLAG_b
-#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]"
-#ifdef CLEANUP_arp
-#undef CLEANUP_arp
-#undef FOR_arp
-#undef FLAG_H
-#undef FLAG_A
-#undef FLAG_p
-#undef FLAG_a
-#undef FLAG_d
-#undef FLAG_s
-#undef FLAG_D
-#undef FLAG_n
-#undef FLAG_i
-#undef FLAG_v
-#endif
-
-// arping <1>1s:I:w#<0c#<0AUDbqf[+AU][+Df]
-#undef OPTSTR_arping
-#define OPTSTR_arping "<1>1s:I:w#<0c#<0AUDbqf[+AU][+Df]"
-#ifdef CLEANUP_arping
-#undef CLEANUP_arping
-#undef FOR_arping
-#undef FLAG_f
-#undef FLAG_q
-#undef FLAG_b
-#undef FLAG_D
-#undef FLAG_U
-#undef FLAG_A
-#undef FLAG_c
-#undef FLAG_w
-#undef FLAG_I
-#undef FLAG_s
-#endif
-
-// ascii
-#undef OPTSTR_ascii
-#define OPTSTR_ascii 0
-#ifdef CLEANUP_ascii
-#undef CLEANUP_ascii
-#undef FOR_ascii
-#endif
-
-// base64 diw#<0=76[!dw]
-#undef OPTSTR_base64
-#define OPTSTR_base64 "diw#<0=76[!dw]"
-#ifdef CLEANUP_base64
-#undef CLEANUP_base64
-#undef FOR_base64
-#undef FLAG_w
-#undef FLAG_i
-#undef FLAG_d
-#endif
-
-// basename ^<1as: ^<1as:
-#undef OPTSTR_basename
-#define OPTSTR_basename "^<1as:"
-#ifdef CLEANUP_basename
-#undef CLEANUP_basename
-#undef FOR_basename
-#undef FLAG_s
-#undef FLAG_a
-#endif
-
-// bc i(interactive)l(mathlib)q(quiet)s(standard)w(warn) i(interactive)l(mathlib)q(quiet)s(standard)w(warn)
-#undef OPTSTR_bc
-#define OPTSTR_bc "i(interactive)l(mathlib)q(quiet)s(standard)w(warn)"
-#ifdef CLEANUP_bc
-#undef CLEANUP_bc
-#undef FOR_bc
-#undef FLAG_w
-#undef FLAG_s
-#undef FLAG_q
-#undef FLAG_l
-#undef FLAG_i
-#endif
-
-// blkid ULs*[!LU]
-#undef OPTSTR_blkid
-#define OPTSTR_blkid "ULs*[!LU]"
-#ifdef CLEANUP_blkid
-#undef CLEANUP_blkid
-#undef FOR_blkid
-#undef FLAG_s
-#undef FLAG_L
-#undef FLAG_U
-#endif
-
-// blockdev <1>1(setro)(setrw)(getro)(getss)(getbsz)(setbsz)#<0(getsz)(getsize)(getsize64)(getra)(setra)#<0(flushbufs)(rereadpt)
-#undef OPTSTR_blockdev
-#define OPTSTR_blockdev "<1>1(setro)(setrw)(getro)(getss)(getbsz)(setbsz)#<0(getsz)(getsize)(getsize64)(getra)(setra)#<0(flushbufs)(rereadpt)"
-#ifdef CLEANUP_blockdev
-#undef CLEANUP_blockdev
-#undef FOR_blockdev
-#undef FLAG_rereadpt
-#undef FLAG_flushbufs
-#undef FLAG_setra
-#undef FLAG_getra
-#undef FLAG_getsize64
-#undef FLAG_getsize
-#undef FLAG_getsz
-#undef FLAG_setbsz
-#undef FLAG_getbsz
-#undef FLAG_getss
-#undef FLAG_getro
-#undef FLAG_setrw
-#undef FLAG_setro
-#endif
-
-// bootchartd
-#undef OPTSTR_bootchartd
-#define OPTSTR_bootchartd 0
-#ifdef CLEANUP_bootchartd
-#undef CLEANUP_bootchartd
-#undef FOR_bootchartd
-#endif
-
-// brctl <1
-#undef OPTSTR_brctl
-#define OPTSTR_brctl "<1"
-#ifdef CLEANUP_brctl
-#undef CLEANUP_brctl
-#undef FOR_brctl
-#endif
-
-// bunzip2 cftkv
-#undef OPTSTR_bunzip2
-#define OPTSTR_bunzip2 "cftkv"
-#ifdef CLEANUP_bunzip2
-#undef CLEANUP_bunzip2
-#undef FOR_bunzip2
-#undef FLAG_v
-#undef FLAG_k
-#undef FLAG_t
-#undef FLAG_f
-#undef FLAG_c
-#endif
-
-// bzcat
-#undef OPTSTR_bzcat
-#define OPTSTR_bzcat 0
-#ifdef CLEANUP_bzcat
-#undef CLEANUP_bzcat
-#undef FOR_bzcat
-#endif
-
-// cal >2
-#undef OPTSTR_cal
-#define OPTSTR_cal ">2"
-#ifdef CLEANUP_cal
-#undef CLEANUP_cal
-#undef FOR_cal
-#endif
-
-// cat uvte uvte
-#undef OPTSTR_cat
-#define OPTSTR_cat "uvte"
-#ifdef CLEANUP_cat
-#undef CLEANUP_cat
-#undef FOR_cat
-#undef FLAG_e
-#undef FLAG_t
-#undef FLAG_v
-#undef FLAG_u
-#endif
-
-// catv vte
-#undef OPTSTR_catv
-#define OPTSTR_catv "vte"
-#ifdef CLEANUP_catv
-#undef CLEANUP_catv
-#undef FOR_catv
-#undef FLAG_e
-#undef FLAG_t
-#undef FLAG_v
-#endif
-
-// cd
-#undef OPTSTR_cd
-#define OPTSTR_cd 0
-#ifdef CLEANUP_cd
-#undef CLEANUP_cd
-#undef FOR_cd
-#endif
-
-// chattr
-#undef OPTSTR_chattr
-#define OPTSTR_chattr 0
-#ifdef CLEANUP_chattr
-#undef CLEANUP_chattr
-#undef FOR_chattr
-#endif
-
-// chcon <2hvR
-#undef OPTSTR_chcon
-#define OPTSTR_chcon "<2hvR"
-#ifdef CLEANUP_chcon
-#undef CLEANUP_chcon
-#undef FOR_chcon
-#undef FLAG_R
-#undef FLAG_v
-#undef FLAG_h
-#endif
-
-// chgrp <2hPLHRfv[-HLP]
-#undef OPTSTR_chgrp
-#define OPTSTR_chgrp "<2hPLHRfv[-HLP]"
-#ifdef CLEANUP_chgrp
-#undef CLEANUP_chgrp
-#undef FOR_chgrp
-#undef FLAG_v
-#undef FLAG_f
-#undef FLAG_R
-#undef FLAG_H
-#undef FLAG_L
-#undef FLAG_P
-#undef FLAG_h
-#endif
-
-// chmod <2?vRf[-vf] <2?vRf[-vf]
-#undef OPTSTR_chmod
-#define OPTSTR_chmod "<2?vRf[-vf]"
-#ifdef CLEANUP_chmod
-#undef CLEANUP_chmod
-#undef FOR_chmod
-#undef FLAG_f
-#undef FLAG_R
-#undef FLAG_v
-#endif
-
-// chroot ^<1
-#undef OPTSTR_chroot
-#define OPTSTR_chroot "^<1"
-#ifdef CLEANUP_chroot
-#undef CLEANUP_chroot
-#undef FOR_chroot
-#endif
-
-// chrt ^mp#<0iRbrfo[!ibrfo]
-#undef OPTSTR_chrt
-#define OPTSTR_chrt "^mp#<0iRbrfo[!ibrfo]"
-#ifdef CLEANUP_chrt
-#undef CLEANUP_chrt
-#undef FOR_chrt
-#undef FLAG_o
-#undef FLAG_f
-#undef FLAG_r
-#undef FLAG_b
-#undef FLAG_R
-#undef FLAG_i
-#undef FLAG_p
-#undef FLAG_m
-#endif
-
-// chvt <1
-#undef OPTSTR_chvt
-#define OPTSTR_chvt "<1"
-#ifdef CLEANUP_chvt
-#undef CLEANUP_chvt
-#undef FOR_chvt
-#endif
-
-// cksum HIPLN
-#undef OPTSTR_cksum
-#define OPTSTR_cksum "HIPLN"
-#ifdef CLEANUP_cksum
-#undef CLEANUP_cksum
-#undef FOR_cksum
-#undef FLAG_N
-#undef FLAG_L
-#undef FLAG_P
-#undef FLAG_I
-#undef FLAG_H
-#endif
-
-// clear
-#undef OPTSTR_clear
-#define OPTSTR_clear 0
-#ifdef CLEANUP_clear
-#undef CLEANUP_clear
-#undef FOR_clear
-#endif
-
-// cmp <1>2ls(silent)(quiet)[!ls] <1>2ls(silent)(quiet)[!ls]
-#undef OPTSTR_cmp
-#define OPTSTR_cmp "<1>2ls(silent)(quiet)[!ls]"
-#ifdef CLEANUP_cmp
-#undef CLEANUP_cmp
-#undef FOR_cmp
-#undef FLAG_s
-#undef FLAG_l
-#endif
-
-// comm <2>2321 <2>2321
-#undef OPTSTR_comm
-#define OPTSTR_comm "<2>2321"
-#ifdef CLEANUP_comm
-#undef CLEANUP_comm
-#undef FOR_comm
-#undef FLAG_1
-#undef FLAG_2
-#undef FLAG_3
-#endif
-
-// count
-#undef OPTSTR_count
-#define OPTSTR_count 0
-#ifdef CLEANUP_count
-#undef CLEANUP_count
-#undef FOR_count
-#endif
-
-// cp <2(preserve):;D(parents)RHLPprdaslvnF(remove-destination)fi[-HLPd][-ni] <2(preserve):;D(parents)RHLPprdaslvnF(remove-destination)fi[-HLPd][-ni]
-#undef OPTSTR_cp
-#define OPTSTR_cp "<2(preserve):;D(parents)RHLPprdaslvnF(remove-destination)fi[-HLPd][-ni]"
-#ifdef CLEANUP_cp
-#undef CLEANUP_cp
-#undef FOR_cp
-#undef FLAG_i
-#undef FLAG_f
-#undef FLAG_F
-#undef FLAG_n
-#undef FLAG_v
-#undef FLAG_l
-#undef FLAG_s
-#undef FLAG_a
-#undef FLAG_d
-#undef FLAG_r
-#undef FLAG_p
-#undef FLAG_P
-#undef FLAG_L
-#undef FLAG_H
-#undef FLAG_R
-#undef FLAG_D
-#undef FLAG_preserve
-#endif
-
-// cpio (no-preserve-owner)(trailer)mduH:p:|i|t|F:v(verbose)o|[!pio][!pot][!pF]
-#undef OPTSTR_cpio
-#define OPTSTR_cpio "(no-preserve-owner)(trailer)mduH:p:|i|t|F:v(verbose)o|[!pio][!pot][!pF]"
-#ifdef CLEANUP_cpio
-#undef CLEANUP_cpio
-#undef FOR_cpio
-#undef FLAG_o
-#undef FLAG_v
-#undef FLAG_F
-#undef FLAG_t
-#undef FLAG_i
-#undef FLAG_p
-#undef FLAG_H
-#undef FLAG_u
-#undef FLAG_d
-#undef FLAG_m
-#undef FLAG_trailer
-#undef FLAG_no_preserve_owner
-#endif
-
-// crc32
-#undef OPTSTR_crc32
-#define OPTSTR_crc32 0
-#ifdef CLEANUP_crc32
-#undef CLEANUP_crc32
-#undef FOR_crc32
-#endif
-
-// crond fbSl#<0=8d#<0L:c:[-bf][-LS][-ld]
-#undef OPTSTR_crond
-#define OPTSTR_crond "fbSl#<0=8d#<0L:c:[-bf][-LS][-ld]"
-#ifdef CLEANUP_crond
-#undef CLEANUP_crond
-#undef FOR_crond
-#undef FLAG_c
-#undef FLAG_L
-#undef FLAG_d
-#undef FLAG_l
-#undef FLAG_S
-#undef FLAG_b
-#undef FLAG_f
-#endif
-
-// crontab c:u:elr[!elr]
-#undef OPTSTR_crontab
-#define OPTSTR_crontab "c:u:elr[!elr]"
-#ifdef CLEANUP_crontab
-#undef CLEANUP_crontab
-#undef FOR_crontab
-#undef FLAG_r
-#undef FLAG_l
-#undef FLAG_e
-#undef FLAG_u
-#undef FLAG_c
-#endif
-
-// cut b*|c*|f*|F*|C*|O(output-delimiter):d:sDn[!cbf] b*|c*|f*|F*|C*|O(output-delimiter):d:sDn[!cbf]
-#undef OPTSTR_cut
-#define OPTSTR_cut "b*|c*|f*|F*|C*|O(output-delimiter):d:sDn[!cbf]"
-#ifdef CLEANUP_cut
-#undef CLEANUP_cut
-#undef FOR_cut
-#undef FLAG_n
-#undef FLAG_D
-#undef FLAG_s
-#undef FLAG_d
-#undef FLAG_O
-#undef FLAG_C
-#undef FLAG_F
-#undef FLAG_f
-#undef FLAG_c
-#undef FLAG_b
-#endif
-
-// date d:D:r:u[!dr] d:D:r:u[!dr]
-#undef OPTSTR_date
-#define OPTSTR_date "d:D:r:u[!dr]"
-#ifdef CLEANUP_date
-#undef CLEANUP_date
-#undef FOR_date
-#undef FLAG_u
-#undef FLAG_r
-#undef FLAG_D
-#undef FLAG_d
-#endif
-
-// dd
-#undef OPTSTR_dd
-#define OPTSTR_dd 0
-#ifdef CLEANUP_dd
-#undef CLEANUP_dd
-#undef FOR_dd
-#endif
-
-// deallocvt >1
-#undef OPTSTR_deallocvt
-#define OPTSTR_deallocvt ">1"
-#ifdef CLEANUP_deallocvt
-#undef CLEANUP_deallocvt
-#undef FOR_deallocvt
-#endif
-
-// demo_many_options ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba
-#undef OPTSTR_demo_many_options
-#define OPTSTR_demo_many_options "ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba"
-#ifdef CLEANUP_demo_many_options
-#undef CLEANUP_demo_many_options
-#undef FOR_demo_many_options
-#undef FLAG_a
-#undef FLAG_b
-#undef FLAG_c
-#undef FLAG_d
-#undef FLAG_e
-#undef FLAG_f
-#undef FLAG_g
-#undef FLAG_h
-#undef FLAG_i
-#undef FLAG_j
-#undef FLAG_k
-#undef FLAG_l
-#undef FLAG_m
-#undef FLAG_n
-#undef FLAG_o
-#undef FLAG_p
-#undef FLAG_q
-#undef FLAG_r
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_u
-#undef FLAG_v
-#undef FLAG_w
-#undef FLAG_x
-#undef FLAG_y
-#undef FLAG_z
-#undef FLAG_A
-#undef FLAG_B
-#undef FLAG_C
-#undef FLAG_D
-#undef FLAG_E
-#undef FLAG_F
-#undef FLAG_G
-#undef FLAG_H
-#undef FLAG_I
-#undef FLAG_J
-#undef FLAG_K
-#undef FLAG_L
-#undef FLAG_M
-#undef FLAG_N
-#undef FLAG_O
-#undef FLAG_P
-#undef FLAG_Q
-#undef FLAG_R
-#undef FLAG_S
-#undef FLAG_T
-#undef FLAG_U
-#undef FLAG_V
-#undef FLAG_W
-#undef FLAG_X
-#undef FLAG_Y
-#undef FLAG_Z
-#endif
-
-// demo_number D#=3<3hdbs
-#undef OPTSTR_demo_number
-#define OPTSTR_demo_number "D#=3<3hdbs"
-#ifdef CLEANUP_demo_number
-#undef CLEANUP_demo_number
-#undef FOR_demo_number
-#undef FLAG_s
-#undef FLAG_b
-#undef FLAG_d
-#undef FLAG_h
-#undef FLAG_D
-#endif
-
-// demo_scankey
-#undef OPTSTR_demo_scankey
-#define OPTSTR_demo_scankey 0
-#ifdef CLEANUP_demo_scankey
-#undef CLEANUP_demo_scankey
-#undef FOR_demo_scankey
-#endif
-
-// demo_utf8towc
-#undef OPTSTR_demo_utf8towc
-#define OPTSTR_demo_utf8towc 0
-#ifdef CLEANUP_demo_utf8towc
-#undef CLEANUP_demo_utf8towc
-#undef FOR_demo_utf8towc
-#endif
-
-// devmem <1>3
-#undef OPTSTR_devmem
-#define OPTSTR_devmem "<1>3"
-#ifdef CLEANUP_devmem
-#undef CLEANUP_devmem
-#undef FOR_devmem
-#endif
-
-// df HPkhit*a[-HPkh]
-#undef OPTSTR_df
-#define OPTSTR_df "HPkhit*a[-HPkh]"
-#ifdef CLEANUP_df
-#undef CLEANUP_df
-#undef FOR_df
-#undef FLAG_a
-#undef FLAG_t
-#undef FLAG_i
-#undef FLAG_h
-#undef FLAG_k
-#undef FLAG_P
-#undef FLAG_H
-#endif
-
-// dhcp V:H:F:x*r:O*A#<0=20T#<0=3t#<0=3s:p:i:SBRCaovqnbf
-#undef OPTSTR_dhcp
-#define OPTSTR_dhcp "V:H:F:x*r:O*A#<0=20T#<0=3t#<0=3s:p:i:SBRCaovqnbf"
-#ifdef CLEANUP_dhcp
-#undef CLEANUP_dhcp
-#undef FOR_dhcp
-#undef FLAG_f
-#undef FLAG_b
-#undef FLAG_n
-#undef FLAG_q
-#undef FLAG_v
-#undef FLAG_o
-#undef FLAG_a
-#undef FLAG_C
-#undef FLAG_R
-#undef FLAG_B
-#undef FLAG_S
-#undef FLAG_i
-#undef FLAG_p
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_T
-#undef FLAG_A
-#undef FLAG_O
-#undef FLAG_r
-#undef FLAG_x
-#undef FLAG_F
-#undef FLAG_H
-#undef FLAG_V
-#endif
-
-// dhcp6 r:A#<0T#<0t#<0s:p:i:SRvqnbf
-#undef OPTSTR_dhcp6
-#define OPTSTR_dhcp6 "r:A#<0T#<0t#<0s:p:i:SRvqnbf"
-#ifdef CLEANUP_dhcp6
-#undef CLEANUP_dhcp6
-#undef FOR_dhcp6
-#undef FLAG_f
-#undef FLAG_b
-#undef FLAG_n
-#undef FLAG_q
-#undef FLAG_v
-#undef FLAG_R
-#undef FLAG_S
-#undef FLAG_i
-#undef FLAG_p
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_T
-#undef FLAG_A
-#undef FLAG_r
-#endif
-
-// dhcpd >1P#<0>65535fi:S46[!46]
-#undef OPTSTR_dhcpd
-#define OPTSTR_dhcpd ">1P#<0>65535fi:S46[!46]"
-#ifdef CLEANUP_dhcpd
-#undef CLEANUP_dhcpd
-#undef FOR_dhcpd
-#undef FLAG_6
-#undef FLAG_4
-#undef FLAG_S
-#undef FLAG_i
-#undef FLAG_f
-#undef FLAG_P
-#endif
-
-// 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 <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
-#undef OPTSTR_diff
-#define OPTSTR_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"
-#ifdef CLEANUP_diff
-#undef CLEANUP_diff
-#undef FOR_diff
-#undef FLAG_U
-#undef FLAG_r
-#undef FLAG_N
-#undef FLAG_S
-#undef FLAG_L
-#undef FLAG_a
-#undef FLAG_q
-#undef FLAG_s
-#undef FLAG_T
-#undef FLAG_i
-#undef FLAG_w
-#undef FLAG_t
-#undef FLAG_u
-#undef FLAG_b
-#undef FLAG_d
-#undef FLAG_B
-#undef FLAG_strip_trailing_cr
-#undef FLAG_color
-#endif
-
-// dirname <1 <1
-#undef OPTSTR_dirname
-#define OPTSTR_dirname "<1"
-#ifdef CLEANUP_dirname
-#undef CLEANUP_dirname
-#undef FOR_dirname
-#endif
-
-// dmesg w(follow)CSTtrs#<1n#c[!Ttr][!Cc][!Sw]
-#undef OPTSTR_dmesg
-#define OPTSTR_dmesg "w(follow)CSTtrs#<1n#c[!Ttr][!Cc][!Sw]"
-#ifdef CLEANUP_dmesg
-#undef CLEANUP_dmesg
-#undef FOR_dmesg
-#undef FLAG_c
-#undef FLAG_n
-#undef FLAG_s
-#undef FLAG_r
-#undef FLAG_t
-#undef FLAG_T
-#undef FLAG_S
-#undef FLAG_C
-#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
-#ifdef CLEANUP_dos2unix
-#undef CLEANUP_dos2unix
-#undef FOR_dos2unix
-#endif
-
-// du d#<0=-1hmlcaHkKLsx[-HL][-kKmh] d#<0=-1hmlcaHkKLsx[-HL][-kKmh]
-#undef OPTSTR_du
-#define OPTSTR_du "d#<0=-1hmlcaHkKLsx[-HL][-kKmh]"
-#ifdef CLEANUP_du
-#undef CLEANUP_du
-#undef FOR_du
-#undef FLAG_x
-#undef FLAG_s
-#undef FLAG_L
-#undef FLAG_K
-#undef FLAG_k
-#undef FLAG_H
-#undef FLAG_a
-#undef FLAG_c
-#undef FLAG_l
-#undef FLAG_m
-#undef FLAG_h
-#undef FLAG_d
-#endif
-
-// dumpleases >0arf:[!ar]
-#undef OPTSTR_dumpleases
-#define OPTSTR_dumpleases ">0arf:[!ar]"
-#ifdef CLEANUP_dumpleases
-#undef CLEANUP_dumpleases
-#undef FOR_dumpleases
-#undef FLAG_f
-#undef FLAG_r
-#undef FLAG_a
-#endif
-
-// echo ^?Een[-eE] ^?Een[-eE]
-#undef OPTSTR_echo
-#define OPTSTR_echo "^?Een[-eE]"
-#ifdef CLEANUP_echo
-#undef CLEANUP_echo
-#undef FOR_echo
-#undef FLAG_n
-#undef FLAG_e
-#undef FLAG_E
-#endif
-
-// eject >1stT[!tT]
-#undef OPTSTR_eject
-#define OPTSTR_eject ">1stT[!tT]"
-#ifdef CLEANUP_eject
-#undef CLEANUP_eject
-#undef FOR_eject
-#undef FLAG_T
-#undef FLAG_t
-#undef FLAG_s
-#endif
-
-// env ^0iu* ^0iu*
-#undef OPTSTR_env
-#define OPTSTR_env "^0iu*"
-#ifdef CLEANUP_env
-#undef CLEANUP_env
-#undef FOR_env
-#undef FLAG_u
-#undef FLAG_i
-#undef FLAG_0
-#endif
-
-// exit
-#undef OPTSTR_exit
-#define OPTSTR_exit 0
-#ifdef CLEANUP_exit
-#undef CLEANUP_exit
-#undef FOR_exit
-#endif
-
-// expand t*
-#undef OPTSTR_expand
-#define OPTSTR_expand "t*"
-#ifdef CLEANUP_expand
-#undef CLEANUP_expand
-#undef FOR_expand
-#undef FLAG_t
-#endif
-
-// expr
-#undef OPTSTR_expr
-#define OPTSTR_expr 0
-#ifdef CLEANUP_expr
-#undef CLEANUP_expr
-#undef FOR_expr
-#endif
-
-// factor
-#undef OPTSTR_factor
-#define OPTSTR_factor 0
-#ifdef CLEANUP_factor
-#undef CLEANUP_factor
-#undef FOR_factor
-#endif
-
-// fallocate >1l#|o#
-#undef OPTSTR_fallocate
-#define OPTSTR_fallocate ">1l#|o#"
-#ifdef CLEANUP_fallocate
-#undef CLEANUP_fallocate
-#undef FOR_fallocate
-#undef FLAG_o
-#undef FLAG_l
-#endif
-
-// false
-#undef OPTSTR_false
-#define OPTSTR_false 0
-#ifdef CLEANUP_false
-#undef CLEANUP_false
-#undef FOR_false
-#endif
-
-// fdisk C#<0H#<0S#<0b#<512ul
-#undef OPTSTR_fdisk
-#define OPTSTR_fdisk "C#<0H#<0S#<0b#<512ul"
-#ifdef CLEANUP_fdisk
-#undef CLEANUP_fdisk
-#undef FOR_fdisk
-#undef FLAG_l
-#undef FLAG_u
-#undef FLAG_b
-#undef FLAG_S
-#undef FLAG_H
-#undef FLAG_C
-#endif
-
-// file <1bhLs[!hL]
-#undef OPTSTR_file
-#define OPTSTR_file "<1bhLs[!hL]"
-#ifdef CLEANUP_file
-#undef CLEANUP_file
-#undef FOR_file
-#undef FLAG_s
-#undef FLAG_L
-#undef FLAG_h
-#undef FLAG_b
-#endif
-
-// find ?^HL[-HL] ?^HL[-HL]
-#undef OPTSTR_find
-#define OPTSTR_find "?^HL[-HL]"
-#ifdef CLEANUP_find
-#undef CLEANUP_find
-#undef FOR_find
-#undef FLAG_L
-#undef FLAG_H
-#endif
-
-// flock <1>1nsux[-sux]
-#undef OPTSTR_flock
-#define OPTSTR_flock "<1>1nsux[-sux]"
-#ifdef CLEANUP_flock
-#undef CLEANUP_flock
-#undef FOR_flock
-#undef FLAG_x
-#undef FLAG_u
-#undef FLAG_s
-#undef FLAG_n
-#endif
-
-// fmt w#<0=75
-#undef OPTSTR_fmt
-#define OPTSTR_fmt "w#<0=75"
-#ifdef CLEANUP_fmt
-#undef CLEANUP_fmt
-#undef FOR_fmt
-#undef FLAG_w
-#endif
-
-// fold bsuw#<1
-#undef OPTSTR_fold
-#define OPTSTR_fold "bsuw#<1"
-#ifdef CLEANUP_fold
-#undef CLEANUP_fold
-#undef FOR_fold
-#undef FLAG_w
-#undef FLAG_u
-#undef FLAG_s
-#undef FLAG_b
-#endif
-
-// free htgmkb[!htgmkb]
-#undef OPTSTR_free
-#define OPTSTR_free "htgmkb[!htgmkb]"
-#ifdef CLEANUP_free
-#undef CLEANUP_free
-#undef FOR_free
-#undef FLAG_b
-#undef FLAG_k
-#undef FLAG_m
-#undef FLAG_g
-#undef FLAG_t
-#undef FLAG_h
-#endif
-
-// freeramdisk <1>1
-#undef OPTSTR_freeramdisk
-#define OPTSTR_freeramdisk "<1>1"
-#ifdef CLEANUP_freeramdisk
-#undef CLEANUP_freeramdisk
-#undef FOR_freeramdisk
-#endif
-
-// fsck ?t:ANPRTVsC#
-#undef OPTSTR_fsck
-#define OPTSTR_fsck "?t:ANPRTVsC#"
-#ifdef CLEANUP_fsck
-#undef CLEANUP_fsck
-#undef FOR_fsck
-#undef FLAG_C
-#undef FLAG_s
-#undef FLAG_V
-#undef FLAG_T
-#undef FLAG_R
-#undef FLAG_P
-#undef FLAG_N
-#undef FLAG_A
-#undef FLAG_t
-#endif
-
-// fsfreeze <1>1f|u|[!fu]
-#undef OPTSTR_fsfreeze
-#define OPTSTR_fsfreeze "<1>1f|u|[!fu]"
-#ifdef CLEANUP_fsfreeze
-#undef CLEANUP_fsfreeze
-#undef FOR_fsfreeze
-#undef FLAG_u
-#undef FLAG_f
-#endif
-
-// fstype <1
-#undef OPTSTR_fstype
-#define OPTSTR_fstype "<1"
-#ifdef CLEANUP_fstype
-#undef CLEANUP_fstype
-#undef FOR_fstype
-#endif
-
-// fsync <1d
-#undef OPTSTR_fsync
-#define OPTSTR_fsync "<1d"
-#ifdef CLEANUP_fsync
-#undef CLEANUP_fsync
-#undef FOR_fsync
-#undef FLAG_d
-#endif
-
-// ftpget <2>3P:cp:u:vgslLmMdD[-gs][!gslLmMdD][!clL]
-#undef OPTSTR_ftpget
-#define OPTSTR_ftpget "<2>3P:cp:u:vgslLmMdD[-gs][!gslLmMdD][!clL]"
-#ifdef CLEANUP_ftpget
-#undef CLEANUP_ftpget
-#undef FOR_ftpget
-#undef FLAG_D
-#undef FLAG_d
-#undef FLAG_M
-#undef FLAG_m
-#undef FLAG_L
-#undef FLAG_l
-#undef FLAG_s
-#undef FLAG_g
-#undef FLAG_v
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_c
-#undef FLAG_P
-#endif
-
-// getconf >2al >2al
-#undef OPTSTR_getconf
-#define OPTSTR_getconf ">2al"
-#ifdef CLEANUP_getconf
-#undef CLEANUP_getconf
-#undef FOR_getconf
-#undef FLAG_l
-#undef FLAG_a
-#endif
-
-// getenforce >0
-#undef OPTSTR_getenforce
-#define OPTSTR_getenforce ">0"
-#ifdef CLEANUP_getenforce
-#undef CLEANUP_getenforce
-#undef FOR_getenforce
-#endif
-
-// getfattr (only-values)dhn:
-#undef OPTSTR_getfattr
-#define OPTSTR_getfattr "(only-values)dhn:"
-#ifdef CLEANUP_getfattr
-#undef CLEANUP_getfattr
-#undef FOR_getfattr
-#undef FLAG_n
-#undef FLAG_h
-#undef FLAG_d
-#undef FLAG_only_values
-#endif
-
-// getty <2t#<0H:I:l:f:iwnmLh
-#undef OPTSTR_getty
-#define OPTSTR_getty "<2t#<0H:I:l:f:iwnmLh"
-#ifdef CLEANUP_getty
-#undef CLEANUP_getty
-#undef FOR_getty
-#undef FLAG_h
-#undef FLAG_L
-#undef FLAG_m
-#undef FLAG_n
-#undef FLAG_w
-#undef FLAG_i
-#undef FLAG_f
-#undef FLAG_l
-#undef FLAG_I
-#undef FLAG_H
-#undef FLAG_t
-#endif
-
-// grep (line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw] (line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]
-#undef OPTSTR_grep
-#define OPTSTR_grep "(line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]"
-#ifdef CLEANUP_grep
-#undef CLEANUP_grep
-#undef FOR_grep
-#undef FLAG_x
-#undef FLAG_m
-#undef FLAG_A
-#undef FLAG_B
-#undef FLAG_C
-#undef FLAG_f
-#undef FLAG_e
-#undef FLAG_q
-#undef FLAG_l
-#undef FLAG_c
-#undef FLAG_w
-#undef FLAG_v
-#undef FLAG_s
-#undef FLAG_R
-#undef FLAG_r
-#undef FLAG_o
-#undef FLAG_n
-#undef FLAG_i
-#undef FLAG_h
-#undef FLAG_b
-#undef FLAG_a
-#undef FLAG_I
-#undef FLAG_H
-#undef FLAG_F
-#undef FLAG_E
-#undef FLAG_z
-#undef FLAG_Z
-#undef FLAG_M
-#undef FLAG_S
-#undef FLAG_exclude_dir
-#undef FLAG_color
-#undef FLAG_line_buffered
-#endif
-
-// groupadd <1>2g#<0S
-#undef OPTSTR_groupadd
-#define OPTSTR_groupadd "<1>2g#<0S"
-#ifdef CLEANUP_groupadd
-#undef CLEANUP_groupadd
-#undef FOR_groupadd
-#undef FLAG_S
-#undef FLAG_g
-#endif
-
-// groupdel <1>2
-#undef OPTSTR_groupdel
-#define OPTSTR_groupdel "<1>2"
-#ifdef CLEANUP_groupdel
-#undef CLEANUP_groupdel
-#undef FOR_groupdel
-#endif
-
-// groups
-#undef OPTSTR_groups
-#define OPTSTR_groups 0
-#ifdef CLEANUP_groups
-#undef CLEANUP_groups
-#undef FOR_groups
-#endif
-
-// gunzip cdfk123456789[-123456789]
-#undef OPTSTR_gunzip
-#define OPTSTR_gunzip "cdfk123456789[-123456789]"
-#ifdef CLEANUP_gunzip
-#undef CLEANUP_gunzip
-#undef FOR_gunzip
-#undef FLAG_9
-#undef FLAG_8
-#undef FLAG_7
-#undef FLAG_6
-#undef FLAG_5
-#undef FLAG_4
-#undef FLAG_3
-#undef FLAG_2
-#undef FLAG_1
-#undef FLAG_k
-#undef FLAG_f
-#undef FLAG_d
-#undef FLAG_c
-#endif
-
-// gzip ncdfk123456789[-123456789]
-#undef OPTSTR_gzip
-#define OPTSTR_gzip "ncdfk123456789[-123456789]"
-#ifdef CLEANUP_gzip
-#undef CLEANUP_gzip
-#undef FOR_gzip
-#undef FLAG_9
-#undef FLAG_8
-#undef FLAG_7
-#undef FLAG_6
-#undef FLAG_5
-#undef FLAG_4
-#undef FLAG_3
-#undef FLAG_2
-#undef FLAG_1
-#undef FLAG_k
-#undef FLAG_f
-#undef FLAG_d
-#undef FLAG_c
-#undef FLAG_n
-#endif
-
-// head ?n(lines)#<0=10c(bytes)#<0qv[-nc] ?n(lines)#<0=10c(bytes)#<0qv[-nc]
-#undef OPTSTR_head
-#define OPTSTR_head "?n(lines)#<0=10c(bytes)#<0qv[-nc]"
-#ifdef CLEANUP_head
-#undef CLEANUP_head
-#undef FOR_head
-#undef FLAG_v
-#undef FLAG_q
-#undef FLAG_c
-#undef FLAG_n
-#endif
-
-// hello
-#undef OPTSTR_hello
-#define OPTSTR_hello 0
-#ifdef CLEANUP_hello
-#undef CLEANUP_hello
-#undef FOR_hello
-#endif
-
-// help ah
-#undef OPTSTR_help
-#define OPTSTR_help "ah"
-#ifdef CLEANUP_help
-#undef CLEANUP_help
-#undef FOR_help
-#undef FLAG_h
-#undef FLAG_a
-#endif
-
-// hexedit <1>1r
-#undef OPTSTR_hexedit
-#define OPTSTR_hexedit "<1>1r"
-#ifdef CLEANUP_hexedit
-#undef CLEANUP_hexedit
-#undef FOR_hexedit
-#undef FLAG_r
-#endif
-
-// host <1>2avt:
-#undef OPTSTR_host
-#define OPTSTR_host "<1>2avt:"
-#ifdef CLEANUP_host
-#undef CLEANUP_host
-#undef FOR_host
-#undef FLAG_t
-#undef FLAG_v
-#undef FLAG_a
-#endif
-
-// hostid >0
-#undef OPTSTR_hostid
-#define OPTSTR_hostid ">0"
-#ifdef CLEANUP_hostid
-#undef CLEANUP_hostid
-#undef FOR_hostid
-#endif
-
-// hostname >1bdsfF:[!bdsf] >1bdsfF:[!bdsf]
-#undef OPTSTR_hostname
-#define OPTSTR_hostname ">1bdsfF:[!bdsf]"
-#ifdef CLEANUP_hostname
-#undef CLEANUP_hostname
-#undef FOR_hostname
-#undef FLAG_F
-#undef FLAG_f
-#undef FLAG_s
-#undef FLAG_d
-#undef FLAG_b
-#endif
-
-// hwclock >0(fast)f(rtc):u(utc)l(localtime)t(systz)s(hctosys)r(show)w(systohc)[-ul][!rtsw]
-#undef OPTSTR_hwclock
-#define OPTSTR_hwclock ">0(fast)f(rtc):u(utc)l(localtime)t(systz)s(hctosys)r(show)w(systohc)[-ul][!rtsw]"
-#ifdef CLEANUP_hwclock
-#undef CLEANUP_hwclock
-#undef FOR_hwclock
-#undef FLAG_w
-#undef FLAG_r
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_l
-#undef FLAG_u
-#undef FLAG_f
-#undef FLAG_fast
-#endif
-
-// i2cdetect >3aFly
-#undef OPTSTR_i2cdetect
-#define OPTSTR_i2cdetect ">3aFly"
-#ifdef CLEANUP_i2cdetect
-#undef CLEANUP_i2cdetect
-#undef FOR_i2cdetect
-#undef FLAG_y
-#undef FLAG_l
-#undef FLAG_F
-#undef FLAG_a
-#endif
-
-// i2cdump <2>2fy
-#undef OPTSTR_i2cdump
-#define OPTSTR_i2cdump "<2>2fy"
-#ifdef CLEANUP_i2cdump
-#undef CLEANUP_i2cdump
-#undef FOR_i2cdump
-#undef FLAG_y
-#undef FLAG_f
-#endif
-
-// i2cget <3>3fy
-#undef OPTSTR_i2cget
-#define OPTSTR_i2cget "<3>3fy"
-#ifdef CLEANUP_i2cget
-#undef CLEANUP_i2cget
-#undef FOR_i2cget
-#undef FLAG_y
-#undef FLAG_f
-#endif
-
-// i2cset <4fy
-#undef OPTSTR_i2cset
-#define OPTSTR_i2cset "<4fy"
-#ifdef CLEANUP_i2cset
-#undef CLEANUP_i2cset
-#undef FOR_i2cset
-#undef FLAG_y
-#undef FLAG_f
-#endif
-
-// iconv cst:f:
-#undef OPTSTR_iconv
-#define OPTSTR_iconv "cst:f:"
-#ifdef CLEANUP_iconv
-#undef CLEANUP_iconv
-#undef FOR_iconv
-#undef FLAG_f
-#undef FLAG_t
-#undef FLAG_s
-#undef FLAG_c
-#endif
-
-// id >1nGgru[!Ggu] >1ZnGgru[!ZGgu]
-#undef OPTSTR_id
-#define OPTSTR_id ">1nGgru[!Ggu]"
-#ifdef CLEANUP_id
-#undef CLEANUP_id
-#undef FOR_id
-#undef FLAG_u
-#undef FLAG_r
-#undef FLAG_g
-#undef FLAG_G
-#undef FLAG_n
-#undef FLAG_Z
-#endif
-
-// ifconfig ^?aS
-#undef OPTSTR_ifconfig
-#define OPTSTR_ifconfig "^?aS"
-#ifdef CLEANUP_ifconfig
-#undef CLEANUP_ifconfig
-#undef FOR_ifconfig
-#undef FLAG_S
-#undef FLAG_a
-#endif
-
-// init
-#undef OPTSTR_init
-#define OPTSTR_init 0
-#ifdef CLEANUP_init
-#undef CLEANUP_init
-#undef FOR_init
-#endif
-
-// inotifyd <2
-#undef OPTSTR_inotifyd
-#define OPTSTR_inotifyd "<2"
-#ifdef CLEANUP_inotifyd
-#undef CLEANUP_inotifyd
-#undef FOR_inotifyd
-#endif
-
-// insmod <1
-#undef OPTSTR_insmod
-#define OPTSTR_insmod "<1"
-#ifdef CLEANUP_insmod
-#undef CLEANUP_insmod
-#undef FOR_insmod
-#endif
-
-// install <1cdDpsvm:o:g:
-#undef OPTSTR_install
-#define OPTSTR_install "<1cdDpsvm:o:g:"
-#ifdef CLEANUP_install
-#undef CLEANUP_install
-#undef FOR_install
-#undef FLAG_g
-#undef FLAG_o
-#undef FLAG_m
-#undef FLAG_v
-#undef FLAG_s
-#undef FLAG_p
-#undef FLAG_D
-#undef FLAG_d
-#undef FLAG_c
-#endif
-
-// ionice ^tc#<0>3=2n#<0>7=5p#
-#undef OPTSTR_ionice
-#define OPTSTR_ionice "^tc#<0>3=2n#<0>7=5p#"
-#ifdef CLEANUP_ionice
-#undef CLEANUP_ionice
-#undef FOR_ionice
-#undef FLAG_p
-#undef FLAG_n
-#undef FLAG_c
-#undef FLAG_t
-#endif
-
-// iorenice ?<1>3
-#undef OPTSTR_iorenice
-#define OPTSTR_iorenice "?<1>3"
-#ifdef CLEANUP_iorenice
-#undef CLEANUP_iorenice
-#undef FOR_iorenice
-#endif
-
-// iotop >0AaKOHk*o*p*u*s#<1=7d%<100=3000m#n#<1bq
-#undef OPTSTR_iotop
-#define OPTSTR_iotop ">0AaKOHk*o*p*u*s#<1=7d%<100=3000m#n#<1bq"
-#ifdef CLEANUP_iotop
-#undef CLEANUP_iotop
-#undef FOR_iotop
-#undef FLAG_q
-#undef FLAG_b
-#undef FLAG_n
-#undef FLAG_m
-#undef FLAG_d
-#undef FLAG_s
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_o
-#undef FLAG_k
-#undef FLAG_H
-#undef FLAG_O
-#undef FLAG_K
-#undef FLAG_a
-#undef FLAG_A
-#endif
-
-// ip
-#undef OPTSTR_ip
-#define OPTSTR_ip 0
-#ifdef CLEANUP_ip
-#undef CLEANUP_ip
-#undef FOR_ip
-#endif
-
-// ipcrm m*M*s*S*q*Q*
-#undef OPTSTR_ipcrm
-#define OPTSTR_ipcrm "m*M*s*S*q*Q*"
-#ifdef CLEANUP_ipcrm
-#undef CLEANUP_ipcrm
-#undef FOR_ipcrm
-#undef FLAG_Q
-#undef FLAG_q
-#undef FLAG_S
-#undef FLAG_s
-#undef FLAG_M
-#undef FLAG_m
-#endif
-
-// ipcs acptulsqmi#
-#undef OPTSTR_ipcs
-#define OPTSTR_ipcs "acptulsqmi#"
-#ifdef CLEANUP_ipcs
-#undef CLEANUP_ipcs
-#undef FOR_ipcs
-#undef FLAG_i
-#undef FLAG_m
-#undef FLAG_q
-#undef FLAG_s
-#undef FLAG_l
-#undef FLAG_u
-#undef FLAG_t
-#undef FLAG_p
-#undef FLAG_c
-#undef FLAG_a
-#endif
-
-// kill ?ls:
-#undef OPTSTR_kill
-#define OPTSTR_kill "?ls: "
-#ifdef CLEANUP_kill
-#undef CLEANUP_kill
-#undef FOR_kill
-#undef FLAG_s
-#undef FLAG_l
-#endif
-
-// killall ?s:ilqvw
-#undef OPTSTR_killall
-#define OPTSTR_killall "?s:ilqvw"
-#ifdef CLEANUP_killall
-#undef CLEANUP_killall
-#undef FOR_killall
-#undef FLAG_w
-#undef FLAG_v
-#undef FLAG_q
-#undef FLAG_l
-#undef FLAG_i
-#undef FLAG_s
-#endif
-
-// killall5 ?o*ls: [!lo][!ls]
-#undef OPTSTR_killall5
-#define OPTSTR_killall5 "?o*ls: [!lo][!ls]"
-#ifdef CLEANUP_killall5
-#undef CLEANUP_killall5
-#undef FOR_killall5
-#undef FLAG_s
-#undef FLAG_l
-#undef FLAG_o
-#endif
-
-// klogd c#<1>8n
-#undef OPTSTR_klogd
-#define OPTSTR_klogd "c#<1>8n"
-#ifdef CLEANUP_klogd
-#undef CLEANUP_klogd
-#undef FOR_klogd
-#undef FLAG_n
-#undef FLAG_c
-#endif
-
-// last f:W
-#undef OPTSTR_last
-#define OPTSTR_last "f:W"
-#ifdef CLEANUP_last
-#undef CLEANUP_last
-#undef FOR_last
-#undef FLAG_W
-#undef FLAG_f
-#endif
-
-// link <2>2
-#undef OPTSTR_link
-#define OPTSTR_link "<2>2"
-#ifdef CLEANUP_link
-#undef CLEANUP_link
-#undef FOR_link
-#endif
-
-// ln <1t:Tvnfs <1t:Tvnfs
-#undef OPTSTR_ln
-#define OPTSTR_ln "<1t:Tvnfs"
-#ifdef CLEANUP_ln
-#undef CLEANUP_ln
-#undef FOR_ln
-#undef FLAG_s
-#undef FLAG_f
-#undef FLAG_n
-#undef FLAG_v
-#undef FLAG_T
-#undef FLAG_t
-#endif
-
-// load_policy <1>1
-#undef OPTSTR_load_policy
-#define OPTSTR_load_policy "<1>1"
-#ifdef CLEANUP_load_policy
-#undef CLEANUP_load_policy
-#undef FOR_load_policy
-#endif
-
-// log <1p:t:
-#undef OPTSTR_log
-#define OPTSTR_log "<1p:t:"
-#ifdef CLEANUP_log
-#undef CLEANUP_log
-#undef FOR_log
-#undef FLAG_t
-#undef FLAG_p
-#endif
-
-// logger st:p:
-#undef OPTSTR_logger
-#define OPTSTR_logger "st:p:"
-#ifdef CLEANUP_logger
-#undef CLEANUP_logger
-#undef FOR_logger
-#undef FLAG_p
-#undef FLAG_t
-#undef FLAG_s
-#endif
-
-// login >1f:ph:
-#undef OPTSTR_login
-#define OPTSTR_login ">1f:ph:"
-#ifdef CLEANUP_login
-#undef CLEANUP_login
-#undef FOR_login
-#undef FLAG_h
-#undef FLAG_p
-#undef FLAG_f
-#endif
-
-// logname >0
-#undef OPTSTR_logname
-#define OPTSTR_logname ">0"
-#ifdef CLEANUP_logname
-#undef CLEANUP_logname
-#undef FOR_logname
-#endif
-
-// logwrapper
-#undef OPTSTR_logwrapper
-#define OPTSTR_logwrapper 0
-#ifdef CLEANUP_logwrapper
-#undef CLEANUP_logwrapper
-#undef FOR_logwrapper
-#endif
-
-// losetup >2S(sizelimit)#s(show)ro#j:fdcaD[!afj]
-#undef OPTSTR_losetup
-#define OPTSTR_losetup ">2S(sizelimit)#s(show)ro#j:fdcaD[!afj]"
-#ifdef CLEANUP_losetup
-#undef CLEANUP_losetup
-#undef FOR_losetup
-#undef FLAG_D
-#undef FLAG_a
-#undef FLAG_c
-#undef FLAG_d
-#undef FLAG_f
-#undef FLAG_j
-#undef FLAG_o
-#undef FLAG_r
-#undef FLAG_s
-#undef FLAG_S
-#endif
-
-// ls (color):;(full-time)(show-control-chars)ZgoACFHLRSabcdfhikl@mnpqrstux1[-Cxm1][-Cxml][-Cxmo][-Cxmg][-cu][-ftS][-HL][!qb] (color):;(full-time)(show-control-chars)ZgoACFHLRSabcdfhikl@mnpqrstux1[-Cxm1][-Cxml][-Cxmo][-Cxmg][-cu][-ftS][-HL][!qb]
-#undef OPTSTR_ls
-#define OPTSTR_ls "(color):;(full-time)(show-control-chars)ZgoACFHLRSabcdfhikl@mnpqrstux1[-Cxm1][-Cxml][-Cxmo][-Cxmg][-cu][-ftS][-HL][!qb]"
-#ifdef CLEANUP_ls
-#undef CLEANUP_ls
-#undef FOR_ls
-#undef FLAG_1
-#undef FLAG_x
-#undef FLAG_u
-#undef FLAG_t
-#undef FLAG_s
-#undef FLAG_r
-#undef FLAG_q
-#undef FLAG_p
-#undef FLAG_n
-#undef FLAG_m
-#undef FLAG_l
-#undef FLAG_k
-#undef FLAG_i
-#undef FLAG_h
-#undef FLAG_f
-#undef FLAG_d
-#undef FLAG_c
-#undef FLAG_b
-#undef FLAG_a
-#undef FLAG_S
-#undef FLAG_R
-#undef FLAG_L
-#undef FLAG_H
-#undef FLAG_F
-#undef FLAG_C
-#undef FLAG_A
-#undef FLAG_o
-#undef FLAG_g
-#undef FLAG_Z
-#undef FLAG_show_control_chars
-#undef FLAG_full_time
-#undef FLAG_color
-#endif
-
-// lsattr vldaR
-#undef OPTSTR_lsattr
-#define OPTSTR_lsattr "vldaR"
-#ifdef CLEANUP_lsattr
-#undef CLEANUP_lsattr
-#undef FOR_lsattr
-#undef FLAG_R
-#undef FLAG_a
-#undef FLAG_d
-#undef FLAG_l
-#undef FLAG_v
-#endif
-
-// lsmod
-#undef OPTSTR_lsmod
-#define OPTSTR_lsmod 0
-#ifdef CLEANUP_lsmod
-#undef CLEANUP_lsmod
-#undef FOR_lsmod
-#endif
-
-// lsof lp*t
-#undef OPTSTR_lsof
-#define OPTSTR_lsof "lp*t"
-#ifdef CLEANUP_lsof
-#undef CLEANUP_lsof
-#undef FOR_lsof
-#undef FLAG_t
-#undef FLAG_p
-#undef FLAG_l
-#endif
-
-// lspci emkn@i:
-#undef OPTSTR_lspci
-#define OPTSTR_lspci "emkn@i:"
-#ifdef CLEANUP_lspci
-#undef CLEANUP_lspci
-#undef FOR_lspci
-#undef FLAG_i
-#undef FLAG_n
-#undef FLAG_k
-#undef FLAG_m
-#undef FLAG_e
-#endif
-
-// lsusb
-#undef OPTSTR_lsusb
-#define OPTSTR_lsusb 0
-#ifdef CLEANUP_lsusb
-#undef CLEANUP_lsusb
-#undef FOR_lsusb
-#endif
-
-// makedevs <1>1d:
-#undef OPTSTR_makedevs
-#define OPTSTR_makedevs "<1>1d:"
-#ifdef CLEANUP_makedevs
-#undef CLEANUP_makedevs
-#undef FOR_makedevs
-#undef FLAG_d
-#endif
-
-// man k:M:
-#undef OPTSTR_man
-#define OPTSTR_man "k:M:"
-#ifdef CLEANUP_man
-#undef CLEANUP_man
-#undef FOR_man
-#undef FLAG_M
-#undef FLAG_k
-#endif
-
-// mcookie v(verbose)V(version)
-#undef OPTSTR_mcookie
-#define OPTSTR_mcookie "v(verbose)V(version)"
-#ifdef CLEANUP_mcookie
-#undef CLEANUP_mcookie
-#undef FOR_mcookie
-#undef FLAG_V
-#undef FLAG_v
-#endif
-
-// md5sum bc(check)s(status)[!bc] bc(check)s(status)[!bc]
-#undef OPTSTR_md5sum
-#define OPTSTR_md5sum "bc(check)s(status)[!bc]"
-#ifdef CLEANUP_md5sum
-#undef CLEANUP_md5sum
-#undef FOR_md5sum
-#undef FLAG_s
-#undef FLAG_c
-#undef FLAG_b
-#endif
-
-// mdev s
-#undef OPTSTR_mdev
-#define OPTSTR_mdev "s"
-#ifdef CLEANUP_mdev
-#undef CLEANUP_mdev
-#undef FOR_mdev
-#undef FLAG_s
-#endif
-
-// microcom <1>1s:X <1>1s:X
-#undef OPTSTR_microcom
-#define OPTSTR_microcom "<1>1s:X"
-#ifdef CLEANUP_microcom
-#undef CLEANUP_microcom
-#undef FOR_microcom
-#undef FLAG_X
-#undef FLAG_s
-#endif
-
-// mix c:d:l#r#
-#undef OPTSTR_mix
-#define OPTSTR_mix "c:d:l#r#"
-#ifdef CLEANUP_mix
-#undef CLEANUP_mix
-#undef FOR_mix
-#undef FLAG_r
-#undef FLAG_l
-#undef FLAG_d
-#undef FLAG_c
-#endif
-
-// mkdir <1vp(parent)(parents)m: <1Z:vp(parent)(parents)m:
-#undef OPTSTR_mkdir
-#define OPTSTR_mkdir "<1vp(parent)(parents)m:"
-#ifdef CLEANUP_mkdir
-#undef CLEANUP_mkdir
-#undef FOR_mkdir
-#undef FLAG_m
-#undef FLAG_p
-#undef FLAG_v
-#undef FLAG_Z
-#endif
-
-// mke2fs <1>2g:Fnqm#N#i#b#
-#undef OPTSTR_mke2fs
-#define OPTSTR_mke2fs "<1>2g:Fnqm#N#i#b#"
-#ifdef CLEANUP_mke2fs
-#undef CLEANUP_mke2fs
-#undef FOR_mke2fs
-#undef FLAG_b
-#undef FLAG_i
-#undef FLAG_N
-#undef FLAG_m
-#undef FLAG_q
-#undef FLAG_n
-#undef FLAG_F
-#undef FLAG_g
-#endif
-
-// mkfifo <1Z:m:
-#undef OPTSTR_mkfifo
-#define OPTSTR_mkfifo "<1Z:m:"
-#ifdef CLEANUP_mkfifo
-#undef CLEANUP_mkfifo
-#undef FOR_mkfifo
-#undef FLAG_m
-#undef FLAG_Z
-#endif
-
-// mknod <2>4m(mode):Z:
-#undef OPTSTR_mknod
-#define OPTSTR_mknod "<2>4m(mode):Z:"
-#ifdef CLEANUP_mknod
-#undef CLEANUP_mknod
-#undef FOR_mknod
-#undef FLAG_Z
-#undef FLAG_m
-#endif
-
-// mkpasswd >2S:m:P#=0<0
-#undef OPTSTR_mkpasswd
-#define OPTSTR_mkpasswd ">2S:m:P#=0<0"
-#ifdef CLEANUP_mkpasswd
-#undef CLEANUP_mkpasswd
-#undef FOR_mkpasswd
-#undef FLAG_P
-#undef FLAG_m
-#undef FLAG_S
-#endif
-
-// mkswap <1>1L:
-#undef OPTSTR_mkswap
-#define OPTSTR_mkswap "<1>1L:"
-#ifdef CLEANUP_mkswap
-#undef CLEANUP_mkswap
-#undef FOR_mkswap
-#undef FLAG_L
-#endif
-
-// mktemp >1(tmpdir);:uqd(directory)p:t >1(tmpdir);:uqd(directory)p:t
-#undef OPTSTR_mktemp
-#define OPTSTR_mktemp ">1(tmpdir);:uqd(directory)p:t"
-#ifdef CLEANUP_mktemp
-#undef CLEANUP_mktemp
-#undef FOR_mktemp
-#undef FLAG_t
-#undef FLAG_p
-#undef FLAG_d
-#undef FLAG_q
-#undef FLAG_u
-#undef FLAG_tmpdir
-#endif
-
-// modinfo <1b:k:F:0
-#undef OPTSTR_modinfo
-#define OPTSTR_modinfo "<1b:k:F:0"
-#ifdef CLEANUP_modinfo
-#undef CLEANUP_modinfo
-#undef FOR_modinfo
-#undef FLAG_0
-#undef FLAG_F
-#undef FLAG_k
-#undef FLAG_b
-#endif
-
-// modprobe alrqvsDbd*
-#undef OPTSTR_modprobe
-#define OPTSTR_modprobe "alrqvsDbd*"
-#ifdef CLEANUP_modprobe
-#undef CLEANUP_modprobe
-#undef FOR_modprobe
-#undef FLAG_d
-#undef FLAG_b
-#undef FLAG_D
-#undef FLAG_s
-#undef FLAG_v
-#undef FLAG_q
-#undef FLAG_r
-#undef FLAG_l
-#undef FLAG_a
-#endif
-
-// more
-#undef OPTSTR_more
-#define OPTSTR_more 0
-#ifdef CLEANUP_more
-#undef CLEANUP_more
-#undef FOR_more
-#endif
-
-// mount ?O:afnrvwt:o*[-rw]
-#undef OPTSTR_mount
-#define OPTSTR_mount "?O:afnrvwt:o*[-rw]"
-#ifdef CLEANUP_mount
-#undef CLEANUP_mount
-#undef FOR_mount
-#undef FLAG_o
-#undef FLAG_t
-#undef FLAG_w
-#undef FLAG_v
-#undef FLAG_r
-#undef FLAG_n
-#undef FLAG_f
-#undef FLAG_a
-#undef FLAG_O
-#endif
-
-// mountpoint <1qdx[-dx]
-#undef OPTSTR_mountpoint
-#define OPTSTR_mountpoint "<1qdx[-dx]"
-#ifdef CLEANUP_mountpoint
-#undef CLEANUP_mountpoint
-#undef FOR_mountpoint
-#undef FLAG_x
-#undef FLAG_d
-#undef FLAG_q
-#endif
-
-// mv <2vnF(remove-destination)fi[-ni] <2vnF(remove-destination)fi[-ni]
-#undef OPTSTR_mv
-#define OPTSTR_mv "<2vnF(remove-destination)fi[-ni]"
-#ifdef CLEANUP_mv
-#undef CLEANUP_mv
-#undef FOR_mv
-#undef FLAG_i
-#undef FLAG_f
-#undef FLAG_F
-#undef FLAG_n
-#undef FLAG_v
-#endif
-
-// nbd_client <3>3ns
-#undef OPTSTR_nbd_client
-#define OPTSTR_nbd_client "<3>3ns"
-#ifdef CLEANUP_nbd_client
-#undef CLEANUP_nbd_client
-#undef FOR_nbd_client
-#undef FLAG_s
-#undef FLAG_n
-#endif
-
-// netcat ^tlLw#<1W#<1p#<1>65535q#<1s:f:46uU[!tlL][!Lw][!46U]
-#undef OPTSTR_netcat
-#define OPTSTR_netcat "^tlLw#<1W#<1p#<1>65535q#<1s:f:46uU[!tlL][!Lw][!46U]"
-#ifdef CLEANUP_netcat
-#undef CLEANUP_netcat
-#undef FOR_netcat
-#undef FLAG_U
-#undef FLAG_u
-#undef FLAG_6
-#undef FLAG_4
-#undef FLAG_f
-#undef FLAG_s
-#undef FLAG_q
-#undef FLAG_p
-#undef FLAG_W
-#undef FLAG_w
-#undef FLAG_L
-#undef FLAG_l
-#undef FLAG_t
-#endif
-
-// netstat pWrxwutneal
-#undef OPTSTR_netstat
-#define OPTSTR_netstat "pWrxwutneal"
-#ifdef CLEANUP_netstat
-#undef CLEANUP_netstat
-#undef FOR_netstat
-#undef FLAG_l
-#undef FLAG_a
-#undef FLAG_e
-#undef FLAG_n
-#undef FLAG_t
-#undef FLAG_u
-#undef FLAG_w
-#undef FLAG_x
-#undef FLAG_r
-#undef FLAG_W
-#undef FLAG_p
-#endif
-
-// nice ^<1n#
-#undef OPTSTR_nice
-#define OPTSTR_nice "^<1n#"
-#ifdef CLEANUP_nice
-#undef CLEANUP_nice
-#undef FOR_nice
-#undef FLAG_n
-#endif
-
-// nl v#=1l#w#<0=6Eb:n:s:
-#undef OPTSTR_nl
-#define OPTSTR_nl "v#=1l#w#<0=6Eb:n:s:"
-#ifdef CLEANUP_nl
-#undef CLEANUP_nl
-#undef FOR_nl
-#undef FLAG_s
-#undef FLAG_n
-#undef FLAG_b
-#undef FLAG_E
-#undef FLAG_w
-#undef FLAG_l
-#undef FLAG_v
-#endif
-
-// nohup <1^
-#undef OPTSTR_nohup
-#define OPTSTR_nohup "<1^"
-#ifdef CLEANUP_nohup
-#undef CLEANUP_nohup
-#undef FOR_nohup
-#endif
-
-// nproc (all) (all)
-#undef OPTSTR_nproc
-#define OPTSTR_nproc "(all)"
-#ifdef CLEANUP_nproc
-#undef CLEANUP_nproc
-#undef FOR_nproc
-#undef FLAG_all
-#endif
-
-// nsenter <1F(no-fork)t#<1(target)i:(ipc);m:(mount);n:(net);p:(pid);u:(uts);U:(user);
-#undef OPTSTR_nsenter
-#define OPTSTR_nsenter "<1F(no-fork)t#<1(target)i:(ipc);m:(mount);n:(net);p:(pid);u:(uts);U:(user);"
-#ifdef CLEANUP_nsenter
-#undef CLEANUP_nsenter
-#undef FOR_nsenter
-#undef FLAG_U
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_n
-#undef FLAG_m
-#undef FLAG_i
-#undef FLAG_t
-#undef FLAG_F
-#endif
-
-// od j#vw#<1=16N#xsodcbA:t* j#vw#<1=16N#xsodcbA:t*
-#undef OPTSTR_od
-#define OPTSTR_od "j#vw#<1=16N#xsodcbA:t*"
-#ifdef CLEANUP_od
-#undef CLEANUP_od
-#undef FOR_od
-#undef FLAG_t
-#undef FLAG_A
-#undef FLAG_b
-#undef FLAG_c
-#undef FLAG_d
-#undef FLAG_o
-#undef FLAG_s
-#undef FLAG_x
-#undef FLAG_N
-#undef FLAG_w
-#undef FLAG_v
-#undef FLAG_j
-#endif
-
-// oneit ^<1nc:p3[!pn]
-#undef OPTSTR_oneit
-#define OPTSTR_oneit "^<1nc:p3[!pn]"
-#ifdef CLEANUP_oneit
-#undef CLEANUP_oneit
-#undef FOR_oneit
-#undef FLAG_3
-#undef FLAG_p
-#undef FLAG_c
-#undef FLAG_n
-#endif
-
-// openvt c#<1>63sw
-#undef OPTSTR_openvt
-#define OPTSTR_openvt "c#<1>63sw"
-#ifdef CLEANUP_openvt
-#undef CLEANUP_openvt
-#undef FOR_openvt
-#undef FLAG_w
-#undef FLAG_s
-#undef FLAG_c
-#endif
-
-// partprobe <1
-#undef OPTSTR_partprobe
-#define OPTSTR_partprobe "<1"
-#ifdef CLEANUP_partprobe
-#undef CLEANUP_partprobe
-#undef FOR_partprobe
-#endif
-
-// passwd >1a:dlu
-#undef OPTSTR_passwd
-#define OPTSTR_passwd ">1a:dlu"
-#ifdef CLEANUP_passwd
-#undef CLEANUP_passwd
-#undef FOR_passwd
-#undef FLAG_u
-#undef FLAG_l
-#undef FLAG_d
-#undef FLAG_a
-#endif
-
-// paste d:s d:s
-#undef OPTSTR_paste
-#define OPTSTR_paste "d:s"
-#ifdef CLEANUP_paste
-#undef CLEANUP_paste
-#undef FOR_paste
-#undef FLAG_s
-#undef FLAG_d
-#endif
-
-// patch (no-backup-if-mismatch)(dry-run)g#fulp#d:i:Rs(quiet) (no-backup-if-mismatch)(dry-run)xg#fulp#d:i:Rs(quiet)
-#undef OPTSTR_patch
-#define OPTSTR_patch "(no-backup-if-mismatch)(dry-run)g#fulp#d:i:Rs(quiet)"
-#ifdef CLEANUP_patch
-#undef CLEANUP_patch
-#undef FOR_patch
-#undef FLAG_s
-#undef FLAG_R
-#undef FLAG_i
-#undef FLAG_d
-#undef FLAG_p
-#undef FLAG_l
-#undef FLAG_u
-#undef FLAG_f
-#undef FLAG_g
-#undef FLAG_x
-#undef FLAG_dry_run
-#undef FLAG_no_backup_if_mismatch
-#endif
-
-// pgrep ?cld:u*U*t*s*P*g*G*fnovxL:[-no] ?cld:u*U*t*s*P*g*G*fnovxL:[-no]
-#undef OPTSTR_pgrep
-#define OPTSTR_pgrep "?cld:u*U*t*s*P*g*G*fnovxL:[-no]"
-#ifdef CLEANUP_pgrep
-#undef CLEANUP_pgrep
-#undef FOR_pgrep
-#undef FLAG_L
-#undef FLAG_x
-#undef FLAG_v
-#undef FLAG_o
-#undef FLAG_n
-#undef FLAG_f
-#undef FLAG_G
-#undef FLAG_g
-#undef FLAG_P
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_U
-#undef FLAG_u
-#undef FLAG_d
-#undef FLAG_l
-#undef FLAG_c
-#endif
-
-// pidof <1so:x
-#undef OPTSTR_pidof
-#define OPTSTR_pidof "<1so:x"
-#ifdef CLEANUP_pidof
-#undef CLEANUP_pidof
-#undef FOR_pidof
-#undef FLAG_x
-#undef FLAG_o
-#undef FLAG_s
-#endif
-
-// ping <1>1m#t#<0>255=64c#<0=3s#<0>4088=56i%W#<0=3w#<0qf46I:[-46]
-#undef OPTSTR_ping
-#define OPTSTR_ping "<1>1m#t#<0>255=64c#<0=3s#<0>4088=56i%W#<0=3w#<0qf46I:[-46]"
-#ifdef CLEANUP_ping
-#undef CLEANUP_ping
-#undef FOR_ping
-#undef FLAG_I
-#undef FLAG_6
-#undef FLAG_4
-#undef FLAG_f
-#undef FLAG_q
-#undef FLAG_w
-#undef FLAG_W
-#undef FLAG_i
-#undef FLAG_s
-#undef FLAG_c
-#undef FLAG_t
-#undef FLAG_m
-#endif
-
-// pivot_root <2>2
-#undef OPTSTR_pivot_root
-#define OPTSTR_pivot_root "<2>2"
-#ifdef CLEANUP_pivot_root
-#undef CLEANUP_pivot_root
-#undef FOR_pivot_root
-#endif
-
-// pkill ?Vu*U*t*s*P*g*G*fnovxl:[-no] ?Vu*U*t*s*P*g*G*fnovxl:[-no]
-#undef OPTSTR_pkill
-#define OPTSTR_pkill "?Vu*U*t*s*P*g*G*fnovxl:[-no]"
-#ifdef CLEANUP_pkill
-#undef CLEANUP_pkill
-#undef FOR_pkill
-#undef FLAG_l
-#undef FLAG_x
-#undef FLAG_v
-#undef FLAG_o
-#undef FLAG_n
-#undef FLAG_f
-#undef FLAG_G
-#undef FLAG_g
-#undef FLAG_P
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_U
-#undef FLAG_u
-#undef FLAG_V
-#endif
-
-// pmap <1xq
-#undef OPTSTR_pmap
-#define OPTSTR_pmap "<1xq"
-#ifdef CLEANUP_pmap
-#undef CLEANUP_pmap
-#undef FOR_pmap
-#undef FLAG_q
-#undef FLAG_x
-#endif
-
-// printenv 0(null)
-#undef OPTSTR_printenv
-#define OPTSTR_printenv "0(null)"
-#ifdef CLEANUP_printenv
-#undef CLEANUP_printenv
-#undef FOR_printenv
-#undef FLAG_0
-#endif
-
-// printf <1?^
-#undef OPTSTR_printf
-#define OPTSTR_printf "<1?^"
-#ifdef CLEANUP_printf
-#undef CLEANUP_printf
-#undef FOR_printf
-#endif
-
-// ps k(sort)*P(ppid)*aAdeflMno*O*p(pid)*s*t*Tu*U*g*G*wZ[!ol][+Ae][!oO] k(sort)*P(ppid)*aAdeflMno*O*p(pid)*s*t*Tu*U*g*G*wZ[!ol][+Ae][!oO]
-#undef OPTSTR_ps
-#define OPTSTR_ps "k(sort)*P(ppid)*aAdeflMno*O*p(pid)*s*t*Tu*U*g*G*wZ[!ol][+Ae][!oO]"
-#ifdef CLEANUP_ps
-#undef CLEANUP_ps
-#undef FOR_ps
-#undef FLAG_Z
-#undef FLAG_w
-#undef FLAG_G
-#undef FLAG_g
-#undef FLAG_U
-#undef FLAG_u
-#undef FLAG_T
-#undef FLAG_t
-#undef FLAG_s
-#undef FLAG_p
-#undef FLAG_O
-#undef FLAG_o
-#undef FLAG_n
-#undef FLAG_M
-#undef FLAG_l
-#undef FLAG_f
-#undef FLAG_e
-#undef FLAG_d
-#undef FLAG_A
-#undef FLAG_a
-#undef FLAG_P
-#undef FLAG_k
-#endif
-
-// pwd >0LP[-LP] >0LP[-LP]
-#undef OPTSTR_pwd
-#define OPTSTR_pwd ">0LP[-LP]"
-#ifdef CLEANUP_pwd
-#undef CLEANUP_pwd
-#undef FOR_pwd
-#undef FLAG_P
-#undef FLAG_L
-#endif
-
-// pwdx <1a
-#undef OPTSTR_pwdx
-#define OPTSTR_pwdx "<1a"
-#ifdef CLEANUP_pwdx
-#undef CLEANUP_pwdx
-#undef FOR_pwdx
-#undef FLAG_a
-#endif
-
-// readahead
-#undef OPTSTR_readahead
-#define OPTSTR_readahead 0
-#ifdef CLEANUP_readahead
-#undef CLEANUP_readahead
-#undef FOR_readahead
-#endif
-
-// readlink <1nqmef(canonicalize)[-mef] <1nqmef(canonicalize)[-mef]
-#undef OPTSTR_readlink
-#define OPTSTR_readlink "<1nqmef(canonicalize)[-mef]"
-#ifdef CLEANUP_readlink
-#undef CLEANUP_readlink
-#undef FOR_readlink
-#undef FLAG_f
-#undef FLAG_e
-#undef FLAG_m
-#undef FLAG_q
-#undef FLAG_n
-#endif
-
-// realpath <1 <1
-#undef OPTSTR_realpath
-#define OPTSTR_realpath "<1"
-#ifdef CLEANUP_realpath
-#undef CLEANUP_realpath
-#undef FOR_realpath
-#endif
-
-// reboot fn
-#undef OPTSTR_reboot
-#define OPTSTR_reboot "fn"
-#ifdef CLEANUP_reboot
-#undef CLEANUP_reboot
-#undef FOR_reboot
-#undef FLAG_n
-#undef FLAG_f
-#endif
-
-// renice <1gpun#|
-#undef OPTSTR_renice
-#define OPTSTR_renice "<1gpun#|"
-#ifdef CLEANUP_renice
-#undef CLEANUP_renice
-#undef FOR_renice
-#undef FLAG_n
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_g
-#endif
-
-// reset
-#undef OPTSTR_reset
-#define OPTSTR_reset 0
-#ifdef CLEANUP_reset
-#undef CLEANUP_reset
-#undef FOR_reset
-#endif
-
-// restorecon <1DFnRrv
-#undef OPTSTR_restorecon
-#define OPTSTR_restorecon "<1DFnRrv"
-#ifdef CLEANUP_restorecon
-#undef CLEANUP_restorecon
-#undef FOR_restorecon
-#undef FLAG_v
-#undef FLAG_r
-#undef FLAG_R
-#undef FLAG_n
-#undef FLAG_F
-#undef FLAG_D
-#endif
-
-// rev
-#undef OPTSTR_rev
-#define OPTSTR_rev 0
-#ifdef CLEANUP_rev
-#undef CLEANUP_rev
-#undef FOR_rev
-#endif
-
-// rfkill <1>2
-#undef OPTSTR_rfkill
-#define OPTSTR_rfkill "<1>2"
-#ifdef CLEANUP_rfkill
-#undef CLEANUP_rfkill
-#undef FOR_rfkill
-#endif
-
-// rm fiRrv[-fi] fiRrv[-fi]
-#undef OPTSTR_rm
-#define OPTSTR_rm "fiRrv[-fi]"
-#ifdef CLEANUP_rm
-#undef CLEANUP_rm
-#undef FOR_rm
-#undef FLAG_v
-#undef FLAG_r
-#undef FLAG_R
-#undef FLAG_i
-#undef FLAG_f
-#endif
-
-// rmdir <1(ignore-fail-on-non-empty)p <1(ignore-fail-on-non-empty)p
-#undef OPTSTR_rmdir
-#define OPTSTR_rmdir "<1(ignore-fail-on-non-empty)p"
-#ifdef CLEANUP_rmdir
-#undef CLEANUP_rmdir
-#undef FOR_rmdir
-#undef FLAG_p
-#undef FLAG_ignore_fail_on_non_empty
-#endif
-
-// rmmod <1wf
-#undef OPTSTR_rmmod
-#define OPTSTR_rmmod "<1wf"
-#ifdef CLEANUP_rmmod
-#undef CLEANUP_rmmod
-#undef FOR_rmmod
-#undef FLAG_f
-#undef FLAG_w
-#endif
-
-// route ?neA:
-#undef OPTSTR_route
-#define OPTSTR_route "?neA:"
-#ifdef CLEANUP_route
-#undef CLEANUP_route
-#undef FOR_route
-#undef FLAG_A
-#undef FLAG_e
-#undef FLAG_n
-#endif
-
-// runcon <2
-#undef OPTSTR_runcon
-#define OPTSTR_runcon "<2"
-#ifdef CLEANUP_runcon
-#undef CLEANUP_runcon
-#undef FOR_runcon
-#endif
-
-// sed (help)(version)e*f*i:;nErz(null-data)[+Er] (help)(version)e*f*i:;nErz(null-data)[+Er]
-#undef OPTSTR_sed
-#define OPTSTR_sed "(help)(version)e*f*i:;nErz(null-data)[+Er]"
-#ifdef CLEANUP_sed
-#undef CLEANUP_sed
-#undef FOR_sed
-#undef FLAG_z
-#undef FLAG_r
-#undef FLAG_E
-#undef FLAG_n
-#undef FLAG_i
-#undef FLAG_f
-#undef FLAG_e
-#undef FLAG_version
-#undef FLAG_help
-#endif
-
-// sendevent <4>4
-#undef OPTSTR_sendevent
-#define OPTSTR_sendevent "<4>4"
-#ifdef CLEANUP_sendevent
-#undef CLEANUP_sendevent
-#undef FOR_sendevent
-#endif
-
-// seq <1>3?f:s:w[!fw] <1>3?f:s:w[!fw]
-#undef OPTSTR_seq
-#define OPTSTR_seq "<1>3?f:s:w[!fw]"
-#ifdef CLEANUP_seq
-#undef CLEANUP_seq
-#undef FOR_seq
-#undef FLAG_w
-#undef FLAG_s
-#undef FLAG_f
-#endif
-
-// setenforce <1>1
-#undef OPTSTR_setenforce
-#define OPTSTR_setenforce "<1>1"
-#ifdef CLEANUP_setenforce
-#undef CLEANUP_setenforce
-#undef FOR_setenforce
-#endif
-
-// setfattr hn:|v:x:|[!xv]
-#undef OPTSTR_setfattr
-#define OPTSTR_setfattr "hn:|v:x:|[!xv]"
-#ifdef CLEANUP_setfattr
-#undef CLEANUP_setfattr
-#undef FOR_setfattr
-#undef FLAG_x
-#undef FLAG_v
-#undef FLAG_n
-#undef FLAG_h
-#endif
-
-// setsid ^<1t ^<1t
-#undef OPTSTR_setsid
-#define OPTSTR_setsid "^<1t"
-#ifdef CLEANUP_setsid
-#undef CLEANUP_setsid
-#undef FOR_setsid
-#undef FLAG_t
-#endif
-
-// sh c:i
-#undef OPTSTR_sh
-#define OPTSTR_sh "c:i"
-#ifdef CLEANUP_sh
-#undef CLEANUP_sh
-#undef FOR_sh
-#undef FLAG_i
-#undef FLAG_c
-#endif
-
-// sha1sum bc(check)s(status)[!bc] bc(check)s(status)[!bc]
-#undef OPTSTR_sha1sum
-#define OPTSTR_sha1sum "bc(check)s(status)[!bc]"
-#ifdef CLEANUP_sha1sum
-#undef CLEANUP_sha1sum
-#undef FOR_sha1sum
-#undef FLAG_s
-#undef FLAG_c
-#undef FLAG_b
-#endif
-
-// shred <1zxus#<1n#<1o#<0f
-#undef OPTSTR_shred
-#define OPTSTR_shred "<1zxus#<1n#<1o#<0f"
-#ifdef CLEANUP_shred
-#undef CLEANUP_shred
-#undef FOR_shred
-#undef FLAG_f
-#undef FLAG_o
-#undef FLAG_n
-#undef FLAG_s
-#undef FLAG_u
-#undef FLAG_x
-#undef FLAG_z
-#endif
-
-// skeleton (walrus)(blubber):;(also):e@d*c#b:a
-#undef OPTSTR_skeleton
-#define OPTSTR_skeleton "(walrus)(blubber):;(also):e@d*c#b:a"
-#ifdef CLEANUP_skeleton
-#undef CLEANUP_skeleton
-#undef FOR_skeleton
-#undef FLAG_a
-#undef FLAG_b
-#undef FLAG_c
-#undef FLAG_d
-#undef FLAG_e
-#undef FLAG_also
-#undef FLAG_blubber
-#undef FLAG_walrus
-#endif
-
-// skeleton_alias b#dq
-#undef OPTSTR_skeleton_alias
-#define OPTSTR_skeleton_alias "b#dq"
-#ifdef CLEANUP_skeleton_alias
-#undef CLEANUP_skeleton_alias
-#undef FOR_skeleton_alias
-#undef FLAG_q
-#undef FLAG_d
-#undef FLAG_b
-#endif
-
-// sleep <1 <1
-#undef OPTSTR_sleep
-#define OPTSTR_sleep "<1"
-#ifdef CLEANUP_sleep
-#undef CLEANUP_sleep
-#undef FOR_sleep
-#endif
-
-// sntp >1M :m :Sp:t#<0=1>16asdDqr#<4>17=10[!as]
-#undef OPTSTR_sntp
-#define OPTSTR_sntp ">1M :m :Sp:t#<0=1>16asdDqr#<4>17=10[!as]"
-#ifdef CLEANUP_sntp
-#undef CLEANUP_sntp
-#undef FOR_sntp
-#undef FLAG_r
-#undef FLAG_q
-#undef FLAG_D
-#undef FLAG_d
-#undef FLAG_s
-#undef FLAG_a
-#undef FLAG_t
-#undef FLAG_p
-#undef FLAG_S
-#undef FLAG_m
-#undef FLAG_M
-#endif
-
-// sort gS:T:mo:k*t:xVbMcszdfirun gS:T:mo:k*t:xVbMcszdfirun
-#undef OPTSTR_sort
-#define OPTSTR_sort "gS:T:mo:k*t:xVbMcszdfirun"
-#ifdef CLEANUP_sort
-#undef CLEANUP_sort
-#undef FOR_sort
-#undef FLAG_n
-#undef FLAG_u
-#undef FLAG_r
-#undef FLAG_i
-#undef FLAG_f
-#undef FLAG_d
-#undef FLAG_z
-#undef FLAG_s
-#undef FLAG_c
-#undef FLAG_M
-#undef FLAG_b
-#undef FLAG_V
-#undef FLAG_x
-#undef FLAG_t
-#undef FLAG_k
-#undef FLAG_o
-#undef FLAG_m
-#undef FLAG_T
-#undef FLAG_S
-#undef FLAG_g
-#endif
-
-// split >2a#<1=2>9b#<1l#<1[!bl]
-#undef OPTSTR_split
-#define OPTSTR_split ">2a#<1=2>9b#<1l#<1[!bl]"
-#ifdef CLEANUP_split
-#undef CLEANUP_split
-#undef FOR_split
-#undef FLAG_l
-#undef FLAG_b
-#undef FLAG_a
-#endif
-
-// stat <1c:(format)fLt <1c:(format)fLt
-#undef OPTSTR_stat
-#define OPTSTR_stat "<1c:(format)fLt"
-#ifdef CLEANUP_stat
-#undef CLEANUP_stat
-#undef FOR_stat
-#undef FLAG_t
-#undef FLAG_L
-#undef FLAG_f
-#undef FLAG_c
-#endif
-
-// strings t:an#=4<1fo
-#undef OPTSTR_strings
-#define OPTSTR_strings "t:an#=4<1fo"
-#ifdef CLEANUP_strings
-#undef CLEANUP_strings
-#undef FOR_strings
-#undef FLAG_o
-#undef FLAG_f
-#undef FLAG_n
-#undef FLAG_a
-#undef FLAG_t
-#endif
-
-// stty ?aF:g[!ag]
-#undef OPTSTR_stty
-#define OPTSTR_stty "?aF:g[!ag]"
-#ifdef CLEANUP_stty
-#undef CLEANUP_stty
-#undef FOR_stty
-#undef FLAG_g
-#undef FLAG_F
-#undef FLAG_a
-#endif
-
-// su ^lmpu:g:c:s:[!lmp]
-#undef OPTSTR_su
-#define OPTSTR_su "^lmpu:g:c:s:[!lmp]"
-#ifdef CLEANUP_su
-#undef CLEANUP_su
-#undef FOR_su
-#undef FLAG_s
-#undef FLAG_c
-#undef FLAG_g
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_m
-#undef FLAG_l
-#endif
-
-// sulogin t#<0=0
-#undef OPTSTR_sulogin
-#define OPTSTR_sulogin "t#<0=0"
-#ifdef CLEANUP_sulogin
-#undef CLEANUP_sulogin
-#undef FOR_sulogin
-#undef FLAG_t
-#endif
-
-// swapoff <1>1
-#undef OPTSTR_swapoff
-#define OPTSTR_swapoff "<1>1"
-#ifdef CLEANUP_swapoff
-#undef CLEANUP_swapoff
-#undef FOR_swapoff
-#endif
-
-// swapon <1>1p#<0>32767d
-#undef OPTSTR_swapon
-#define OPTSTR_swapon "<1>1p#<0>32767d"
-#ifdef CLEANUP_swapon
-#undef CLEANUP_swapon
-#undef FOR_swapon
-#undef FLAG_d
-#undef FLAG_p
-#endif
-
-// switch_root <2c:h
-#undef OPTSTR_switch_root
-#define OPTSTR_switch_root "<2c:h"
-#ifdef CLEANUP_switch_root
-#undef CLEANUP_switch_root
-#undef FOR_switch_root
-#undef FLAG_h
-#undef FLAG_c
-#endif
-
-// sync
-#undef OPTSTR_sync
-#define OPTSTR_sync 0
-#ifdef CLEANUP_sync
-#undef CLEANUP_sync
-#undef FOR_sync
-#endif
-
-// sysctl ^neNqwpaA[!ap][!aq][!aw][+aA]
-#undef OPTSTR_sysctl
-#define OPTSTR_sysctl "^neNqwpaA[!ap][!aq][!aw][+aA]"
-#ifdef CLEANUP_sysctl
-#undef CLEANUP_sysctl
-#undef FOR_sysctl
-#undef FLAG_A
-#undef FLAG_a
-#undef FLAG_p
-#undef FLAG_w
-#undef FLAG_q
-#undef FLAG_N
-#undef FLAG_e
-#undef FLAG_n
-#endif
-
-// syslogd >0l#<1>8=8R:b#<0>99=1s#<0=200m#<0>71582787=20O:p:f:a:nSKLD
-#undef OPTSTR_syslogd
-#define OPTSTR_syslogd ">0l#<1>8=8R:b#<0>99=1s#<0=200m#<0>71582787=20O:p:f:a:nSKLD"
-#ifdef CLEANUP_syslogd
-#undef CLEANUP_syslogd
-#undef FOR_syslogd
-#undef FLAG_D
-#undef FLAG_L
-#undef FLAG_K
-#undef FLAG_S
-#undef FLAG_n
-#undef FLAG_a
-#undef FLAG_f
-#undef FLAG_p
-#undef FLAG_O
-#undef FLAG_m
-#undef FLAG_s
-#undef FLAG_b
-#undef FLAG_R
-#undef FLAG_l
-#endif
-
-// tac
-#undef OPTSTR_tac
-#define OPTSTR_tac 0
-#ifdef CLEANUP_tac
-#undef CLEANUP_tac
-#undef FOR_tac
-#endif
-
-// tail ?fc-n-[-cn] ?fc-n-[-cn]
-#undef OPTSTR_tail
-#define OPTSTR_tail "?fc-n-[-cn]"
-#ifdef CLEANUP_tail
-#undef CLEANUP_tail
-#undef FOR_tail
-#undef FLAG_n
-#undef FLAG_c
-#undef FLAG_f
-#endif
-
-// tar &(restrict)(full-time)(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(mode):(mtime):(group):(owner):(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):a[!txc][!jzJa] &(restrict)(full-time)(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(mode):(mtime):(group):(owner):(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):a[!txc][!jzJa]
-#undef OPTSTR_tar
-#define OPTSTR_tar "&(restrict)(full-time)(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(mode):(mtime):(group):(owner):(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):a[!txc][!jzJa]"
-#ifdef CLEANUP_tar
-#undef CLEANUP_tar
-#undef FOR_tar
-#undef FLAG_a
-#undef FLAG_f
-#undef FLAG_C
-#undef FLAG_T
-#undef FLAG_X
-#undef FLAG_m
-#undef FLAG_O
-#undef FLAG_S
-#undef FLAG_z
-#undef FLAG_j
-#undef FLAG_J
-#undef FLAG_v
-#undef FLAG_t
-#undef FLAG_x
-#undef FLAG_h
-#undef FLAG_c
-#undef FLAG_k
-#undef FLAG_p
-#undef FLAG_o
-#undef FLAG_to_command
-#undef FLAG_owner
-#undef FLAG_group
-#undef FLAG_mtime
-#undef FLAG_mode
-#undef FLAG_exclude
-#undef FLAG_overwrite
-#undef FLAG_no_same_permissions
-#undef FLAG_numeric_owner
-#undef FLAG_no_recursion
-#undef FLAG_full_time
-#undef FLAG_restrict
-#endif
-
-// taskset <1^pa
-#undef OPTSTR_taskset
-#define OPTSTR_taskset "<1^pa"
-#ifdef CLEANUP_taskset
-#undef CLEANUP_taskset
-#undef FOR_taskset
-#undef FLAG_a
-#undef FLAG_p
-#endif
-
-// tcpsvd ^<3c#=30<1C:b#=20<0u:l:hEv
-#undef OPTSTR_tcpsvd
-#define OPTSTR_tcpsvd "^<3c#=30<1C:b#=20<0u:l:hEv"
-#ifdef CLEANUP_tcpsvd
-#undef CLEANUP_tcpsvd
-#undef FOR_tcpsvd
-#undef FLAG_v
-#undef FLAG_E
-#undef FLAG_h
-#undef FLAG_l
-#undef FLAG_u
-#undef FLAG_b
-#undef FLAG_C
-#undef FLAG_c
-#endif
-
-// tee ia ia
-#undef OPTSTR_tee
-#define OPTSTR_tee "ia"
-#ifdef CLEANUP_tee
-#undef CLEANUP_tee
-#undef FOR_tee
-#undef FLAG_a
-#undef FLAG_i
-#endif
-
-// telnet <1>2
-#undef OPTSTR_telnet
-#define OPTSTR_telnet "<1>2"
-#ifdef CLEANUP_telnet
-#undef CLEANUP_telnet
-#undef FOR_telnet
-#endif
-
-// telnetd w#<0b:p#<0>65535=23f:l:FSKi[!wi]
-#undef OPTSTR_telnetd
-#define OPTSTR_telnetd "w#<0b:p#<0>65535=23f:l:FSKi[!wi]"
-#ifdef CLEANUP_telnetd
-#undef CLEANUP_telnetd
-#undef FOR_telnetd
-#undef FLAG_i
-#undef FLAG_K
-#undef FLAG_S
-#undef FLAG_F
-#undef FLAG_l
-#undef FLAG_f
-#undef FLAG_p
-#undef FLAG_b
-#undef FLAG_w
-#endif
-
-// test
-#undef OPTSTR_test
-#define OPTSTR_test 0
-#ifdef CLEANUP_test
-#undef CLEANUP_test
-#undef FOR_test
-#endif
-
-// tftp <1b#<8>65464r:l:g|p|[!gp]
-#undef OPTSTR_tftp
-#define OPTSTR_tftp "<1b#<8>65464r:l:g|p|[!gp]"
-#ifdef CLEANUP_tftp
-#undef CLEANUP_tftp
-#undef FOR_tftp
-#undef FLAG_p
-#undef FLAG_g
-#undef FLAG_l
-#undef FLAG_r
-#undef FLAG_b
-#endif
-
-// tftpd rcu:l
-#undef OPTSTR_tftpd
-#define OPTSTR_tftpd "rcu:l"
-#ifdef CLEANUP_tftpd
-#undef CLEANUP_tftpd
-#undef FOR_tftpd
-#undef FLAG_l
-#undef FLAG_u
-#undef FLAG_c
-#undef FLAG_r
-#endif
-
-// time <1^pv
-#undef OPTSTR_time
-#define OPTSTR_time "<1^pv"
-#ifdef CLEANUP_time
-#undef CLEANUP_time
-#undef FOR_time
-#undef FLAG_v
-#undef FLAG_p
-#endif
-
-// timeout <2^(foreground)(preserve-status)vk:s(signal): <2^(foreground)(preserve-status)vk:s(signal):
-#undef OPTSTR_timeout
-#define OPTSTR_timeout "<2^(foreground)(preserve-status)vk:s(signal):"
-#ifdef CLEANUP_timeout
-#undef CLEANUP_timeout
-#undef FOR_timeout
-#undef FLAG_s
-#undef FLAG_k
-#undef FLAG_v
-#undef FLAG_preserve_status
-#undef FLAG_foreground
-#endif
-
-// top >0O*Hk*o*p*u*s#<1d%<100=3000m#n#<1bq[!oO]
-#undef OPTSTR_top
-#define OPTSTR_top ">0O*Hk*o*p*u*s#<1d%<100=3000m#n#<1bq[!oO]"
-#ifdef CLEANUP_top
-#undef CLEANUP_top
-#undef FOR_top
-#undef FLAG_q
-#undef FLAG_b
-#undef FLAG_n
-#undef FLAG_m
-#undef FLAG_d
-#undef FLAG_s
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_o
-#undef FLAG_k
-#undef FLAG_H
-#undef FLAG_O
-#endif
-
-// touch <1acd:fmr:t:h[!dtr] <1acd:fmr:t:h[!dtr]
-#undef OPTSTR_touch
-#define OPTSTR_touch "<1acd:fmr:t:h[!dtr]"
-#ifdef CLEANUP_touch
-#undef CLEANUP_touch
-#undef FOR_touch
-#undef FLAG_h
-#undef FLAG_t
-#undef FLAG_r
-#undef FLAG_m
-#undef FLAG_f
-#undef FLAG_d
-#undef FLAG_c
-#undef FLAG_a
-#endif
-
-// toybox
-#undef OPTSTR_toybox
-#define OPTSTR_toybox 0
-#ifdef CLEANUP_toybox
-#undef CLEANUP_toybox
-#undef FOR_toybox
-#endif
-
-// tr ^>2<1Ccsd[+cC] ^>2<1Ccsd[+cC]
-#undef OPTSTR_tr
-#define OPTSTR_tr "^>2<1Ccsd[+cC]"
-#ifdef CLEANUP_tr
-#undef CLEANUP_tr
-#undef FOR_tr
-#undef FLAG_d
-#undef FLAG_s
-#undef FLAG_c
-#undef FLAG_C
-#endif
-
-// traceroute <1>2i:f#<1>255=1z#<0>86400=0g*w#<0>86400=5t#<0>255=0s:q#<1>255=3p#<1>65535=33434m#<1>255=30rvndlIUF64
-#undef OPTSTR_traceroute
-#define OPTSTR_traceroute "<1>2i:f#<1>255=1z#<0>86400=0g*w#<0>86400=5t#<0>255=0s:q#<1>255=3p#<1>65535=33434m#<1>255=30rvndlIUF64"
-#ifdef CLEANUP_traceroute
-#undef CLEANUP_traceroute
-#undef FOR_traceroute
-#undef FLAG_4
-#undef FLAG_6
-#undef FLAG_F
-#undef FLAG_U
-#undef FLAG_I
-#undef FLAG_l
-#undef FLAG_d
-#undef FLAG_n
-#undef FLAG_v
-#undef FLAG_r
-#undef FLAG_m
-#undef FLAG_p
-#undef FLAG_q
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_w
-#undef FLAG_g
-#undef FLAG_z
-#undef FLAG_f
-#undef FLAG_i
-#endif
-
-// true
-#undef OPTSTR_true
-#define OPTSTR_true 0
-#ifdef CLEANUP_true
-#undef CLEANUP_true
-#undef FOR_true
-#endif
-
-// truncate <1s:|c <1s:|c
-#undef OPTSTR_truncate
-#define OPTSTR_truncate "<1s:|c"
-#ifdef CLEANUP_truncate
-#undef CLEANUP_truncate
-#undef FOR_truncate
-#undef FLAG_c
-#undef FLAG_s
-#endif
-
-// tty s
-#undef OPTSTR_tty
-#define OPTSTR_tty "s"
-#ifdef CLEANUP_tty
-#undef CLEANUP_tty
-#undef FOR_tty
-#undef FLAG_s
-#endif
-
-// tunctl <1>1t|d|u:T[!td]
-#undef OPTSTR_tunctl
-#define OPTSTR_tunctl "<1>1t|d|u:T[!td]"
-#ifdef CLEANUP_tunctl
-#undef CLEANUP_tunctl
-#undef FOR_tunctl
-#undef FLAG_T
-#undef FLAG_u
-#undef FLAG_d
-#undef FLAG_t
-#endif
-
-// ulimit >1P#<1SHavutsrRqpnmlifedc[-SH][!apvutsrRqnmlifedc]
-#undef OPTSTR_ulimit
-#define OPTSTR_ulimit ">1P#<1SHavutsrRqpnmlifedc[-SH][!apvutsrRqnmlifedc]"
-#ifdef CLEANUP_ulimit
-#undef CLEANUP_ulimit
-#undef FOR_ulimit
-#undef FLAG_c
-#undef FLAG_d
-#undef FLAG_e
-#undef FLAG_f
-#undef FLAG_i
-#undef FLAG_l
-#undef FLAG_m
-#undef FLAG_n
-#undef FLAG_p
-#undef FLAG_q
-#undef FLAG_R
-#undef FLAG_r
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_u
-#undef FLAG_v
-#undef FLAG_a
-#undef FLAG_H
-#undef FLAG_S
-#undef FLAG_P
-#endif
-
-// umount cndDflrat*v[!na]
-#undef OPTSTR_umount
-#define OPTSTR_umount "cndDflrat*v[!na]"
-#ifdef CLEANUP_umount
-#undef CLEANUP_umount
-#undef FOR_umount
-#undef FLAG_v
-#undef FLAG_t
-#undef FLAG_a
-#undef FLAG_r
-#undef FLAG_l
-#undef FLAG_f
-#undef FLAG_D
-#undef FLAG_d
-#undef FLAG_n
-#undef FLAG_c
-#endif
-
-// uname oamvrns[+os] oamvrns[+os]
-#undef OPTSTR_uname
-#define OPTSTR_uname "oamvrns[+os]"
-#ifdef CLEANUP_uname
-#undef CLEANUP_uname
-#undef FOR_uname
-#undef FLAG_s
-#undef FLAG_n
-#undef FLAG_r
-#undef FLAG_v
-#undef FLAG_m
-#undef FLAG_a
-#undef FLAG_o
-#endif
-
-// uniq f#s#w#zicdu f#s#w#zicdu
-#undef OPTSTR_uniq
-#define OPTSTR_uniq "f#s#w#zicdu"
-#ifdef CLEANUP_uniq
-#undef CLEANUP_uniq
-#undef FOR_uniq
-#undef FLAG_u
-#undef FLAG_d
-#undef FLAG_c
-#undef FLAG_i
-#undef FLAG_z
-#undef FLAG_w
-#undef FLAG_s
-#undef FLAG_f
-#endif
-
-// unix2dos
-#undef OPTSTR_unix2dos
-#define OPTSTR_unix2dos 0
-#ifdef CLEANUP_unix2dos
-#undef CLEANUP_unix2dos
-#undef FOR_unix2dos
-#endif
-
-// unlink <1>1
-#undef OPTSTR_unlink
-#define OPTSTR_unlink "<1>1"
-#ifdef CLEANUP_unlink
-#undef CLEANUP_unlink
-#undef FOR_unlink
-#endif
-
-// unshare <1^f(fork);r(map-root-user);i:(ipc);m:(mount);n:(net);p:(pid);u:(uts);U:(user);
-#undef OPTSTR_unshare
-#define OPTSTR_unshare "<1^f(fork);r(map-root-user);i:(ipc);m:(mount);n:(net);p:(pid);u:(uts);U:(user);"
-#ifdef CLEANUP_unshare
-#undef CLEANUP_unshare
-#undef FOR_unshare
-#undef FLAG_U
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_n
-#undef FLAG_m
-#undef FLAG_i
-#undef FLAG_r
-#undef FLAG_f
-#endif
-
-// uptime >0ps
-#undef OPTSTR_uptime
-#define OPTSTR_uptime ">0ps"
-#ifdef CLEANUP_uptime
-#undef CLEANUP_uptime
-#undef FOR_uptime
-#undef FLAG_s
-#undef FLAG_p
-#endif
-
-// useradd <1>2u#<0G:s:g:h:SDH
-#undef OPTSTR_useradd
-#define OPTSTR_useradd "<1>2u#<0G:s:g:h:SDH"
-#ifdef CLEANUP_useradd
-#undef CLEANUP_useradd
-#undef FOR_useradd
-#undef FLAG_H
-#undef FLAG_D
-#undef FLAG_S
-#undef FLAG_h
-#undef FLAG_g
-#undef FLAG_s
-#undef FLAG_G
-#undef FLAG_u
-#endif
-
-// userdel <1>1r
-#undef OPTSTR_userdel
-#define OPTSTR_userdel "<1>1r"
-#ifdef CLEANUP_userdel
-#undef CLEANUP_userdel
-#undef FOR_userdel
-#undef FLAG_r
-#endif
-
-// usleep <1
-#undef OPTSTR_usleep
-#define OPTSTR_usleep "<1"
-#ifdef CLEANUP_usleep
-#undef CLEANUP_usleep
-#undef FOR_usleep
-#endif
-
-// uudecode >1o:
-#undef OPTSTR_uudecode
-#define OPTSTR_uudecode ">1o:"
-#ifdef CLEANUP_uudecode
-#undef CLEANUP_uudecode
-#undef FOR_uudecode
-#undef FLAG_o
-#endif
-
-// uuencode <1>2m
-#undef OPTSTR_uuencode
-#define OPTSTR_uuencode "<1>2m"
-#ifdef CLEANUP_uuencode
-#undef CLEANUP_uuencode
-#undef FOR_uuencode
-#undef FLAG_m
-#endif
-
-// uuidgen >0r(random)
-#undef OPTSTR_uuidgen
-#define OPTSTR_uuidgen ">0r(random)"
-#ifdef CLEANUP_uuidgen
-#undef CLEANUP_uuidgen
-#undef FOR_uuidgen
-#undef FLAG_r
-#endif
-
-// vconfig <2>4
-#undef OPTSTR_vconfig
-#define OPTSTR_vconfig "<2>4"
-#ifdef CLEANUP_vconfig
-#undef CLEANUP_vconfig
-#undef FOR_vconfig
-#endif
-
-// vi <1>1
-#undef OPTSTR_vi
-#define OPTSTR_vi "<1>1"
-#ifdef CLEANUP_vi
-#undef CLEANUP_vi
-#undef FOR_vi
-#endif
-
-// vmstat >2n
-#undef OPTSTR_vmstat
-#define OPTSTR_vmstat ">2n"
-#ifdef CLEANUP_vmstat
-#undef CLEANUP_vmstat
-#undef FOR_vmstat
-#undef FLAG_n
-#endif
-
-// w
-#undef OPTSTR_w
-#define OPTSTR_w 0
-#ifdef CLEANUP_w
-#undef CLEANUP_w
-#undef FOR_w
-#endif
-
-// watch ^<1n%<100=2000tebx
-#undef OPTSTR_watch
-#define OPTSTR_watch "^<1n%<100=2000tebx"
-#ifdef CLEANUP_watch
-#undef CLEANUP_watch
-#undef FOR_watch
-#undef FLAG_x
-#undef FLAG_b
-#undef FLAG_e
-#undef FLAG_t
-#undef FLAG_n
-#endif
-
-// wc mcwl mcwl
-#undef OPTSTR_wc
-#define OPTSTR_wc "mcwl"
-#ifdef CLEANUP_wc
-#undef CLEANUP_wc
-#undef FOR_wc
-#undef FLAG_l
-#undef FLAG_w
-#undef FLAG_c
-#undef FLAG_m
-#endif
-
-// wget (no-check-certificate)O:
-#undef OPTSTR_wget
-#define OPTSTR_wget "(no-check-certificate)O:"
-#ifdef CLEANUP_wget
-#undef CLEANUP_wget
-#undef FOR_wget
-#undef FLAG_O
-#undef FLAG_no_check_certificate
-#endif
-
-// which <1a <1a
-#undef OPTSTR_which
-#define OPTSTR_which "<1a"
-#ifdef CLEANUP_which
-#undef CLEANUP_which
-#undef FOR_which
-#undef FLAG_a
-#endif
-
-// who a
-#undef OPTSTR_who
-#define OPTSTR_who "a"
-#ifdef CLEANUP_who
-#undef CLEANUP_who
-#undef FOR_who
-#undef FLAG_a
-#endif
-
-// 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:P#optrn#<1(max-args)s#0[!0E]"
-#ifdef CLEANUP_xargs
-#undef CLEANUP_xargs
-#undef FOR_xargs
-#undef FLAG_0
-#undef FLAG_s
-#undef FLAG_n
-#undef FLAG_r
-#undef FLAG_t
-#undef FLAG_p
-#undef FLAG_o
-#undef FLAG_P
-#undef FLAG_E
-#endif
-
-// xxd >1c#l#o#g#<1=2iprs#[!rs] >1c#l#o#g#<1=2iprs#[!rs]
-#undef OPTSTR_xxd
-#define OPTSTR_xxd ">1c#l#o#g#<1=2iprs#[!rs]"
-#ifdef CLEANUP_xxd
-#undef CLEANUP_xxd
-#undef FOR_xxd
-#undef FLAG_s
-#undef FLAG_r
-#undef FLAG_p
-#undef FLAG_i
-#undef FLAG_g
-#undef FLAG_o
-#undef FLAG_l
-#undef FLAG_c
-#endif
-
-// xzcat
-#undef OPTSTR_xzcat
-#define OPTSTR_xzcat 0
-#ifdef CLEANUP_xzcat
-#undef CLEANUP_xzcat
-#undef FOR_xzcat
-#endif
-
-// yes
-#undef OPTSTR_yes
-#define OPTSTR_yes 0
-#ifdef CLEANUP_yes
-#undef CLEANUP_yes
-#undef FOR_yes
-#endif
-
-// zcat cdfk123456789[-123456789]
-#undef OPTSTR_zcat
-#define OPTSTR_zcat "cdfk123456789[-123456789]"
-#ifdef CLEANUP_zcat
-#undef CLEANUP_zcat
-#undef FOR_zcat
-#undef FLAG_9
-#undef FLAG_8
-#undef FLAG_7
-#undef FLAG_6
-#undef FLAG_5
-#undef FLAG_4
-#undef FLAG_3
-#undef FLAG_2
-#undef FLAG_1
-#undef FLAG_k
-#undef FLAG_f
-#undef FLAG_d
-#undef FLAG_c
-#endif
-
-#ifdef FOR_acpi
-#ifndef TT
-#define TT this.acpi
-#endif
-#define FLAG_V (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_b (FORCED_FLAG<<3)
-#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
-#endif
-#define FLAG_H (FORCED_FLAG<<0)
-#define FLAG_A (FORCED_FLAG<<1)
-#define FLAG_p (FORCED_FLAG<<2)
-#define FLAG_a (FORCED_FLAG<<3)
-#define FLAG_d (FORCED_FLAG<<4)
-#define FLAG_s (FORCED_FLAG<<5)
-#define FLAG_D (FORCED_FLAG<<6)
-#define FLAG_n (FORCED_FLAG<<7)
-#define FLAG_i (FORCED_FLAG<<8)
-#define FLAG_v (FORCED_FLAG<<9)
-#endif
-
-#ifdef FOR_arping
-#ifndef TT
-#define TT this.arping
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_q (FORCED_FLAG<<1)
-#define FLAG_b (FORCED_FLAG<<2)
-#define FLAG_D (FORCED_FLAG<<3)
-#define FLAG_U (FORCED_FLAG<<4)
-#define FLAG_A (FORCED_FLAG<<5)
-#define FLAG_c (FORCED_FLAG<<6)
-#define FLAG_w (FORCED_FLAG<<7)
-#define FLAG_I (FORCED_FLAG<<8)
-#define FLAG_s (FORCED_FLAG<<9)
-#endif
-
-#ifdef FOR_ascii
-#ifndef TT
-#define TT this.ascii
-#endif
-#endif
-
-#ifdef FOR_base64
-#ifndef TT
-#define TT this.base64
-#endif
-#define FLAG_w (FORCED_FLAG<<0)
-#define FLAG_i (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_basename
-#ifndef TT
-#define TT this.basename
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_a (1<<1)
-#endif
-
-#ifdef FOR_bc
-#ifndef TT
-#define TT this.bc
-#endif
-#define FLAG_w (1<<0)
-#define FLAG_s (1<<1)
-#define FLAG_q (1<<2)
-#define FLAG_l (1<<3)
-#define FLAG_i (1<<4)
-#endif
-
-#ifdef FOR_blkid
-#ifndef TT
-#define TT this.blkid
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_L (FORCED_FLAG<<1)
-#define FLAG_U (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_blockdev
-#ifndef TT
-#define TT this.blockdev
-#endif
-#define FLAG_rereadpt (FORCED_FLAG<<0)
-#define FLAG_flushbufs (FORCED_FLAG<<1)
-#define FLAG_setra (FORCED_FLAG<<2)
-#define FLAG_getra (FORCED_FLAG<<3)
-#define FLAG_getsize64 (FORCED_FLAG<<4)
-#define FLAG_getsize (FORCED_FLAG<<5)
-#define FLAG_getsz (FORCED_FLAG<<6)
-#define FLAG_setbsz (FORCED_FLAG<<7)
-#define FLAG_getbsz (FORCED_FLAG<<8)
-#define FLAG_getss (FORCED_FLAG<<9)
-#define FLAG_getro (FORCED_FLAG<<10)
-#define FLAG_setrw (FORCED_FLAG<<11)
-#define FLAG_setro (FORCED_FLAG<<12)
-#endif
-
-#ifdef FOR_bootchartd
-#ifndef TT
-#define TT this.bootchartd
-#endif
-#endif
-
-#ifdef FOR_brctl
-#ifndef TT
-#define TT this.brctl
-#endif
-#endif
-
-#ifdef FOR_bunzip2
-#ifndef TT
-#define TT this.bunzip2
-#endif
-#define FLAG_v (FORCED_FLAG<<0)
-#define FLAG_k (FORCED_FLAG<<1)
-#define FLAG_t (FORCED_FLAG<<2)
-#define FLAG_f (FORCED_FLAG<<3)
-#define FLAG_c (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_bzcat
-#ifndef TT
-#define TT this.bzcat
-#endif
-#endif
-
-#ifdef FOR_cal
-#ifndef TT
-#define TT this.cal
-#endif
-#endif
-
-#ifdef FOR_cat
-#ifndef TT
-#define TT this.cat
-#endif
-#define FLAG_e (1<<0)
-#define FLAG_t (1<<1)
-#define FLAG_v (1<<2)
-#define FLAG_u (1<<3)
-#endif
-
-#ifdef FOR_catv
-#ifndef TT
-#define TT this.catv
-#endif
-#define FLAG_e (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_v (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_cd
-#ifndef TT
-#define TT this.cd
-#endif
-#endif
-
-#ifdef FOR_chattr
-#ifndef TT
-#define TT this.chattr
-#endif
-#endif
-
-#ifdef FOR_chcon
-#ifndef TT
-#define TT this.chcon
-#endif
-#define FLAG_R (FORCED_FLAG<<0)
-#define FLAG_v (FORCED_FLAG<<1)
-#define FLAG_h (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_chgrp
-#ifndef TT
-#define TT this.chgrp
-#endif
-#define FLAG_v (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#define FLAG_R (FORCED_FLAG<<2)
-#define FLAG_H (FORCED_FLAG<<3)
-#define FLAG_L (FORCED_FLAG<<4)
-#define FLAG_P (FORCED_FLAG<<5)
-#define FLAG_h (FORCED_FLAG<<6)
-#endif
-
-#ifdef FOR_chmod
-#ifndef TT
-#define TT this.chmod
-#endif
-#define FLAG_f (1<<0)
-#define FLAG_R (1<<1)
-#define FLAG_v (1<<2)
-#endif
-
-#ifdef FOR_chroot
-#ifndef TT
-#define TT this.chroot
-#endif
-#endif
-
-#ifdef FOR_chrt
-#ifndef TT
-#define TT this.chrt
-#endif
-#define FLAG_o (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#define FLAG_r (FORCED_FLAG<<2)
-#define FLAG_b (FORCED_FLAG<<3)
-#define FLAG_R (FORCED_FLAG<<4)
-#define FLAG_i (FORCED_FLAG<<5)
-#define FLAG_p (FORCED_FLAG<<6)
-#define FLAG_m (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_chvt
-#ifndef TT
-#define TT this.chvt
-#endif
-#endif
-
-#ifdef FOR_cksum
-#ifndef TT
-#define TT this.cksum
-#endif
-#define FLAG_N (FORCED_FLAG<<0)
-#define FLAG_L (FORCED_FLAG<<1)
-#define FLAG_P (FORCED_FLAG<<2)
-#define FLAG_I (FORCED_FLAG<<3)
-#define FLAG_H (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_clear
-#ifndef TT
-#define TT this.clear
-#endif
-#endif
-
-#ifdef FOR_cmp
-#ifndef TT
-#define TT this.cmp
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_l (1<<1)
-#endif
-
-#ifdef FOR_comm
-#ifndef TT
-#define TT this.comm
-#endif
-#define FLAG_1 (1<<0)
-#define FLAG_2 (1<<1)
-#define FLAG_3 (1<<2)
-#endif
-
-#ifdef FOR_count
-#ifndef TT
-#define TT this.count
-#endif
-#endif
-
-#ifdef FOR_cp
-#ifndef TT
-#define TT this.cp
-#endif
-#define FLAG_i (1<<0)
-#define FLAG_f (1<<1)
-#define FLAG_F (1<<2)
-#define FLAG_n (1<<3)
-#define FLAG_v (1<<4)
-#define FLAG_l (1<<5)
-#define FLAG_s (1<<6)
-#define FLAG_a (1<<7)
-#define FLAG_d (1<<8)
-#define FLAG_r (1<<9)
-#define FLAG_p (1<<10)
-#define FLAG_P (1<<11)
-#define FLAG_L (1<<12)
-#define FLAG_H (1<<13)
-#define FLAG_R (1<<14)
-#define FLAG_D (1<<15)
-#define FLAG_preserve (1<<16)
-#endif
-
-#ifdef FOR_cpio
-#ifndef TT
-#define TT this.cpio
-#endif
-#define FLAG_o (FORCED_FLAG<<0)
-#define FLAG_v (FORCED_FLAG<<1)
-#define FLAG_F (FORCED_FLAG<<2)
-#define FLAG_t (FORCED_FLAG<<3)
-#define FLAG_i (FORCED_FLAG<<4)
-#define FLAG_p (FORCED_FLAG<<5)
-#define FLAG_H (FORCED_FLAG<<6)
-#define FLAG_u (FORCED_FLAG<<7)
-#define FLAG_d (FORCED_FLAG<<8)
-#define FLAG_m (FORCED_FLAG<<9)
-#define FLAG_trailer (FORCED_FLAG<<10)
-#define FLAG_no_preserve_owner (FORCED_FLAG<<11)
-#endif
-
-#ifdef FOR_crc32
-#ifndef TT
-#define TT this.crc32
-#endif
-#endif
-
-#ifdef FOR_crond
-#ifndef TT
-#define TT this.crond
-#endif
-#define FLAG_c (FORCED_FLAG<<0)
-#define FLAG_L (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_l (FORCED_FLAG<<3)
-#define FLAG_S (FORCED_FLAG<<4)
-#define FLAG_b (FORCED_FLAG<<5)
-#define FLAG_f (FORCED_FLAG<<6)
-#endif
-
-#ifdef FOR_crontab
-#ifndef TT
-#define TT this.crontab
-#endif
-#define FLAG_r (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#define FLAG_e (FORCED_FLAG<<2)
-#define FLAG_u (FORCED_FLAG<<3)
-#define FLAG_c (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_cut
-#ifndef TT
-#define TT this.cut
-#endif
-#define FLAG_n (1<<0)
-#define FLAG_D (1<<1)
-#define FLAG_s (1<<2)
-#define FLAG_d (1<<3)
-#define FLAG_O (1<<4)
-#define FLAG_C (1<<5)
-#define FLAG_F (1<<6)
-#define FLAG_f (1<<7)
-#define FLAG_c (1<<8)
-#define FLAG_b (1<<9)
-#endif
-
-#ifdef FOR_date
-#ifndef TT
-#define TT this.date
-#endif
-#define FLAG_u (1<<0)
-#define FLAG_r (1<<1)
-#define FLAG_D (1<<2)
-#define FLAG_d (1<<3)
-#endif
-
-#ifdef FOR_dd
-#ifndef TT
-#define TT this.dd
-#endif
-#endif
-
-#ifdef FOR_deallocvt
-#ifndef TT
-#define TT this.deallocvt
-#endif
-#endif
-
-#ifdef FOR_demo_many_options
-#ifndef TT
-#define TT this.demo_many_options
-#endif
-#define FLAG_a (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_d (FORCED_FLAG<<3)
-#define FLAG_e (FORCED_FLAG<<4)
-#define FLAG_f (FORCED_FLAG<<5)
-#define FLAG_g (FORCED_FLAG<<6)
-#define FLAG_h (FORCED_FLAG<<7)
-#define FLAG_i (FORCED_FLAG<<8)
-#define FLAG_j (FORCED_FLAG<<9)
-#define FLAG_k (FORCED_FLAG<<10)
-#define FLAG_l (FORCED_FLAG<<11)
-#define FLAG_m (FORCED_FLAG<<12)
-#define FLAG_n (FORCED_FLAG<<13)
-#define FLAG_o (FORCED_FLAG<<14)
-#define FLAG_p (FORCED_FLAG<<15)
-#define FLAG_q (FORCED_FLAG<<16)
-#define FLAG_r (FORCED_FLAG<<17)
-#define FLAG_s (FORCED_FLAG<<18)
-#define FLAG_t (FORCED_FLAG<<19)
-#define FLAG_u (FORCED_FLAG<<20)
-#define FLAG_v (FORCED_FLAG<<21)
-#define FLAG_w (FORCED_FLAG<<22)
-#define FLAG_x (FORCED_FLAG<<23)
-#define FLAG_y (FORCED_FLAG<<24)
-#define FLAG_z (FORCED_FLAG<<25)
-#define FLAG_A (FORCED_FLAG<<26)
-#define FLAG_B (FORCED_FLAG<<27)
-#define FLAG_C (FORCED_FLAG<<28)
-#define FLAG_D (FORCED_FLAG<<29)
-#define FLAG_E (FORCED_FLAG<<30)
-#define FLAG_F (FORCED_FLAG<<31)
-#define FLAG_G (FORCED_FLAGLL<<32)
-#define FLAG_H (FORCED_FLAGLL<<33)
-#define FLAG_I (FORCED_FLAGLL<<34)
-#define FLAG_J (FORCED_FLAGLL<<35)
-#define FLAG_K (FORCED_FLAGLL<<36)
-#define FLAG_L (FORCED_FLAGLL<<37)
-#define FLAG_M (FORCED_FLAGLL<<38)
-#define FLAG_N (FORCED_FLAGLL<<39)
-#define FLAG_O (FORCED_FLAGLL<<40)
-#define FLAG_P (FORCED_FLAGLL<<41)
-#define FLAG_Q (FORCED_FLAGLL<<42)
-#define FLAG_R (FORCED_FLAGLL<<43)
-#define FLAG_S (FORCED_FLAGLL<<44)
-#define FLAG_T (FORCED_FLAGLL<<45)
-#define FLAG_U (FORCED_FLAGLL<<46)
-#define FLAG_V (FORCED_FLAGLL<<47)
-#define FLAG_W (FORCED_FLAGLL<<48)
-#define FLAG_X (FORCED_FLAGLL<<49)
-#define FLAG_Y (FORCED_FLAGLL<<50)
-#define FLAG_Z (FORCED_FLAGLL<<51)
-#endif
-
-#ifdef FOR_demo_number
-#ifndef TT
-#define TT this.demo_number
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_h (FORCED_FLAG<<3)
-#define FLAG_D (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_demo_scankey
-#ifndef TT
-#define TT this.demo_scankey
-#endif
-#endif
-
-#ifdef FOR_demo_utf8towc
-#ifndef TT
-#define TT this.demo_utf8towc
-#endif
-#endif
-
-#ifdef FOR_devmem
-#ifndef TT
-#define TT this.devmem
-#endif
-#endif
-
-#ifdef FOR_df
-#ifndef TT
-#define TT this.df
-#endif
-#define FLAG_a (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_i (FORCED_FLAG<<2)
-#define FLAG_h (FORCED_FLAG<<3)
-#define FLAG_k (FORCED_FLAG<<4)
-#define FLAG_P (FORCED_FLAG<<5)
-#define FLAG_H (FORCED_FLAG<<6)
-#endif
-
-#ifdef FOR_dhcp
-#ifndef TT
-#define TT this.dhcp
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_q (FORCED_FLAG<<3)
-#define FLAG_v (FORCED_FLAG<<4)
-#define FLAG_o (FORCED_FLAG<<5)
-#define FLAG_a (FORCED_FLAG<<6)
-#define FLAG_C (FORCED_FLAG<<7)
-#define FLAG_R (FORCED_FLAG<<8)
-#define FLAG_B (FORCED_FLAG<<9)
-#define FLAG_S (FORCED_FLAG<<10)
-#define FLAG_i (FORCED_FLAG<<11)
-#define FLAG_p (FORCED_FLAG<<12)
-#define FLAG_s (FORCED_FLAG<<13)
-#define FLAG_t (FORCED_FLAG<<14)
-#define FLAG_T (FORCED_FLAG<<15)
-#define FLAG_A (FORCED_FLAG<<16)
-#define FLAG_O (FORCED_FLAG<<17)
-#define FLAG_r (FORCED_FLAG<<18)
-#define FLAG_x (FORCED_FLAG<<19)
-#define FLAG_F (FORCED_FLAG<<20)
-#define FLAG_H (FORCED_FLAG<<21)
-#define FLAG_V (FORCED_FLAG<<22)
-#endif
-
-#ifdef FOR_dhcp6
-#ifndef TT
-#define TT this.dhcp6
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_q (FORCED_FLAG<<3)
-#define FLAG_v (FORCED_FLAG<<4)
-#define FLAG_R (FORCED_FLAG<<5)
-#define FLAG_S (FORCED_FLAG<<6)
-#define FLAG_i (FORCED_FLAG<<7)
-#define FLAG_p (FORCED_FLAG<<8)
-#define FLAG_s (FORCED_FLAG<<9)
-#define FLAG_t (FORCED_FLAG<<10)
-#define FLAG_T (FORCED_FLAG<<11)
-#define FLAG_A (FORCED_FLAG<<12)
-#define FLAG_r (FORCED_FLAG<<13)
-#endif
-
-#ifdef FOR_dhcpd
-#ifndef TT
-#define TT this.dhcpd
-#endif
-#define FLAG_6 (FORCED_FLAG<<0)
-#define FLAG_4 (FORCED_FLAG<<1)
-#define FLAG_S (FORCED_FLAG<<2)
-#define FLAG_i (FORCED_FLAG<<3)
-#define FLAG_f (FORCED_FLAG<<4)
-#define FLAG_P (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_diff
-#ifndef TT
-#define TT this.diff
-#endif
-#define FLAG_U (1<<0)
-#define FLAG_r (1<<1)
-#define FLAG_N (1<<2)
-#define FLAG_S (1<<3)
-#define FLAG_L (1<<4)
-#define FLAG_a (1<<5)
-#define FLAG_q (1<<6)
-#define FLAG_s (1<<7)
-#define FLAG_T (1<<8)
-#define FLAG_i (1<<9)
-#define FLAG_w (1<<10)
-#define FLAG_t (1<<11)
-#define FLAG_u (1<<12)
-#define FLAG_b (1<<13)
-#define FLAG_d (1<<14)
-#define FLAG_B (1<<15)
-#define FLAG_strip_trailing_cr (1<<16)
-#define FLAG_color (1<<17)
-#endif
-
-#ifdef FOR_dirname
-#ifndef TT
-#define TT this.dirname
-#endif
-#endif
-
-#ifdef FOR_dmesg
-#ifndef TT
-#define TT this.dmesg
-#endif
-#define FLAG_c (FORCED_FLAG<<0)
-#define FLAG_n (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#define FLAG_r (FORCED_FLAG<<3)
-#define FLAG_t (FORCED_FLAG<<4)
-#define FLAG_T (FORCED_FLAG<<5)
-#define FLAG_S (FORCED_FLAG<<6)
-#define FLAG_C (FORCED_FLAG<<7)
-#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
-#endif
-#endif
-
-#ifdef FOR_du
-#ifndef TT
-#define TT this.du
-#endif
-#define FLAG_x (1<<0)
-#define FLAG_s (1<<1)
-#define FLAG_L (1<<2)
-#define FLAG_K (1<<3)
-#define FLAG_k (1<<4)
-#define FLAG_H (1<<5)
-#define FLAG_a (1<<6)
-#define FLAG_c (1<<7)
-#define FLAG_l (1<<8)
-#define FLAG_m (1<<9)
-#define FLAG_h (1<<10)
-#define FLAG_d (1<<11)
-#endif
-
-#ifdef FOR_dumpleases
-#ifndef TT
-#define TT this.dumpleases
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_r (FORCED_FLAG<<1)
-#define FLAG_a (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_echo
-#ifndef TT
-#define TT this.echo
-#endif
-#define FLAG_n (1<<0)
-#define FLAG_e (1<<1)
-#define FLAG_E (1<<2)
-#endif
-
-#ifdef FOR_eject
-#ifndef TT
-#define TT this.eject
-#endif
-#define FLAG_T (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_env
-#ifndef TT
-#define TT this.env
-#endif
-#define FLAG_u (1<<0)
-#define FLAG_i (1<<1)
-#define FLAG_0 (1<<2)
-#endif
-
-#ifdef FOR_exit
-#ifndef TT
-#define TT this.exit
-#endif
-#endif
-
-#ifdef FOR_expand
-#ifndef TT
-#define TT this.expand
-#endif
-#define FLAG_t (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_expr
-#ifndef TT
-#define TT this.expr
-#endif
-#endif
-
-#ifdef FOR_factor
-#ifndef TT
-#define TT this.factor
-#endif
-#endif
-
-#ifdef FOR_fallocate
-#ifndef TT
-#define TT this.fallocate
-#endif
-#define FLAG_o (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_false
-#ifndef TT
-#define TT this.false
-#endif
-#endif
-
-#ifdef FOR_fdisk
-#ifndef TT
-#define TT this.fdisk
-#endif
-#define FLAG_l (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_b (FORCED_FLAG<<2)
-#define FLAG_S (FORCED_FLAG<<3)
-#define FLAG_H (FORCED_FLAG<<4)
-#define FLAG_C (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_file
-#ifndef TT
-#define TT this.file
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_L (FORCED_FLAG<<1)
-#define FLAG_h (FORCED_FLAG<<2)
-#define FLAG_b (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_find
-#ifndef TT
-#define TT this.find
-#endif
-#define FLAG_L (1<<0)
-#define FLAG_H (1<<1)
-#endif
-
-#ifdef FOR_flock
-#ifndef TT
-#define TT this.flock
-#endif
-#define FLAG_x (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_fmt
-#ifndef TT
-#define TT this.fmt
-#endif
-#define FLAG_w (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_fold
-#ifndef TT
-#define TT this.fold
-#endif
-#define FLAG_w (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#define FLAG_b (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_free
-#ifndef TT
-#define TT this.free
-#endif
-#define FLAG_b (FORCED_FLAG<<0)
-#define FLAG_k (FORCED_FLAG<<1)
-#define FLAG_m (FORCED_FLAG<<2)
-#define FLAG_g (FORCED_FLAG<<3)
-#define FLAG_t (FORCED_FLAG<<4)
-#define FLAG_h (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_freeramdisk
-#ifndef TT
-#define TT this.freeramdisk
-#endif
-#endif
-
-#ifdef FOR_fsck
-#ifndef TT
-#define TT this.fsck
-#endif
-#define FLAG_C (FORCED_FLAG<<0)
-#define FLAG_s (FORCED_FLAG<<1)
-#define FLAG_V (FORCED_FLAG<<2)
-#define FLAG_T (FORCED_FLAG<<3)
-#define FLAG_R (FORCED_FLAG<<4)
-#define FLAG_P (FORCED_FLAG<<5)
-#define FLAG_N (FORCED_FLAG<<6)
-#define FLAG_A (FORCED_FLAG<<7)
-#define FLAG_t (FORCED_FLAG<<8)
-#endif
-
-#ifdef FOR_fsfreeze
-#ifndef TT
-#define TT this.fsfreeze
-#endif
-#define FLAG_u (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_fstype
-#ifndef TT
-#define TT this.fstype
-#endif
-#endif
-
-#ifdef FOR_fsync
-#ifndef TT
-#define TT this.fsync
-#endif
-#define FLAG_d (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_ftpget
-#ifndef TT
-#define TT this.ftpget
-#endif
-#define FLAG_D (FORCED_FLAG<<0)
-#define FLAG_d (FORCED_FLAG<<1)
-#define FLAG_M (FORCED_FLAG<<2)
-#define FLAG_m (FORCED_FLAG<<3)
-#define FLAG_L (FORCED_FLAG<<4)
-#define FLAG_l (FORCED_FLAG<<5)
-#define FLAG_s (FORCED_FLAG<<6)
-#define FLAG_g (FORCED_FLAG<<7)
-#define FLAG_v (FORCED_FLAG<<8)
-#define FLAG_u (FORCED_FLAG<<9)
-#define FLAG_p (FORCED_FLAG<<10)
-#define FLAG_c (FORCED_FLAG<<11)
-#define FLAG_P (FORCED_FLAG<<12)
-#endif
-
-#ifdef FOR_getconf
-#ifndef TT
-#define TT this.getconf
-#endif
-#define FLAG_l (1<<0)
-#define FLAG_a (1<<1)
-#endif
-
-#ifdef FOR_getenforce
-#ifndef TT
-#define TT this.getenforce
-#endif
-#endif
-
-#ifdef FOR_getfattr
-#ifndef TT
-#define TT this.getfattr
-#endif
-#define FLAG_n (FORCED_FLAG<<0)
-#define FLAG_h (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_only_values (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_getty
-#ifndef TT
-#define TT this.getty
-#endif
-#define FLAG_h (FORCED_FLAG<<0)
-#define FLAG_L (FORCED_FLAG<<1)
-#define FLAG_m (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#define FLAG_w (FORCED_FLAG<<4)
-#define FLAG_i (FORCED_FLAG<<5)
-#define FLAG_f (FORCED_FLAG<<6)
-#define FLAG_l (FORCED_FLAG<<7)
-#define FLAG_I (FORCED_FLAG<<8)
-#define FLAG_H (FORCED_FLAG<<9)
-#define FLAG_t (FORCED_FLAG<<10)
-#endif
-
-#ifdef FOR_grep
-#ifndef TT
-#define TT this.grep
-#endif
-#define FLAG_x (1<<0)
-#define FLAG_m (1<<1)
-#define FLAG_A (1<<2)
-#define FLAG_B (1<<3)
-#define FLAG_C (1<<4)
-#define FLAG_f (1<<5)
-#define FLAG_e (1<<6)
-#define FLAG_q (1<<7)
-#define FLAG_l (1<<8)
-#define FLAG_c (1<<9)
-#define FLAG_w (1<<10)
-#define FLAG_v (1<<11)
-#define FLAG_s (1<<12)
-#define FLAG_R (1<<13)
-#define FLAG_r (1<<14)
-#define FLAG_o (1<<15)
-#define FLAG_n (1<<16)
-#define FLAG_i (1<<17)
-#define FLAG_h (1<<18)
-#define FLAG_b (1<<19)
-#define FLAG_a (1<<20)
-#define FLAG_I (1<<21)
-#define FLAG_H (1<<22)
-#define FLAG_F (1<<23)
-#define FLAG_E (1<<24)
-#define FLAG_z (1<<25)
-#define FLAG_Z (1<<26)
-#define FLAG_M (1<<27)
-#define FLAG_S (1<<28)
-#define FLAG_exclude_dir (1<<29)
-#define FLAG_color (1<<30)
-#define FLAG_line_buffered (1<<31)
-#endif
-
-#ifdef FOR_groupadd
-#ifndef TT
-#define TT this.groupadd
-#endif
-#define FLAG_S (FORCED_FLAG<<0)
-#define FLAG_g (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_groupdel
-#ifndef TT
-#define TT this.groupdel
-#endif
-#endif
-
-#ifdef FOR_groups
-#ifndef TT
-#define TT this.groups
-#endif
-#endif
-
-#ifdef FOR_gunzip
-#ifndef TT
-#define TT this.gunzip
-#endif
-#define FLAG_9 (FORCED_FLAG<<0)
-#define FLAG_8 (FORCED_FLAG<<1)
-#define FLAG_7 (FORCED_FLAG<<2)
-#define FLAG_6 (FORCED_FLAG<<3)
-#define FLAG_5 (FORCED_FLAG<<4)
-#define FLAG_4 (FORCED_FLAG<<5)
-#define FLAG_3 (FORCED_FLAG<<6)
-#define FLAG_2 (FORCED_FLAG<<7)
-#define FLAG_1 (FORCED_FLAG<<8)
-#define FLAG_k (FORCED_FLAG<<9)
-#define FLAG_f (FORCED_FLAG<<10)
-#define FLAG_d (FORCED_FLAG<<11)
-#define FLAG_c (FORCED_FLAG<<12)
-#endif
-
-#ifdef FOR_gzip
-#ifndef TT
-#define TT this.gzip
-#endif
-#define FLAG_9 (FORCED_FLAG<<0)
-#define FLAG_8 (FORCED_FLAG<<1)
-#define FLAG_7 (FORCED_FLAG<<2)
-#define FLAG_6 (FORCED_FLAG<<3)
-#define FLAG_5 (FORCED_FLAG<<4)
-#define FLAG_4 (FORCED_FLAG<<5)
-#define FLAG_3 (FORCED_FLAG<<6)
-#define FLAG_2 (FORCED_FLAG<<7)
-#define FLAG_1 (FORCED_FLAG<<8)
-#define FLAG_k (FORCED_FLAG<<9)
-#define FLAG_f (FORCED_FLAG<<10)
-#define FLAG_d (FORCED_FLAG<<11)
-#define FLAG_c (FORCED_FLAG<<12)
-#define FLAG_n (FORCED_FLAG<<13)
-#endif
-
-#ifdef FOR_head
-#ifndef TT
-#define TT this.head
-#endif
-#define FLAG_v (1<<0)
-#define FLAG_q (1<<1)
-#define FLAG_c (1<<2)
-#define FLAG_n (1<<3)
-#endif
-
-#ifdef FOR_hello
-#ifndef TT
-#define TT this.hello
-#endif
-#endif
-
-#ifdef FOR_help
-#ifndef TT
-#define TT this.help
-#endif
-#define FLAG_h (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_hexedit
-#ifndef TT
-#define TT this.hexedit
-#endif
-#define FLAG_r (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_host
-#ifndef TT
-#define TT this.host
-#endif
-#define FLAG_t (FORCED_FLAG<<0)
-#define FLAG_v (FORCED_FLAG<<1)
-#define FLAG_a (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_hostid
-#ifndef TT
-#define TT this.hostid
-#endif
-#endif
-
-#ifdef FOR_hostname
-#ifndef TT
-#define TT this.hostname
-#endif
-#define FLAG_F (1<<0)
-#define FLAG_f (1<<1)
-#define FLAG_s (1<<2)
-#define FLAG_d (1<<3)
-#define FLAG_b (1<<4)
-#endif
-
-#ifdef FOR_hwclock
-#ifndef TT
-#define TT this.hwclock
-#endif
-#define FLAG_w (FORCED_FLAG<<0)
-#define FLAG_r (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#define FLAG_t (FORCED_FLAG<<3)
-#define FLAG_l (FORCED_FLAG<<4)
-#define FLAG_u (FORCED_FLAG<<5)
-#define FLAG_f (FORCED_FLAG<<6)
-#define FLAG_fast (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_i2cdetect
-#ifndef TT
-#define TT this.i2cdetect
-#endif
-#define FLAG_y (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#define FLAG_F (FORCED_FLAG<<2)
-#define FLAG_a (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_i2cdump
-#ifndef TT
-#define TT this.i2cdump
-#endif
-#define FLAG_y (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_i2cget
-#ifndef TT
-#define TT this.i2cget
-#endif
-#define FLAG_y (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_i2cset
-#ifndef TT
-#define TT this.i2cset
-#endif
-#define FLAG_y (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_iconv
-#ifndef TT
-#define TT this.iconv
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#define FLAG_c (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_id
-#ifndef TT
-#define TT this.id
-#endif
-#define FLAG_u (1<<0)
-#define FLAG_r (1<<1)
-#define FLAG_g (1<<2)
-#define FLAG_G (1<<3)
-#define FLAG_n (1<<4)
-#define FLAG_Z (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_ifconfig
-#ifndef TT
-#define TT this.ifconfig
-#endif
-#define FLAG_S (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_init
-#ifndef TT
-#define TT this.init
-#endif
-#endif
-
-#ifdef FOR_inotifyd
-#ifndef TT
-#define TT this.inotifyd
-#endif
-#endif
-
-#ifdef FOR_insmod
-#ifndef TT
-#define TT this.insmod
-#endif
-#endif
-
-#ifdef FOR_install
-#ifndef TT
-#define TT this.install
-#endif
-#define FLAG_g (FORCED_FLAG<<0)
-#define FLAG_o (FORCED_FLAG<<1)
-#define FLAG_m (FORCED_FLAG<<2)
-#define FLAG_v (FORCED_FLAG<<3)
-#define FLAG_s (FORCED_FLAG<<4)
-#define FLAG_p (FORCED_FLAG<<5)
-#define FLAG_D (FORCED_FLAG<<6)
-#define FLAG_d (FORCED_FLAG<<7)
-#define FLAG_c (FORCED_FLAG<<8)
-#endif
-
-#ifdef FOR_ionice
-#ifndef TT
-#define TT this.ionice
-#endif
-#define FLAG_p (FORCED_FLAG<<0)
-#define FLAG_n (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_t (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_iorenice
-#ifndef TT
-#define TT this.iorenice
-#endif
-#endif
-
-#ifdef FOR_iotop
-#ifndef TT
-#define TT this.iotop
-#endif
-#define FLAG_q (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_m (FORCED_FLAG<<3)
-#define FLAG_d (FORCED_FLAG<<4)
-#define FLAG_s (FORCED_FLAG<<5)
-#define FLAG_u (FORCED_FLAG<<6)
-#define FLAG_p (FORCED_FLAG<<7)
-#define FLAG_o (FORCED_FLAG<<8)
-#define FLAG_k (FORCED_FLAG<<9)
-#define FLAG_H (FORCED_FLAG<<10)
-#define FLAG_O (FORCED_FLAG<<11)
-#define FLAG_K (FORCED_FLAG<<12)
-#define FLAG_a (FORCED_FLAG<<13)
-#define FLAG_A (FORCED_FLAG<<14)
-#endif
-
-#ifdef FOR_ip
-#ifndef TT
-#define TT this.ip
-#endif
-#endif
-
-#ifdef FOR_ipcrm
-#ifndef TT
-#define TT this.ipcrm
-#endif
-#define FLAG_Q (FORCED_FLAG<<0)
-#define FLAG_q (FORCED_FLAG<<1)
-#define FLAG_S (FORCED_FLAG<<2)
-#define FLAG_s (FORCED_FLAG<<3)
-#define FLAG_M (FORCED_FLAG<<4)
-#define FLAG_m (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_ipcs
-#ifndef TT
-#define TT this.ipcs
-#endif
-#define FLAG_i (FORCED_FLAG<<0)
-#define FLAG_m (FORCED_FLAG<<1)
-#define FLAG_q (FORCED_FLAG<<2)
-#define FLAG_s (FORCED_FLAG<<3)
-#define FLAG_l (FORCED_FLAG<<4)
-#define FLAG_u (FORCED_FLAG<<5)
-#define FLAG_t (FORCED_FLAG<<6)
-#define FLAG_p (FORCED_FLAG<<7)
-#define FLAG_c (FORCED_FLAG<<8)
-#define FLAG_a (FORCED_FLAG<<9)
-#endif
-
-#ifdef FOR_kill
-#ifndef TT
-#define TT this.kill
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_killall
-#ifndef TT
-#define TT this.killall
-#endif
-#define FLAG_w (FORCED_FLAG<<0)
-#define FLAG_v (FORCED_FLAG<<1)
-#define FLAG_q (FORCED_FLAG<<2)
-#define FLAG_l (FORCED_FLAG<<3)
-#define FLAG_i (FORCED_FLAG<<4)
-#define FLAG_s (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_killall5
-#ifndef TT
-#define TT this.killall5
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#define FLAG_o (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_klogd
-#ifndef TT
-#define TT this.klogd
-#endif
-#define FLAG_n (FORCED_FLAG<<0)
-#define FLAG_c (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_last
-#ifndef TT
-#define TT this.last
-#endif
-#define FLAG_W (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_link
-#ifndef TT
-#define TT this.link
-#endif
-#endif
-
-#ifdef FOR_ln
-#ifndef TT
-#define TT this.ln
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_f (1<<1)
-#define FLAG_n (1<<2)
-#define FLAG_v (1<<3)
-#define FLAG_T (1<<4)
-#define FLAG_t (1<<5)
-#endif
-
-#ifdef FOR_load_policy
-#ifndef TT
-#define TT this.load_policy
-#endif
-#endif
-
-#ifdef FOR_log
-#ifndef TT
-#define TT this.log
-#endif
-#define FLAG_t (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_logger
-#ifndef TT
-#define TT this.logger
-#endif
-#define FLAG_p (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_login
-#ifndef TT
-#define TT this.login
-#endif
-#define FLAG_h (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#define FLAG_f (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_logname
-#ifndef TT
-#define TT this.logname
-#endif
-#endif
-
-#ifdef FOR_logwrapper
-#ifndef TT
-#define TT this.logwrapper
-#endif
-#endif
-
-#ifdef FOR_losetup
-#ifndef TT
-#define TT this.losetup
-#endif
-#define FLAG_D (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_d (FORCED_FLAG<<3)
-#define FLAG_f (FORCED_FLAG<<4)
-#define FLAG_j (FORCED_FLAG<<5)
-#define FLAG_o (FORCED_FLAG<<6)
-#define FLAG_r (FORCED_FLAG<<7)
-#define FLAG_s (FORCED_FLAG<<8)
-#define FLAG_S (FORCED_FLAG<<9)
-#endif
-
-#ifdef FOR_ls
-#ifndef TT
-#define TT this.ls
-#endif
-#define FLAG_1 (1<<0)
-#define FLAG_x (1<<1)
-#define FLAG_u (1<<2)
-#define FLAG_t (1<<3)
-#define FLAG_s (1<<4)
-#define FLAG_r (1<<5)
-#define FLAG_q (1<<6)
-#define FLAG_p (1<<7)
-#define FLAG_n (1<<8)
-#define FLAG_m (1<<9)
-#define FLAG_l (1<<10)
-#define FLAG_k (1<<11)
-#define FLAG_i (1<<12)
-#define FLAG_h (1<<13)
-#define FLAG_f (1<<14)
-#define FLAG_d (1<<15)
-#define FLAG_c (1<<16)
-#define FLAG_b (1<<17)
-#define FLAG_a (1<<18)
-#define FLAG_S (1<<19)
-#define FLAG_R (1<<20)
-#define FLAG_L (1<<21)
-#define FLAG_H (1<<22)
-#define FLAG_F (1<<23)
-#define FLAG_C (1<<24)
-#define FLAG_A (1<<25)
-#define FLAG_o (1<<26)
-#define FLAG_g (1<<27)
-#define FLAG_Z (1<<28)
-#define FLAG_show_control_chars (1<<29)
-#define FLAG_full_time (1<<30)
-#define FLAG_color (1<<31)
-#endif
-
-#ifdef FOR_lsattr
-#ifndef TT
-#define TT this.lsattr
-#endif
-#define FLAG_R (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_l (FORCED_FLAG<<3)
-#define FLAG_v (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_lsmod
-#ifndef TT
-#define TT this.lsmod
-#endif
-#endif
-
-#ifdef FOR_lsof
-#ifndef TT
-#define TT this.lsof
-#endif
-#define FLAG_t (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#define FLAG_l (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_lspci
-#ifndef TT
-#define TT this.lspci
-#endif
-#define FLAG_i (FORCED_FLAG<<0)
-#define FLAG_n (FORCED_FLAG<<1)
-#define FLAG_k (FORCED_FLAG<<2)
-#define FLAG_m (FORCED_FLAG<<3)
-#define FLAG_e (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_lsusb
-#ifndef TT
-#define TT this.lsusb
-#endif
-#endif
-
-#ifdef FOR_makedevs
-#ifndef TT
-#define TT this.makedevs
-#endif
-#define FLAG_d (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_man
-#ifndef TT
-#define TT this.man
-#endif
-#define FLAG_M (FORCED_FLAG<<0)
-#define FLAG_k (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_mcookie
-#ifndef TT
-#define TT this.mcookie
-#endif
-#define FLAG_V (FORCED_FLAG<<0)
-#define FLAG_v (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_md5sum
-#ifndef TT
-#define TT this.md5sum
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_c (1<<1)
-#define FLAG_b (1<<2)
-#endif
-
-#ifdef FOR_mdev
-#ifndef TT
-#define TT this.mdev
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_microcom
-#ifndef TT
-#define TT this.microcom
-#endif
-#define FLAG_X (1<<0)
-#define FLAG_s (1<<1)
-#endif
-
-#ifdef FOR_mix
-#ifndef TT
-#define TT this.mix
-#endif
-#define FLAG_r (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_c (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_mkdir
-#ifndef TT
-#define TT this.mkdir
-#endif
-#define FLAG_m (1<<0)
-#define FLAG_p (1<<1)
-#define FLAG_v (1<<2)
-#define FLAG_Z (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_mke2fs
-#ifndef TT
-#define TT this.mke2fs
-#endif
-#define FLAG_b (FORCED_FLAG<<0)
-#define FLAG_i (FORCED_FLAG<<1)
-#define FLAG_N (FORCED_FLAG<<2)
-#define FLAG_m (FORCED_FLAG<<3)
-#define FLAG_q (FORCED_FLAG<<4)
-#define FLAG_n (FORCED_FLAG<<5)
-#define FLAG_F (FORCED_FLAG<<6)
-#define FLAG_g (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_mkfifo
-#ifndef TT
-#define TT this.mkfifo
-#endif
-#define FLAG_m (FORCED_FLAG<<0)
-#define FLAG_Z (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_mknod
-#ifndef TT
-#define TT this.mknod
-#endif
-#define FLAG_Z (FORCED_FLAG<<0)
-#define FLAG_m (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_mkpasswd
-#ifndef TT
-#define TT this.mkpasswd
-#endif
-#define FLAG_P (FORCED_FLAG<<0)
-#define FLAG_m (FORCED_FLAG<<1)
-#define FLAG_S (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_mkswap
-#ifndef TT
-#define TT this.mkswap
-#endif
-#define FLAG_L (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_mktemp
-#ifndef TT
-#define TT this.mktemp
-#endif
-#define FLAG_t (1<<0)
-#define FLAG_p (1<<1)
-#define FLAG_d (1<<2)
-#define FLAG_q (1<<3)
-#define FLAG_u (1<<4)
-#define FLAG_tmpdir (1<<5)
-#endif
-
-#ifdef FOR_modinfo
-#ifndef TT
-#define TT this.modinfo
-#endif
-#define FLAG_0 (FORCED_FLAG<<0)
-#define FLAG_F (FORCED_FLAG<<1)
-#define FLAG_k (FORCED_FLAG<<2)
-#define FLAG_b (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_modprobe
-#ifndef TT
-#define TT this.modprobe
-#endif
-#define FLAG_d (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_D (FORCED_FLAG<<2)
-#define FLAG_s (FORCED_FLAG<<3)
-#define FLAG_v (FORCED_FLAG<<4)
-#define FLAG_q (FORCED_FLAG<<5)
-#define FLAG_r (FORCED_FLAG<<6)
-#define FLAG_l (FORCED_FLAG<<7)
-#define FLAG_a (FORCED_FLAG<<8)
-#endif
-
-#ifdef FOR_more
-#ifndef TT
-#define TT this.more
-#endif
-#endif
-
-#ifdef FOR_mount
-#ifndef TT
-#define TT this.mount
-#endif
-#define FLAG_o (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_w (FORCED_FLAG<<2)
-#define FLAG_v (FORCED_FLAG<<3)
-#define FLAG_r (FORCED_FLAG<<4)
-#define FLAG_n (FORCED_FLAG<<5)
-#define FLAG_f (FORCED_FLAG<<6)
-#define FLAG_a (FORCED_FLAG<<7)
-#define FLAG_O (FORCED_FLAG<<8)
-#endif
-
-#ifdef FOR_mountpoint
-#ifndef TT
-#define TT this.mountpoint
-#endif
-#define FLAG_x (FORCED_FLAG<<0)
-#define FLAG_d (FORCED_FLAG<<1)
-#define FLAG_q (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_mv
-#ifndef TT
-#define TT this.mv
-#endif
-#define FLAG_i (1<<0)
-#define FLAG_f (1<<1)
-#define FLAG_F (1<<2)
-#define FLAG_n (1<<3)
-#define FLAG_v (1<<4)
-#endif
-
-#ifdef FOR_nbd_client
-#ifndef TT
-#define TT this.nbd_client
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_n (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_netcat
-#ifndef TT
-#define TT this.netcat
-#endif
-#define FLAG_U (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_6 (FORCED_FLAG<<2)
-#define FLAG_4 (FORCED_FLAG<<3)
-#define FLAG_f (FORCED_FLAG<<4)
-#define FLAG_s (FORCED_FLAG<<5)
-#define FLAG_q (FORCED_FLAG<<6)
-#define FLAG_p (FORCED_FLAG<<7)
-#define FLAG_W (FORCED_FLAG<<8)
-#define FLAG_w (FORCED_FLAG<<9)
-#define FLAG_L (FORCED_FLAG<<10)
-#define FLAG_l (FORCED_FLAG<<11)
-#define FLAG_t (FORCED_FLAG<<12)
-#endif
-
-#ifdef FOR_netstat
-#ifndef TT
-#define TT this.netstat
-#endif
-#define FLAG_l (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
-#define FLAG_e (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#define FLAG_t (FORCED_FLAG<<4)
-#define FLAG_u (FORCED_FLAG<<5)
-#define FLAG_w (FORCED_FLAG<<6)
-#define FLAG_x (FORCED_FLAG<<7)
-#define FLAG_r (FORCED_FLAG<<8)
-#define FLAG_W (FORCED_FLAG<<9)
-#define FLAG_p (FORCED_FLAG<<10)
-#endif
-
-#ifdef FOR_nice
-#ifndef TT
-#define TT this.nice
-#endif
-#define FLAG_n (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_nl
-#ifndef TT
-#define TT this.nl
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_n (FORCED_FLAG<<1)
-#define FLAG_b (FORCED_FLAG<<2)
-#define FLAG_E (FORCED_FLAG<<3)
-#define FLAG_w (FORCED_FLAG<<4)
-#define FLAG_l (FORCED_FLAG<<5)
-#define FLAG_v (FORCED_FLAG<<6)
-#endif
-
-#ifdef FOR_nohup
-#ifndef TT
-#define TT this.nohup
-#endif
-#endif
-
-#ifdef FOR_nproc
-#ifndef TT
-#define TT this.nproc
-#endif
-#define FLAG_all (1<<0)
-#endif
-
-#ifdef FOR_nsenter
-#ifndef TT
-#define TT this.nsenter
-#endif
-#define FLAG_U (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_p (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#define FLAG_m (FORCED_FLAG<<4)
-#define FLAG_i (FORCED_FLAG<<5)
-#define FLAG_t (FORCED_FLAG<<6)
-#define FLAG_F (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_od
-#ifndef TT
-#define TT this.od
-#endif
-#define FLAG_t (1<<0)
-#define FLAG_A (1<<1)
-#define FLAG_b (1<<2)
-#define FLAG_c (1<<3)
-#define FLAG_d (1<<4)
-#define FLAG_o (1<<5)
-#define FLAG_s (1<<6)
-#define FLAG_x (1<<7)
-#define FLAG_N (1<<8)
-#define FLAG_w (1<<9)
-#define FLAG_v (1<<10)
-#define FLAG_j (1<<11)
-#endif
-
-#ifdef FOR_oneit
-#ifndef TT
-#define TT this.oneit
-#endif
-#define FLAG_3 (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_openvt
-#ifndef TT
-#define TT this.openvt
-#endif
-#define FLAG_w (FORCED_FLAG<<0)
-#define FLAG_s (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_partprobe
-#ifndef TT
-#define TT this.partprobe
-#endif
-#endif
-
-#ifdef FOR_passwd
-#ifndef TT
-#define TT this.passwd
-#endif
-#define FLAG_u (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_a (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_paste
-#ifndef TT
-#define TT this.paste
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_d (1<<1)
-#endif
-
-#ifdef FOR_patch
-#ifndef TT
-#define TT this.patch
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_R (1<<1)
-#define FLAG_i (1<<2)
-#define FLAG_d (1<<3)
-#define FLAG_p (1<<4)
-#define FLAG_l (1<<5)
-#define FLAG_u (1<<6)
-#define FLAG_f (1<<7)
-#define FLAG_g (1<<8)
-#define FLAG_x (FORCED_FLAG<<9)
-#define FLAG_dry_run (1<<10)
-#define FLAG_no_backup_if_mismatch (1<<11)
-#endif
-
-#ifdef FOR_pgrep
-#ifndef TT
-#define TT this.pgrep
-#endif
-#define FLAG_L (1<<0)
-#define FLAG_x (1<<1)
-#define FLAG_v (1<<2)
-#define FLAG_o (1<<3)
-#define FLAG_n (1<<4)
-#define FLAG_f (1<<5)
-#define FLAG_G (1<<6)
-#define FLAG_g (1<<7)
-#define FLAG_P (1<<8)
-#define FLAG_s (1<<9)
-#define FLAG_t (1<<10)
-#define FLAG_U (1<<11)
-#define FLAG_u (1<<12)
-#define FLAG_d (1<<13)
-#define FLAG_l (1<<14)
-#define FLAG_c (1<<15)
-#endif
-
-#ifdef FOR_pidof
-#ifndef TT
-#define TT this.pidof
-#endif
-#define FLAG_x (FORCED_FLAG<<0)
-#define FLAG_o (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_ping
-#ifndef TT
-#define TT this.ping
-#endif
-#define FLAG_I (FORCED_FLAG<<0)
-#define FLAG_6 (FORCED_FLAG<<1)
-#define FLAG_4 (FORCED_FLAG<<2)
-#define FLAG_f (FORCED_FLAG<<3)
-#define FLAG_q (FORCED_FLAG<<4)
-#define FLAG_w (FORCED_FLAG<<5)
-#define FLAG_W (FORCED_FLAG<<6)
-#define FLAG_i (FORCED_FLAG<<7)
-#define FLAG_s (FORCED_FLAG<<8)
-#define FLAG_c (FORCED_FLAG<<9)
-#define FLAG_t (FORCED_FLAG<<10)
-#define FLAG_m (FORCED_FLAG<<11)
-#endif
-
-#ifdef FOR_pivot_root
-#ifndef TT
-#define TT this.pivot_root
-#endif
-#endif
-
-#ifdef FOR_pkill
-#ifndef TT
-#define TT this.pkill
-#endif
-#define FLAG_l (1<<0)
-#define FLAG_x (1<<1)
-#define FLAG_v (1<<2)
-#define FLAG_o (1<<3)
-#define FLAG_n (1<<4)
-#define FLAG_f (1<<5)
-#define FLAG_G (1<<6)
-#define FLAG_g (1<<7)
-#define FLAG_P (1<<8)
-#define FLAG_s (1<<9)
-#define FLAG_t (1<<10)
-#define FLAG_U (1<<11)
-#define FLAG_u (1<<12)
-#define FLAG_V (1<<13)
-#endif
-
-#ifdef FOR_pmap
-#ifndef TT
-#define TT this.pmap
-#endif
-#define FLAG_q (FORCED_FLAG<<0)
-#define FLAG_x (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_printenv
-#ifndef TT
-#define TT this.printenv
-#endif
-#define FLAG_0 (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_printf
-#ifndef TT
-#define TT this.printf
-#endif
-#endif
-
-#ifdef FOR_ps
-#ifndef TT
-#define TT this.ps
-#endif
-#define FLAG_Z (1<<0)
-#define FLAG_w (1<<1)
-#define FLAG_G (1<<2)
-#define FLAG_g (1<<3)
-#define FLAG_U (1<<4)
-#define FLAG_u (1<<5)
-#define FLAG_T (1<<6)
-#define FLAG_t (1<<7)
-#define FLAG_s (1<<8)
-#define FLAG_p (1<<9)
-#define FLAG_O (1<<10)
-#define FLAG_o (1<<11)
-#define FLAG_n (1<<12)
-#define FLAG_M (1<<13)
-#define FLAG_l (1<<14)
-#define FLAG_f (1<<15)
-#define FLAG_e (1<<16)
-#define FLAG_d (1<<17)
-#define FLAG_A (1<<18)
-#define FLAG_a (1<<19)
-#define FLAG_P (1<<20)
-#define FLAG_k (1<<21)
-#endif
-
-#ifdef FOR_pwd
-#ifndef TT
-#define TT this.pwd
-#endif
-#define FLAG_P (1<<0)
-#define FLAG_L (1<<1)
-#endif
-
-#ifdef FOR_pwdx
-#ifndef TT
-#define TT this.pwdx
-#endif
-#define FLAG_a (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_readahead
-#ifndef TT
-#define TT this.readahead
-#endif
-#endif
-
-#ifdef FOR_readlink
-#ifndef TT
-#define TT this.readlink
-#endif
-#define FLAG_f (1<<0)
-#define FLAG_e (1<<1)
-#define FLAG_m (1<<2)
-#define FLAG_q (1<<3)
-#define FLAG_n (1<<4)
-#endif
-
-#ifdef FOR_realpath
-#ifndef TT
-#define TT this.realpath
-#endif
-#endif
-
-#ifdef FOR_reboot
-#ifndef TT
-#define TT this.reboot
-#endif
-#define FLAG_n (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_renice
-#ifndef TT
-#define TT this.renice
-#endif
-#define FLAG_n (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_p (FORCED_FLAG<<2)
-#define FLAG_g (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_reset
-#ifndef TT
-#define TT this.reset
-#endif
-#endif
-
-#ifdef FOR_restorecon
-#ifndef TT
-#define TT this.restorecon
-#endif
-#define FLAG_v (FORCED_FLAG<<0)
-#define FLAG_r (FORCED_FLAG<<1)
-#define FLAG_R (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#define FLAG_F (FORCED_FLAG<<4)
-#define FLAG_D (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_rev
-#ifndef TT
-#define TT this.rev
-#endif
-#endif
-
-#ifdef FOR_rfkill
-#ifndef TT
-#define TT this.rfkill
-#endif
-#endif
-
-#ifdef FOR_rm
-#ifndef TT
-#define TT this.rm
-#endif
-#define FLAG_v (1<<0)
-#define FLAG_r (1<<1)
-#define FLAG_R (1<<2)
-#define FLAG_i (1<<3)
-#define FLAG_f (1<<4)
-#endif
-
-#ifdef FOR_rmdir
-#ifndef TT
-#define TT this.rmdir
-#endif
-#define FLAG_p (1<<0)
-#define FLAG_ignore_fail_on_non_empty (1<<1)
-#endif
-
-#ifdef FOR_rmmod
-#ifndef TT
-#define TT this.rmmod
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_w (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_route
-#ifndef TT
-#define TT this.route
-#endif
-#define FLAG_A (FORCED_FLAG<<0)
-#define FLAG_e (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_runcon
-#ifndef TT
-#define TT this.runcon
-#endif
-#endif
-
-#ifdef FOR_sed
-#ifndef TT
-#define TT this.sed
-#endif
-#define FLAG_z (1<<0)
-#define FLAG_r (1<<1)
-#define FLAG_E (1<<2)
-#define FLAG_n (1<<3)
-#define FLAG_i (1<<4)
-#define FLAG_f (1<<5)
-#define FLAG_e (1<<6)
-#define FLAG_version (1<<7)
-#define FLAG_help (1<<8)
-#endif
-
-#ifdef FOR_sendevent
-#ifndef TT
-#define TT this.sendevent
-#endif
-#endif
-
-#ifdef FOR_seq
-#ifndef TT
-#define TT this.seq
-#endif
-#define FLAG_w (1<<0)
-#define FLAG_s (1<<1)
-#define FLAG_f (1<<2)
-#endif
-
-#ifdef FOR_setenforce
-#ifndef TT
-#define TT this.setenforce
-#endif
-#endif
-
-#ifdef FOR_setfattr
-#ifndef TT
-#define TT this.setfattr
-#endif
-#define FLAG_x (FORCED_FLAG<<0)
-#define FLAG_v (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_h (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_setsid
-#ifndef TT
-#define TT this.setsid
-#endif
-#define FLAG_t (1<<0)
-#endif
-
-#ifdef FOR_sh
-#ifndef TT
-#define TT this.sh
-#endif
-#define FLAG_i (FORCED_FLAG<<0)
-#define FLAG_c (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_sha1sum
-#ifndef TT
-#define TT this.sha1sum
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_c (1<<1)
-#define FLAG_b (1<<2)
-#endif
-
-#ifdef FOR_shred
-#ifndef TT
-#define TT this.shred
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_o (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_s (FORCED_FLAG<<3)
-#define FLAG_u (FORCED_FLAG<<4)
-#define FLAG_x (FORCED_FLAG<<5)
-#define FLAG_z (FORCED_FLAG<<6)
-#endif
-
-#ifdef FOR_skeleton
-#ifndef TT
-#define TT this.skeleton
-#endif
-#define FLAG_a (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_d (FORCED_FLAG<<3)
-#define FLAG_e (FORCED_FLAG<<4)
-#define FLAG_also (FORCED_FLAG<<5)
-#define FLAG_blubber (FORCED_FLAG<<6)
-#define FLAG_walrus (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_skeleton_alias
-#ifndef TT
-#define TT this.skeleton_alias
-#endif
-#define FLAG_q (FORCED_FLAG<<0)
-#define FLAG_d (FORCED_FLAG<<1)
-#define FLAG_b (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_sleep
-#ifndef TT
-#define TT this.sleep
-#endif
-#endif
-
-#ifdef FOR_sntp
-#ifndef TT
-#define TT this.sntp
-#endif
-#define FLAG_r (FORCED_FLAG<<0)
-#define FLAG_q (FORCED_FLAG<<1)
-#define FLAG_D (FORCED_FLAG<<2)
-#define FLAG_d (FORCED_FLAG<<3)
-#define FLAG_s (FORCED_FLAG<<4)
-#define FLAG_a (FORCED_FLAG<<5)
-#define FLAG_t (FORCED_FLAG<<6)
-#define FLAG_p (FORCED_FLAG<<7)
-#define FLAG_S (FORCED_FLAG<<8)
-#define FLAG_m (FORCED_FLAG<<9)
-#define FLAG_M (FORCED_FLAG<<10)
-#endif
-
-#ifdef FOR_sort
-#ifndef TT
-#define TT this.sort
-#endif
-#define FLAG_n (1<<0)
-#define FLAG_u (1<<1)
-#define FLAG_r (1<<2)
-#define FLAG_i (1<<3)
-#define FLAG_f (1<<4)
-#define FLAG_d (1<<5)
-#define FLAG_z (1<<6)
-#define FLAG_s (1<<7)
-#define FLAG_c (1<<8)
-#define FLAG_M (1<<9)
-#define FLAG_b (1<<10)
-#define FLAG_V (1<<11)
-#define FLAG_x (1<<12)
-#define FLAG_t (1<<13)
-#define FLAG_k (1<<14)
-#define FLAG_o (1<<15)
-#define FLAG_m (1<<16)
-#define FLAG_T (1<<17)
-#define FLAG_S (1<<18)
-#define FLAG_g (1<<19)
-#endif
-
-#ifdef FOR_split
-#ifndef TT
-#define TT this.split
-#endif
-#define FLAG_l (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_a (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_stat
-#ifndef TT
-#define TT this.stat
-#endif
-#define FLAG_t (1<<0)
-#define FLAG_L (1<<1)
-#define FLAG_f (1<<2)
-#define FLAG_c (1<<3)
-#endif
-
-#ifdef FOR_strings
-#ifndef TT
-#define TT this.strings
-#endif
-#define FLAG_o (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_a (FORCED_FLAG<<3)
-#define FLAG_t (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_stty
-#ifndef TT
-#define TT this.stty
-#endif
-#define FLAG_g (FORCED_FLAG<<0)
-#define FLAG_F (FORCED_FLAG<<1)
-#define FLAG_a (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_su
-#ifndef TT
-#define TT this.su
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_c (FORCED_FLAG<<1)
-#define FLAG_g (FORCED_FLAG<<2)
-#define FLAG_u (FORCED_FLAG<<3)
-#define FLAG_p (FORCED_FLAG<<4)
-#define FLAG_m (FORCED_FLAG<<5)
-#define FLAG_l (FORCED_FLAG<<6)
-#endif
-
-#ifdef FOR_sulogin
-#ifndef TT
-#define TT this.sulogin
-#endif
-#define FLAG_t (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_swapoff
-#ifndef TT
-#define TT this.swapoff
-#endif
-#endif
-
-#ifdef FOR_swapon
-#ifndef TT
-#define TT this.swapon
-#endif
-#define FLAG_d (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_switch_root
-#ifndef TT
-#define TT this.switch_root
-#endif
-#define FLAG_h (FORCED_FLAG<<0)
-#define FLAG_c (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_sync
-#ifndef TT
-#define TT this.sync
-#endif
-#endif
-
-#ifdef FOR_sysctl
-#ifndef TT
-#define TT this.sysctl
-#endif
-#define FLAG_A (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
-#define FLAG_p (FORCED_FLAG<<2)
-#define FLAG_w (FORCED_FLAG<<3)
-#define FLAG_q (FORCED_FLAG<<4)
-#define FLAG_N (FORCED_FLAG<<5)
-#define FLAG_e (FORCED_FLAG<<6)
-#define FLAG_n (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_syslogd
-#ifndef TT
-#define TT this.syslogd
-#endif
-#define FLAG_D (FORCED_FLAG<<0)
-#define FLAG_L (FORCED_FLAG<<1)
-#define FLAG_K (FORCED_FLAG<<2)
-#define FLAG_S (FORCED_FLAG<<3)
-#define FLAG_n (FORCED_FLAG<<4)
-#define FLAG_a (FORCED_FLAG<<5)
-#define FLAG_f (FORCED_FLAG<<6)
-#define FLAG_p (FORCED_FLAG<<7)
-#define FLAG_O (FORCED_FLAG<<8)
-#define FLAG_m (FORCED_FLAG<<9)
-#define FLAG_s (FORCED_FLAG<<10)
-#define FLAG_b (FORCED_FLAG<<11)
-#define FLAG_R (FORCED_FLAG<<12)
-#define FLAG_l (FORCED_FLAG<<13)
-#endif
-
-#ifdef FOR_tac
-#ifndef TT
-#define TT this.tac
-#endif
-#endif
-
-#ifdef FOR_tail
-#ifndef TT
-#define TT this.tail
-#endif
-#define FLAG_n (1<<0)
-#define FLAG_c (1<<1)
-#define FLAG_f (1<<2)
-#endif
-
-#ifdef FOR_tar
-#ifndef TT
-#define TT this.tar
-#endif
-#define FLAG_a (1<<0)
-#define FLAG_f (1<<1)
-#define FLAG_C (1<<2)
-#define FLAG_T (1<<3)
-#define FLAG_X (1<<4)
-#define FLAG_m (1<<5)
-#define FLAG_O (1<<6)
-#define FLAG_S (1<<7)
-#define FLAG_z (1<<8)
-#define FLAG_j (1<<9)
-#define FLAG_J (1<<10)
-#define FLAG_v (1<<11)
-#define FLAG_t (1<<12)
-#define FLAG_x (1<<13)
-#define FLAG_h (1<<14)
-#define FLAG_c (1<<15)
-#define FLAG_k (1<<16)
-#define FLAG_p (1<<17)
-#define FLAG_o (1<<18)
-#define FLAG_to_command (1<<19)
-#define FLAG_owner (1<<20)
-#define FLAG_group (1<<21)
-#define FLAG_mtime (1<<22)
-#define FLAG_mode (1<<23)
-#define FLAG_exclude (1<<24)
-#define FLAG_overwrite (1<<25)
-#define FLAG_no_same_permissions (1<<26)
-#define FLAG_numeric_owner (1<<27)
-#define FLAG_no_recursion (1<<28)
-#define FLAG_full_time (1<<29)
-#define FLAG_restrict (1<<30)
-#endif
-
-#ifdef FOR_taskset
-#ifndef TT
-#define TT this.taskset
-#endif
-#define FLAG_a (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_tcpsvd
-#ifndef TT
-#define TT this.tcpsvd
-#endif
-#define FLAG_v (FORCED_FLAG<<0)
-#define FLAG_E (FORCED_FLAG<<1)
-#define FLAG_h (FORCED_FLAG<<2)
-#define FLAG_l (FORCED_FLAG<<3)
-#define FLAG_u (FORCED_FLAG<<4)
-#define FLAG_b (FORCED_FLAG<<5)
-#define FLAG_C (FORCED_FLAG<<6)
-#define FLAG_c (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_tee
-#ifndef TT
-#define TT this.tee
-#endif
-#define FLAG_a (1<<0)
-#define FLAG_i (1<<1)
-#endif
-
-#ifdef FOR_telnet
-#ifndef TT
-#define TT this.telnet
-#endif
-#endif
-
-#ifdef FOR_telnetd
-#ifndef TT
-#define TT this.telnetd
-#endif
-#define FLAG_i (FORCED_FLAG<<0)
-#define FLAG_K (FORCED_FLAG<<1)
-#define FLAG_S (FORCED_FLAG<<2)
-#define FLAG_F (FORCED_FLAG<<3)
-#define FLAG_l (FORCED_FLAG<<4)
-#define FLAG_f (FORCED_FLAG<<5)
-#define FLAG_p (FORCED_FLAG<<6)
-#define FLAG_b (FORCED_FLAG<<7)
-#define FLAG_w (FORCED_FLAG<<8)
-#endif
-
-#ifdef FOR_test
-#ifndef TT
-#define TT this.test
-#endif
-#endif
-
-#ifdef FOR_tftp
-#ifndef TT
-#define TT this.tftp
-#endif
-#define FLAG_p (FORCED_FLAG<<0)
-#define FLAG_g (FORCED_FLAG<<1)
-#define FLAG_l (FORCED_FLAG<<2)
-#define FLAG_r (FORCED_FLAG<<3)
-#define FLAG_b (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_tftpd
-#ifndef TT
-#define TT this.tftpd
-#endif
-#define FLAG_l (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_r (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_time
-#ifndef TT
-#define TT this.time
-#endif
-#define FLAG_v (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_timeout
-#ifndef TT
-#define TT this.timeout
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_k (1<<1)
-#define FLAG_v (1<<2)
-#define FLAG_preserve_status (1<<3)
-#define FLAG_foreground (1<<4)
-#endif
-
-#ifdef FOR_top
-#ifndef TT
-#define TT this.top
-#endif
-#define FLAG_q (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_m (FORCED_FLAG<<3)
-#define FLAG_d (FORCED_FLAG<<4)
-#define FLAG_s (FORCED_FLAG<<5)
-#define FLAG_u (FORCED_FLAG<<6)
-#define FLAG_p (FORCED_FLAG<<7)
-#define FLAG_o (FORCED_FLAG<<8)
-#define FLAG_k (FORCED_FLAG<<9)
-#define FLAG_H (FORCED_FLAG<<10)
-#define FLAG_O (FORCED_FLAG<<11)
-#endif
-
-#ifdef FOR_touch
-#ifndef TT
-#define TT this.touch
-#endif
-#define FLAG_h (1<<0)
-#define FLAG_t (1<<1)
-#define FLAG_r (1<<2)
-#define FLAG_m (1<<3)
-#define FLAG_f (1<<4)
-#define FLAG_d (1<<5)
-#define FLAG_c (1<<6)
-#define FLAG_a (1<<7)
-#endif
-
-#ifdef FOR_toybox
-#ifndef TT
-#define TT this.toybox
-#endif
-#endif
-
-#ifdef FOR_tr
-#ifndef TT
-#define TT this.tr
-#endif
-#define FLAG_d (1<<0)
-#define FLAG_s (1<<1)
-#define FLAG_c (1<<2)
-#define FLAG_C (1<<3)
-#endif
-
-#ifdef FOR_traceroute
-#ifndef TT
-#define TT this.traceroute
-#endif
-#define FLAG_4 (FORCED_FLAG<<0)
-#define FLAG_6 (FORCED_FLAG<<1)
-#define FLAG_F (FORCED_FLAG<<2)
-#define FLAG_U (FORCED_FLAG<<3)
-#define FLAG_I (FORCED_FLAG<<4)
-#define FLAG_l (FORCED_FLAG<<5)
-#define FLAG_d (FORCED_FLAG<<6)
-#define FLAG_n (FORCED_FLAG<<7)
-#define FLAG_v (FORCED_FLAG<<8)
-#define FLAG_r (FORCED_FLAG<<9)
-#define FLAG_m (FORCED_FLAG<<10)
-#define FLAG_p (FORCED_FLAG<<11)
-#define FLAG_q (FORCED_FLAG<<12)
-#define FLAG_s (FORCED_FLAG<<13)
-#define FLAG_t (FORCED_FLAG<<14)
-#define FLAG_w (FORCED_FLAG<<15)
-#define FLAG_g (FORCED_FLAG<<16)
-#define FLAG_z (FORCED_FLAG<<17)
-#define FLAG_f (FORCED_FLAG<<18)
-#define FLAG_i (FORCED_FLAG<<19)
-#endif
-
-#ifdef FOR_true
-#ifndef TT
-#define TT this.true
-#endif
-#endif
-
-#ifdef FOR_truncate
-#ifndef TT
-#define TT this.truncate
-#endif
-#define FLAG_c (1<<0)
-#define FLAG_s (1<<1)
-#endif
-
-#ifdef FOR_tty
-#ifndef TT
-#define TT this.tty
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_tunctl
-#ifndef TT
-#define TT this.tunctl
-#endif
-#define FLAG_T (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_t (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_ulimit
-#ifndef TT
-#define TT this.ulimit
-#endif
-#define FLAG_c (FORCED_FLAG<<0)
-#define FLAG_d (FORCED_FLAG<<1)
-#define FLAG_e (FORCED_FLAG<<2)
-#define FLAG_f (FORCED_FLAG<<3)
-#define FLAG_i (FORCED_FLAG<<4)
-#define FLAG_l (FORCED_FLAG<<5)
-#define FLAG_m (FORCED_FLAG<<6)
-#define FLAG_n (FORCED_FLAG<<7)
-#define FLAG_p (FORCED_FLAG<<8)
-#define FLAG_q (FORCED_FLAG<<9)
-#define FLAG_R (FORCED_FLAG<<10)
-#define FLAG_r (FORCED_FLAG<<11)
-#define FLAG_s (FORCED_FLAG<<12)
-#define FLAG_t (FORCED_FLAG<<13)
-#define FLAG_u (FORCED_FLAG<<14)
-#define FLAG_v (FORCED_FLAG<<15)
-#define FLAG_a (FORCED_FLAG<<16)
-#define FLAG_H (FORCED_FLAG<<17)
-#define FLAG_S (FORCED_FLAG<<18)
-#define FLAG_P (FORCED_FLAG<<19)
-#endif
-
-#ifdef FOR_umount
-#ifndef TT
-#define TT this.umount
-#endif
-#define FLAG_v (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_a (FORCED_FLAG<<2)
-#define FLAG_r (FORCED_FLAG<<3)
-#define FLAG_l (FORCED_FLAG<<4)
-#define FLAG_f (FORCED_FLAG<<5)
-#define FLAG_D (FORCED_FLAG<<6)
-#define FLAG_d (FORCED_FLAG<<7)
-#define FLAG_n (FORCED_FLAG<<8)
-#define FLAG_c (FORCED_FLAG<<9)
-#endif
-
-#ifdef FOR_uname
-#ifndef TT
-#define TT this.uname
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_n (1<<1)
-#define FLAG_r (1<<2)
-#define FLAG_v (1<<3)
-#define FLAG_m (1<<4)
-#define FLAG_a (1<<5)
-#define FLAG_o (1<<6)
-#endif
-
-#ifdef FOR_uniq
-#ifndef TT
-#define TT this.uniq
-#endif
-#define FLAG_u (1<<0)
-#define FLAG_d (1<<1)
-#define FLAG_c (1<<2)
-#define FLAG_i (1<<3)
-#define FLAG_z (1<<4)
-#define FLAG_w (1<<5)
-#define FLAG_s (1<<6)
-#define FLAG_f (1<<7)
-#endif
-
-#ifdef FOR_unix2dos
-#ifndef TT
-#define TT this.unix2dos
-#endif
-#endif
-
-#ifdef FOR_unlink
-#ifndef TT
-#define TT this.unlink
-#endif
-#endif
-
-#ifdef FOR_unshare
-#ifndef TT
-#define TT this.unshare
-#endif
-#define FLAG_U (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_p (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#define FLAG_m (FORCED_FLAG<<4)
-#define FLAG_i (FORCED_FLAG<<5)
-#define FLAG_r (FORCED_FLAG<<6)
-#define FLAG_f (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_uptime
-#ifndef TT
-#define TT this.uptime
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_useradd
-#ifndef TT
-#define TT this.useradd
-#endif
-#define FLAG_H (FORCED_FLAG<<0)
-#define FLAG_D (FORCED_FLAG<<1)
-#define FLAG_S (FORCED_FLAG<<2)
-#define FLAG_h (FORCED_FLAG<<3)
-#define FLAG_g (FORCED_FLAG<<4)
-#define FLAG_s (FORCED_FLAG<<5)
-#define FLAG_G (FORCED_FLAG<<6)
-#define FLAG_u (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_userdel
-#ifndef TT
-#define TT this.userdel
-#endif
-#define FLAG_r (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_usleep
-#ifndef TT
-#define TT this.usleep
-#endif
-#endif
-
-#ifdef FOR_uudecode
-#ifndef TT
-#define TT this.uudecode
-#endif
-#define FLAG_o (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_uuencode
-#ifndef TT
-#define TT this.uuencode
-#endif
-#define FLAG_m (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_uuidgen
-#ifndef TT
-#define TT this.uuidgen
-#endif
-#define FLAG_r (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_vconfig
-#ifndef TT
-#define TT this.vconfig
-#endif
-#endif
-
-#ifdef FOR_vi
-#ifndef TT
-#define TT this.vi
-#endif
-#endif
-
-#ifdef FOR_vmstat
-#ifndef TT
-#define TT this.vmstat
-#endif
-#define FLAG_n (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_w
-#ifndef TT
-#define TT this.w
-#endif
-#endif
-
-#ifdef FOR_watch
-#ifndef TT
-#define TT this.watch
-#endif
-#define FLAG_x (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_e (FORCED_FLAG<<2)
-#define FLAG_t (FORCED_FLAG<<3)
-#define FLAG_n (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_wc
-#ifndef TT
-#define TT this.wc
-#endif
-#define FLAG_l (1<<0)
-#define FLAG_w (1<<1)
-#define FLAG_c (1<<2)
-#define FLAG_m (1<<3)
-#endif
-
-#ifdef FOR_wget
-#ifndef TT
-#define TT this.wget
-#endif
-#define FLAG_O (FORCED_FLAG<<0)
-#define FLAG_no_check_certificate (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_which
-#ifndef TT
-#define TT this.which
-#endif
-#define FLAG_a (1<<0)
-#endif
-
-#ifdef FOR_who
-#ifndef TT
-#define TT this.who
-#endif
-#define FLAG_a (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_xargs
-#ifndef TT
-#define TT this.xargs
-#endif
-#define FLAG_0 (1<<0)
-#define FLAG_s (1<<1)
-#define FLAG_n (1<<2)
-#define FLAG_r (1<<3)
-#define FLAG_t (1<<4)
-#define FLAG_p (1<<5)
-#define FLAG_o (1<<6)
-#define FLAG_P (1<<7)
-#define FLAG_E (1<<8)
-#endif
-
-#ifdef FOR_xxd
-#ifndef TT
-#define TT this.xxd
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_r (1<<1)
-#define FLAG_p (1<<2)
-#define FLAG_i (1<<3)
-#define FLAG_g (1<<4)
-#define FLAG_o (1<<5)
-#define FLAG_l (1<<6)
-#define FLAG_c (1<<7)
-#endif
-
-#ifdef FOR_xzcat
-#ifndef TT
-#define TT this.xzcat
-#endif
-#endif
-
-#ifdef FOR_yes
-#ifndef TT
-#define TT this.yes
-#endif
-#endif
-
-#ifdef FOR_zcat
-#ifndef TT
-#define TT this.zcat
-#endif
-#define FLAG_9 (FORCED_FLAG<<0)
-#define FLAG_8 (FORCED_FLAG<<1)
-#define FLAG_7 (FORCED_FLAG<<2)
-#define FLAG_6 (FORCED_FLAG<<3)
-#define FLAG_5 (FORCED_FLAG<<4)
-#define FLAG_4 (FORCED_FLAG<<5)
-#define FLAG_3 (FORCED_FLAG<<6)
-#define FLAG_2 (FORCED_FLAG<<7)
-#define FLAG_1 (FORCED_FLAG<<8)
-#define FLAG_k (FORCED_FLAG<<9)
-#define FLAG_f (FORCED_FLAG<<10)
-#define FLAG_d (FORCED_FLAG<<11)
-#define FLAG_c (FORCED_FLAG<<12)
-#endif
-
diff --git a/android/linux/generated/globals.h b/android/linux/generated/globals.h
deleted file mode 100644
index 04334b61..00000000
--- a/android/linux/generated/globals.h
+++ /dev/null
@@ -1,1576 +0,0 @@
-// toys/android/log.c
-
-struct log_data {
- char *t, *p;
-};
-
-// toys/example/demo_number.c
-
-struct demo_number_data {
- long D;
-};
-
-// toys/example/hello.c
-
-struct hello_data {
- int unused;
-};
-
-// toys/example/skeleton.c
-
-struct skeleton_data {
- union {
- struct {
- char *b;
- long c;
- struct arg_list *d;
- long e;
- char *also, *blubber;
- } s;
- struct {
- long b;
- } a;
- };
-
- int more_globals;
-};
-
-// toys/lsb/dmesg.c
-
-struct dmesg_data {
- long n, s;
-
- int use_color;
- time_t tea;
-};
-
-// toys/lsb/gzip.c
-
-struct gzip_data {
- int level;
-};
-
-// toys/lsb/hostname.c
-
-struct hostname_data {
- char *F;
-};
-
-// toys/lsb/killall.c
-
-struct killall_data {
- char *s;
-
- int signum;
- pid_t cur_pid;
- char **names;
- short *err;
- struct int_list { struct int_list *next; int val; } *pids;
-};
-
-// toys/lsb/md5sum.c
-
-struct md5sum_data {
- int sawline;
-
- // Crypto variables blanked after summing
- unsigned state[5];
- unsigned oldstate[5];
- uint64_t count;
- union {
- char c[64];
- unsigned i[16];
- } buffer;
-};
-
-// toys/lsb/mknod.c
-
-struct mknod_data {
- char *Z, *m;
-};
-
-// toys/lsb/mktemp.c
-
-struct mktemp_data {
- char *p, *tmpdir;
-};
-
-// toys/lsb/mount.c
-
-struct mount_data {
- struct arg_list *optlist;
- char *type;
- char *bigO;
-
- unsigned long flags;
- char *opts;
- int okuser;
-};
-
-// toys/lsb/passwd.c
-
-struct passwd_data {
- char *a;
-};
-
-// toys/lsb/pidof.c
-
-struct pidof_data {
- char *omit;
-};
-
-// toys/lsb/seq.c
-
-struct seq_data {
- char *s, *f;
-
- int precision;
-};
-
-// toys/lsb/su.c
-
-struct su_data {
- char *s;
- char *c;
-};
-
-// toys/lsb/umount.c
-
-struct umount_data {
- struct arg_list *t;
-
- char *types;
-};
-
-// toys/net/ftpget.c
-
-struct ftpget_data {
- char *u, *p, *P;
-
- int fd;
-};
-
-// toys/net/ifconfig.c
-
-struct ifconfig_data {
- int sockfd;
-};
-
-// toys/net/microcom.c
-
-struct microcom_data {
- char *s;
-
- int fd;
- struct termios original_stdin_state, original_fd_state;
-};
-
-// toys/net/netcat.c
-
-struct netcat_data {
- char *f, *s;
- long q, p, W, w;
-};
-
-// toys/net/netstat.c
-
-struct netstat_data {
- struct num_cache *inodes;
- int wpad;
-};;
-
-// toys/net/ping.c
-
-struct ping_data {
- char *I;
- long w, W, i, s, c, t, m;
-
- struct sockaddr *sa;
- int sock;
- unsigned long sent, recv, fugit, min, max;
-};
-
-// toys/net/sntp.c
-
-struct sntp_data {
- long r, t;
- char *p, *m, *M;
-};
-
-// toys/net/tunctl.c
-
-struct tunctl_data {
- char *u;
-};
-
-// toys/other/acpi.c
-
-struct acpi_data {
- int ac, bat, therm, cool;
- char *cpath;
-};
-
-// toys/other/base64.c
-
-struct base64_data {
- long w;
-
- unsigned total;
-};
-
-// toys/other/blkid.c
-
-struct blkid_data {
- struct arg_list *s;
-};
-
-// toys/other/blockdev.c
-
-struct blockdev_data {
- long setbsz, setra;
-};
-
-// toys/other/chrt.c
-
-struct chrt_data {
- long p;
-};
-
-// toys/other/dos2unix.c
-
-struct dos2unix_data {
- char *tempfile;
-};
-
-// toys/other/fallocate.c
-
-struct fallocate_data {
- long offset;
- long size;
-};
-
-// toys/other/fmt.c
-
-struct fmt_data {
- int width;
-
- int level, pos;
-};
-
-// toys/other/free.c
-
-struct free_data {
- unsigned bits;
- unsigned long long units;
- char *buf;
-};
-
-// toys/other/hexedit.c
-
-struct hexedit_data {
- char *data;
- long long len, base;
- int numlen, undo, undolen;
- unsigned height;
-};
-
-// toys/other/hwclock.c
-
-struct hwclock_data {
- char *f;
-
- int utc;
-};
-
-// toys/other/ionice.c
-
-struct ionice_data {
- long pid;
- long level;
- long class;
-};
-
-// toys/other/login.c
-
-struct login_data {
- char *h, *f;
-
- int login_timeout, login_fail_timeout;
-};
-
-// toys/other/losetup.c
-
-struct losetup_data {
- char *j;
- long o, S;
-
- int openflags;
- dev_t jdev;
- ino_t jino;
- char *dir;
-};
-
-// toys/other/lspci.c
-
-struct lspci_data {
- char *i;
- long n;
-
- FILE *db;
-};
-
-// toys/other/makedevs.c
-
-struct makedevs_data {
- char *d;
-};
-
-// toys/other/mix.c
-
-struct mix_data {
- long r, l;
- char *d, *c;
-};
-
-// toys/other/mkpasswd.c
-
-struct mkpasswd_data {
- long P;
- char *m, *S;
-};
-
-// toys/other/mkswap.c
-
-struct mkswap_data {
- char *L;
-};
-
-// toys/other/modinfo.c
-
-struct modinfo_data {
- char *F, *k, *b;
-
- long mod;
- int count;
-};
-
-// toys/other/nsenter.c
-
-struct nsenter_data {
- char *Uupnmi[6];
- long t;
-};
-
-// toys/other/oneit.c
-
-struct oneit_data {
- char *c;
-};
-
-// toys/other/setfattr.c
-
-struct setfattr_data {
- char *x, *v, *n;
-};
-
-// toys/other/shred.c
-
-struct shred_data {
- long o, n, s;
-};
-
-// toys/other/stat.c
-
-struct stat_data {
- char *c;
-
- union {
- struct stat st;
- struct statfs sf;
- } stat;
- char *file, *pattern;
- int patlen;
-};
-
-// toys/other/swapon.c
-
-struct swapon_data {
- long p;
-};
-
-// toys/other/switch_root.c
-
-struct switch_root_data {
- char *c;
-
- dev_t rootdev;
-};
-
-// toys/other/tac.c
-
-struct tac_data {
- struct double_list *dl;
-};
-
-// toys/other/timeout.c
-
-struct timeout_data {
- char *s, *k;
-
- int nextsig;
- pid_t pid;
- struct timeval ktv;
- struct itimerval itv;
-};
-
-// toys/other/truncate.c
-
-struct truncate_data {
- char *s;
-
- long size;
- int type;
-};
-
-// toys/other/watch.c
-
-struct watch_data {
- int n;
-
- pid_t pid, oldpid;
-};
-
-// toys/other/xxd.c
-
-struct xxd_data {
- long s, g, o, l, c;
-};
-
-// toys/pending/arp.c
-
-struct arp_data {
- char *hw_type;
- char *af_type_A;
- char *af_type_p;
- char *interface;
-
- int sockfd;
- char *device;
-};
-
-// toys/pending/arping.c
-
-struct arping_data {
- long count;
- unsigned long time_out;
- char *iface;
- char *src_ip;
-
- int sockfd;
- unsigned long start, end;
- unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
- unicast_flag;
-};
-
-// toys/pending/bc.c
-
-struct bc_data {
- // This actually needs to be a BcVm*, but the toybox build
- // system complains if I make it so. Instead, we'll just cast.
- char *vm;
-
- size_t nchars;
- char *file, sig, max_ibase;
- uint16_t line_len;
-};
-
-// toys/pending/bootchartd.c
-
-struct bootchartd_data {
- char buf[32];
- long smpl_period_usec;
- int proc_accounting;
- int is_login;
-
- pid_t cur_pid;
-};
-
-// toys/pending/brctl.c
-
-struct brctl_data {
- int sockfd;
-};
-
-// toys/pending/crond.c
-
-struct crond_data {
- char *crontabs_dir;
- char *logfile;
- int loglevel_d;
- int loglevel;
-
- time_t crontabs_dir_mtime;
- uint8_t flagd;
-};
-
-// toys/pending/crontab.c
-
-struct crontab_data {
- char *user;
- char *cdir;
-};
-
-// toys/pending/dd.c
-
-struct dd_data {
- int show_xfer, show_records;
- unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
- struct timeval start;
- struct {
- char *name;
- int fd;
- unsigned char *buff, *bp;
- long sz, count;
- unsigned long long offset;
- } in, out;
- unsigned conv, iflag, oflag;
-};;
-
-// toys/pending/dhcp.c
-
-struct dhcp_data {
- char *iface;
- char *pidfile;
- char *script;
- long retries;
- long timeout;
- long tryagain;
- struct arg_list *req_opt;
- char *req_ip;
- struct arg_list *pkt_opt;
- char *fdn_name;
- char *hostname;
- char *vendor_cls;
-};
-
-// toys/pending/dhcp6.c
-
-struct dhcp6_data {
- char *interface_name, *pidfile, *script;
- long retry, timeout, errortimeout;
- char *req_ip;
- int length, state, request_length, sock, sock1, status, retval, retries;
- struct timeval tv;
- uint8_t transction_id[3];
- struct sockaddr_in6 input_socket6;
-};
-
-// toys/pending/dhcpd.c
-
-struct dhcpd_data {
- char *iface;
- long port;
-};;
-
-// toys/pending/diff.c
-
-struct diff_data {
- long ct;
- char *start;
- struct arg_list *L_list;
-
- int dir_num, size, is_binary, status, change, len[2];
- int *offset[2];
- struct stat st[2];
-};
-
-// toys/pending/dumpleases.c
-
-struct dumpleases_data {
- char *file;
-};
-
-// toys/pending/expr.c
-
-struct expr_data {
- char **tok; // current token, not on the stack since recursive calls mutate it
-
- char *refree;
-};
-
-// toys/pending/fdisk.c
-
-struct fdisk_data {
- long sect_sz;
- long sectors;
- long heads;
- long cylinders;
-};
-
-// toys/pending/fold.c
-
-struct fold_data {
- int width;
-};
-
-// toys/pending/fsck.c
-
-struct fsck_data {
- int fd_num;
- char *t_list;
-
- struct double_list *devices;
- char *arr_flag;
- char **arr_type;
- int negate;
- int sum_status;
- int nr_run;
- int sig_num;
- long max_nr_run;
-};
-
-// toys/pending/getfattr.c
-
-struct getfattr_data {
- char *n;
-};
-
-// toys/pending/getty.c
-
-struct getty_data {
- char *issue_str;
- char *login_str;
- char *init_str;
- char *host_str;
- long timeout;
-
- char *tty_name;
- int speeds[20];
- int sc;
- struct termios termios;
- char buff[128];
-};
-
-// toys/pending/groupadd.c
-
-struct groupadd_data {
- long gid;
-};
-
-// toys/pending/host.c
-
-struct host_data {
- char *type_str;
-};
-
-// toys/pending/ip.c
-
-struct ip_data {
- char stats, singleline, flush, *filter_dev, gbuf[8192];
- int sockfd, connected, from_ok, route_cmd;
- int8_t addressfamily, is_addr;
-};
-
-// toys/pending/ipcrm.c
-
-struct ipcrm_data {
- struct arg_list *qkey;
- struct arg_list *qid;
- struct arg_list *skey;
- struct arg_list *sid;
- struct arg_list *mkey;
- struct arg_list *mid;
-};
-
-// toys/pending/ipcs.c
-
-struct ipcs_data {
- int id;
-};
-
-// toys/pending/klogd.c
-
-struct klogd_data {
- long level;
-
- int fd;
-};
-
-// toys/pending/last.c
-
-struct last_data {
- char *file;
-
- struct arg_list *list;
-};
-
-// toys/pending/lsof.c
-
-struct lsof_data {
- struct arg_list *p;
-
- struct stat *sought_files;
- struct double_list *all_sockets, *files;
- int last_shown_pid, shown_header;
-};
-
-// toys/pending/man.c
-
-struct man_data {
- char *M, *k;
-
- char any, cell, ex, *f, k_done, *line, *m, **sct, **scts, **sufs;
- regex_t reg;
-};
-
-// toys/pending/mke2fs.c
-
-struct mke2fs_data {
- // Command line arguments.
- long blocksize;
- long bytes_per_inode;
- long inodes; // Total inodes in filesystem.
- long reserved_percent; // Integer precent of space to reserve for root.
- char *gendir; // Where to read dirtree from.
-
- // Internal data.
- struct dirtree *dt; // Tree of files to copy into the new filesystem.
- unsigned treeblocks; // Blocks used by dt
- unsigned treeinodes; // Inodes used by dt
-
- unsigned blocks; // Total blocks in the filesystem.
- unsigned freeblocks; // Free blocks in the filesystem.
- unsigned inodespg; // Inodes per group
- unsigned groups; // Total number of block groups.
- unsigned blockbits; // Bits per block. (Also blocks per group.)
-
- // For gene2fs
- unsigned nextblock; // Next data block to allocate
- unsigned nextgroup; // Next group we'll be allocating from
- int fsfd; // File descriptor of filesystem (to output to).
-};
-
-// toys/pending/modprobe.c
-
-struct modprobe_data {
- struct arg_list *dirs;
-
- struct arg_list *probes;
- struct arg_list *dbase[256];
- char *cmdopts;
- int nudeps;
- uint8_t symreq;
-};
-
-// toys/pending/more.c
-
-struct more_data {
- struct termios inf;
- int cin_fd;
-};
-
-// toys/pending/openvt.c
-
-struct openvt_data {
- unsigned long vt_num;
-};
-
-// toys/pending/route.c
-
-struct route_data {
- char *family;
-};
-
-// toys/pending/sh.c
-
-struct sh_data {
- char *command;
-
- long lineno;
-
- struct double_list functions;
- unsigned options;
-
- // Running jobs.
- struct sh_job {
- struct sh_job *next, *prev;
- unsigned jobno;
-
- // Every pipeline has at least one set of arguments or it's Not A Thing
- struct sh_arg {
- char **v;
- int c;
- } pipeline;
-
- // null terminated array of running processes in pipeline
- struct sh_process {
- struct string_list *delete; // expanded strings
- int pid, exit; // status? Stopped? Exited?
- struct sh_arg arg;
- } *procs, *proc;
- } *jobs, *job;
- unsigned jobcnt;
-};
-
-// toys/pending/stty.c
-
-struct stty_data {
- char *device;
-
- int fd, col;
- unsigned output_cols;
-};
-
-// toys/pending/sulogin.c
-
-struct sulogin_data {
- long timeout;
- struct termios crntio;
-};
-
-// toys/pending/syslogd.c
-
-struct syslogd_data {
- char *socket;
- char *config_file;
- char *unix_socket;
- char *logfile;
- long interval;
- long rot_size;
- long rot_count;
- char *remote_log;
- long log_prio;
-
- struct unsocks *lsocks; // list of listen sockets
- struct logfile *lfiles; // list of write logfiles
- int sigfd[2];
-};
-
-// toys/pending/tcpsvd.c
-
-struct tcpsvd_data {
- char *name;
- char *user;
- long bn;
- char *nmsg;
- long cn;
-
- int maxc;
- int count_all;
- int udp;
-};
-
-// toys/pending/telnet.c
-
-struct telnet_data {
- int port;
- int sfd;
- char buff[128];
- int pbuff;
- char iac[256];
- int piac;
- char *ttype;
- struct termios def_term;
- struct termios raw_term;
- uint8_t term_ok;
- uint8_t term_mode;
- uint8_t flags;
- unsigned win_width;
- unsigned win_height;
-};
-
-// toys/pending/telnetd.c
-
-struct telnetd_data {
- char *login_path;
- char *issue_path;
- int port;
- char *host_addr;
- long w_sec;
-
- int gmax_fd;
- pid_t fork_pid;
-};
-
-// toys/pending/tftp.c
-
-struct tftp_data {
- char *local_file;
- char *remote_file;
- long block_size;
-
- struct sockaddr_storage inaddr;
- int af;
-};
-
-// toys/pending/tftpd.c
-
-struct tftpd_data {
- char *user;
-
- long sfd;
- struct passwd *pw;
-};
-
-// toys/pending/tr.c
-
-struct tr_data {
- short map[256]; //map of chars
- int len1, len2;
-};
-
-// toys/pending/traceroute.c
-
-struct traceroute_data {
- long max_ttl;
- long port;
- long ttl_probes;
- char *src_ip;
- long tos;
- long wait_time;
- struct arg_list *loose_source;
- long pause_time;
- long first_ttl;
- char *iface;
-
- uint32_t gw_list[9];
- int recv_sock;
- int snd_sock;
- unsigned msg_len;
- char *packet;
- uint32_t ident;
- int istraceroute6;
-};
-
-// toys/pending/useradd.c
-
-struct useradd_data {
- char *dir;
- char *gecos;
- char *shell;
- char *u_grp;
- long uid;
-
- long gid;
-};
-
-// toys/pending/vi.c
-
-struct vi_data {
- int cur_col;
- int cur_row;
- int scr_row;
- int drawn_row;
- int drawn_col;
- unsigned screen_height;
- unsigned screen_width;
- int vi_mode;
- int count0;
- int count1;
- int vi_mov_flag;
- int modified;
- char vi_reg;
- char *last_search;
- int tabstop;
- int list;
-};
-
-// toys/pending/wget.c
-
-struct wget_data {
- char *filename;
-};
-
-// toys/posix/basename.c
-
-struct basename_data {
- char *s;
-};
-
-// toys/posix/chgrp.c
-
-struct chgrp_data {
- uid_t owner;
- gid_t group;
- char *owner_name, *group_name;
- int symfollow;
-};
-
-// toys/posix/chmod.c
-
-struct chmod_data {
- char *mode;
-};
-
-// toys/posix/cksum.c
-
-struct cksum_data {
- unsigned crc_table[256];
-};
-
-// toys/posix/cmp.c
-
-struct cmp_data {
- int fd;
- char *name;
-};
-
-// toys/posix/cp.c
-
-struct cp_data {
- union {
- // install's options
- struct {
- char *g, *o, *m;
- } i;
- // cp's options
- struct {
- char *preserve;
- } c;
- };
-
- char *destname;
- struct stat top;
- int (*callback)(struct dirtree *try);
- uid_t uid;
- gid_t gid;
- int pflags;
-};
-
-// toys/posix/cpio.c
-
-struct cpio_data {
- char *F, *p, *H;
-};
-
-// toys/posix/cut.c
-
-struct cut_data {
- char *d, *O;
- struct arg_list *select[5]; // we treat them the same, so loop through
-
- int pairs;
- regex_t reg;
-};
-
-// toys/posix/date.c
-
-struct date_data {
- char *r, *D, *d;
-
- unsigned nano;
-};
-
-// toys/posix/df.c
-
-struct df_data {
- struct arg_list *t;
-
- long units;
- int column_widths[5];
- int header_shown;
-};
-
-// toys/posix/du.c
-
-struct du_data {
- long d;
-
- unsigned long depth, total;
- dev_t st_dev;
- void *inodes;
-};
-
-// toys/posix/env.c
-
-struct env_data {
- struct arg_list *u;
-};;
-
-// toys/posix/expand.c
-
-struct expand_data {
- struct arg_list *t;
-
- unsigned tabcount, *tab;
-};
-
-// toys/posix/file.c
-
-struct file_data {
- int max_name_len;
-
- off_t len;
-};
-
-// toys/posix/find.c
-
-struct find_data {
- char **filter;
- struct double_list *argdata;
- int topdir, xdev, depth;
- time_t now;
- long max_bytes;
- char *start;
-};
-
-// toys/posix/grep.c
-
-struct grep_data {
- long m, A, B, C;
- struct arg_list *f, *e, *M, *S, *exclude_dir;
- char *color;
-
- char *purple, *cyan, *red, *green, *grey;
- struct double_list *reg;
- char indelim, outdelim;
- int found, tried;
-};
-
-// toys/posix/head.c
-
-struct head_data {
- long c, n;
-
- int file_no;
-};
-
-// toys/posix/iconv.c
-
-struct iconv_data {
- char *f, *t;
-
- void *ic;
-};
-
-// toys/posix/id.c
-
-struct id_data {
- int is_groups;
-};
-
-// toys/posix/kill.c
-
-struct kill_data {
- char *s;
- struct arg_list *o;
-};
-
-// toys/posix/ln.c
-
-struct ln_data {
- char *t;
-};
-
-// toys/posix/logger.c
-
-struct logger_data {
- char *p, *t;
-};
-
-// toys/posix/ls.c
-
-struct ls_data {
- long l;
- char *color;
-
- struct dirtree *files, *singledir;
- unsigned screen_width;
- int nl_title;
- char *escmore;
-};
-
-// toys/posix/mkdir.c
-
-struct mkdir_data {
- char *m, *Z;
-};
-
-// toys/posix/mkfifo.c
-
-struct mkfifo_data {
- char *m;
- char *Z;
-
- mode_t mode;
-};
-
-// toys/posix/nice.c
-
-struct nice_data {
- long n;
-};
-
-// toys/posix/nl.c
-
-struct nl_data {
- char *s, *n, *b;
- long w, l, v;
-
- // Count of consecutive blank lines for -l has to persist between files
- long lcount;
- long slen;
-};
-
-// toys/posix/od.c
-
-struct od_data {
- struct arg_list *t;
- char *A;
- long N, w, j;
-
- int address_idx;
- unsigned types, leftover, star;
- char *buf; // Points to buffers[0] or buffers[1].
- char *bufs[2]; // Used to detect duplicate lines.
- off_t pos;
-};
-
-// toys/posix/paste.c
-
-struct paste_data {
- char *d;
-
- int files;
-};
-
-// toys/posix/patch.c
-
-struct patch_data {
- char *i, *d;
- long p, g;
-
- struct double_list *current_hunk;
- long oldline, oldlen, newline, newlen;
- long linenum;
- int context, state, filein, fileout, filepatch, hunknum;
- char *tempname;
-};
-
-// toys/posix/ps.c
-
-struct ps_data {
- union {
- struct {
- struct arg_list *G, *g, *U, *u, *t, *s, *p, *O, *o, *P, *k;
- } ps;
- struct {
- long n, m, d, s;
- struct arg_list *u, *p, *o, *k, *O;
- } top;
- struct {
- char *L;
- struct arg_list *G, *g, *P, *s, *t, *U, *u;
- char *d;
-
- void *regexes, *snapshot;
- int signal;
- pid_t self, match;
- } pgrep;
- };
-
- struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
- struct dirtree *threadparent;
- unsigned width, height;
- dev_t tty;
- void *fields, *kfields;
- long long ticks, bits, time;
- int kcount, forcek, sortpos;
- int (*match_process)(long long *slot);
- void (*show_process)(void *tb);
-};
-
-// toys/posix/renice.c
-
-struct renice_data {
- long n;
-};
-
-// toys/posix/sed.c
-
-struct sed_data {
- char *i;
- struct arg_list *f, *e;
-
- // processed pattern list
- struct double_list *pattern;
-
- char *nextline, *remember;
- void *restart, *lastregex;
- long nextlen, rememberlen, count;
- int fdout, noeol;
- unsigned xx;
- char delim;
-};
-
-// toys/posix/sort.c
-
-struct sort_data {
- char *t;
- struct arg_list *k;
- char *o, *T, S;
-
- void *key_list;
- int linecount;
- char **lines;
- char *name;
-};
-
-// toys/posix/split.c
-
-struct split_data {
- long l, b, a;
-
- char *outfile;
-};
-
-// toys/posix/strings.c
-
-struct strings_data {
- long n;
- char *t;
-};
-
-// toys/posix/tail.c
-
-struct tail_data {
- long n, c;
-
- int file_no, last_fd;
- struct xnotify *not;
-};
-
-// toys/posix/tar.c
-
-struct tar_data {
- char *f, *C;
- struct arg_list *T, *X;
- char *to_command, *owner, *group, *mtime, *mode;
- struct arg_list *exclude;
-
- struct double_list *incl, *excl, *seen;
- struct string_list *dirs;
- char *cwd;
- int fd, ouid, ggid, hlc, warn, adev, aino, sparselen;
- long long *sparse;
- time_t mtt;
-
- // hardlinks seen so far (hlc many)
- struct {
- char *arg;
- ino_t ino;
- dev_t dev;
- } *hlx;
-
- // Parsed information about a tar header.
- struct tar_header {
- char *name, *link_target, *uname, *gname;
- long long size, ssize;
- uid_t uid;
- gid_t gid;
- mode_t mode;
- time_t mtime;
- dev_t device;
- } hdr;
-};
-
-// toys/posix/tee.c
-
-struct tee_data {
- void *outputs;
-};
-
-// toys/posix/touch.c
-
-struct touch_data {
- char *t, *r, *d;
-};
-
-// toys/posix/ulimit.c
-
-struct ulimit_data {
- long P;
-};
-
-// toys/posix/uniq.c
-
-struct uniq_data {
- long w, s, f;
-
- long repeats;
-};
-
-// toys/posix/uudecode.c
-
-struct uudecode_data {
- char *o;
-};
-
-// toys/posix/wc.c
-
-struct wc_data {
- unsigned long totals[4];
-};
-
-// toys/posix/xargs.c
-
-struct xargs_data {
- long s, n, P;
- char *E;
-
- long entries, bytes;
- char delim;
- FILE *tty;
-};
-
-extern union global_union {
- struct log_data log;
- struct demo_number_data demo_number;
- struct hello_data hello;
- struct skeleton_data skeleton;
- struct dmesg_data dmesg;
- struct gzip_data gzip;
- struct hostname_data hostname;
- struct killall_data killall;
- struct md5sum_data md5sum;
- struct mknod_data mknod;
- struct mktemp_data mktemp;
- struct mount_data mount;
- struct passwd_data passwd;
- struct pidof_data pidof;
- struct seq_data seq;
- struct su_data su;
- struct umount_data umount;
- struct ftpget_data ftpget;
- struct ifconfig_data ifconfig;
- struct microcom_data microcom;
- struct netcat_data netcat;
- struct netstat_data netstat;
- struct ping_data ping;
- struct sntp_data sntp;
- struct tunctl_data tunctl;
- struct acpi_data acpi;
- struct base64_data base64;
- struct blkid_data blkid;
- struct blockdev_data blockdev;
- struct chrt_data chrt;
- struct dos2unix_data dos2unix;
- struct fallocate_data fallocate;
- struct fmt_data fmt;
- struct free_data free;
- struct hexedit_data hexedit;
- struct hwclock_data hwclock;
- struct ionice_data ionice;
- struct login_data login;
- struct losetup_data losetup;
- struct lspci_data lspci;
- struct makedevs_data makedevs;
- struct mix_data mix;
- struct mkpasswd_data mkpasswd;
- struct mkswap_data mkswap;
- struct modinfo_data modinfo;
- struct nsenter_data nsenter;
- struct oneit_data oneit;
- struct setfattr_data setfattr;
- struct shred_data shred;
- struct stat_data stat;
- struct swapon_data swapon;
- struct switch_root_data switch_root;
- struct tac_data tac;
- struct timeout_data timeout;
- struct truncate_data truncate;
- struct watch_data watch;
- struct xxd_data xxd;
- struct arp_data arp;
- struct arping_data arping;
- struct bc_data bc;
- struct bootchartd_data bootchartd;
- struct brctl_data brctl;
- struct crond_data crond;
- struct crontab_data crontab;
- struct dd_data dd;
- struct dhcp_data dhcp;
- struct dhcp6_data dhcp6;
- struct dhcpd_data dhcpd;
- struct diff_data diff;
- struct dumpleases_data dumpleases;
- struct expr_data expr;
- struct fdisk_data fdisk;
- struct fold_data fold;
- struct fsck_data fsck;
- struct getfattr_data getfattr;
- struct getty_data getty;
- struct groupadd_data groupadd;
- struct host_data host;
- struct ip_data ip;
- struct ipcrm_data ipcrm;
- struct ipcs_data ipcs;
- struct klogd_data klogd;
- struct last_data last;
- struct lsof_data lsof;
- struct man_data man;
- struct mke2fs_data mke2fs;
- struct modprobe_data modprobe;
- struct more_data more;
- struct openvt_data openvt;
- struct route_data route;
- struct sh_data sh;
- struct stty_data stty;
- struct sulogin_data sulogin;
- struct syslogd_data syslogd;
- struct tcpsvd_data tcpsvd;
- struct telnet_data telnet;
- struct telnetd_data telnetd;
- struct tftp_data tftp;
- struct tftpd_data tftpd;
- struct tr_data tr;
- struct traceroute_data traceroute;
- struct useradd_data useradd;
- struct vi_data vi;
- struct wget_data wget;
- struct basename_data basename;
- struct chgrp_data chgrp;
- struct chmod_data chmod;
- struct cksum_data cksum;
- struct cmp_data cmp;
- struct cp_data cp;
- struct cpio_data cpio;
- struct cut_data cut;
- struct date_data date;
- struct df_data df;
- struct du_data du;
- struct env_data env;
- struct expand_data expand;
- struct file_data file;
- struct find_data find;
- struct grep_data grep;
- struct head_data head;
- struct iconv_data iconv;
- struct id_data id;
- struct kill_data kill;
- struct ln_data ln;
- struct logger_data logger;
- struct ls_data ls;
- struct mkdir_data mkdir;
- struct mkfifo_data mkfifo;
- struct nice_data nice;
- struct nl_data nl;
- struct od_data od;
- struct paste_data paste;
- struct patch_data patch;
- struct ps_data ps;
- struct renice_data renice;
- struct sed_data sed;
- struct sort_data sort;
- struct split_data split;
- struct strings_data strings;
- struct tail_data tail;
- struct tar_data tar;
- struct tee_data tee;
- struct touch_data touch;
- struct ulimit_data ulimit;
- struct uniq_data uniq;
- struct uudecode_data uudecode;
- struct wc_data wc;
- struct xargs_data xargs;
-} this;
diff --git a/android/linux/generated/help.h b/android/linux/generated/help.h
deleted file mode 100644
index 10516a4b..00000000
--- a/android/linux/generated/help.h
+++ /dev/null
@@ -1,612 +0,0 @@
-#define HELP_toybox_musl_nommu_is_broken "When using musl-libc on a nommu system, you'll need to say \"y\" here.\n\nAlthough uclibc lets you detect support for things like fork() and\ndaemon() at compile time, musl intentionally includes broken versions\nthat always return -ENOSYS on nommu systems, and goes out of its way\nto prevent any cross-compile compatible compile-time probes for a\nnommu system. (It doesn't even #define __MUSL__ in features.h.)\n\nMusl does this despite the fact that a nommu system can't even run\nstandard ELF binaries, and requires specially packaged executables.\nSo our only choice is to manually provide a musl nommu bug workaround\nyou can manually select to enable (larger, slower) nommu support with\nmusl."
-
-#define HELP_toybox_uid_usr "When commands like useradd/groupadd allocate user IDs, start here."
-
-#define HELP_toybox_uid_sys "When commands like useradd/groupadd allocate system IDs, start here."
-
-#define HELP_toybox_pedantic_args "Check arguments for commands that have no arguments."
-
-#define HELP_toybox_debug "Enable extra checks for debugging purposes. All of them catch\nthings that can only go wrong at development time, not runtime."
-
-#define HELP_toybox_norecurse "When one toybox command calls another, usually it just calls the new\ncommand's main() function rather than searching the $PATH and calling\nexec on another file (which is much slower).\n\nThis disables that optimization, so toybox will run external commands\n even when it has a built-in version of that command. This requires\n toybox symlinks to be installed in the $PATH, or re-invoking the\n \"toybox\" multiplexer command by name."
-
-#define HELP_toybox_free "When a program exits, the operating system will clean up after it\n(free memory, close files, etc). To save size, toybox usually relies\non this behavior. If you're running toybox under a debugger or\nwithout a real OS (ala newlib+libgloss), enable this to make toybox\nclean up after itself."
-
-#define HELP_toybox_i18n "Support for UTF-8 character sets, and some locale support."
-
-#define HELP_toybox_help_dashdash "Support --help argument in all commands, even ones with a NULL\noptstring. (Use TOYFLAG_NOHELP to disable.) Produces the same output\nas \"help command\". --version shows toybox version."
-
-#define HELP_toybox_help "Include help text for each command."
-
-#define HELP_toybox_float "Include floating point support infrastructure and commands that\nrequire it."
-
-#define HELP_toybox_libz "Use libz for gz support."
-
-#define HELP_toybox_libcrypto "Use faster hash functions out of external -lcrypto library."
-
-#define HELP_toybox_smack "Include SMACK options in commands like ls for systems like Tizen."
-
-#define HELP_toybox_selinux "Include SELinux options in commands such as ls, and add\nSELinux-specific commands such as chcon to the Android menu."
-
-#define HELP_toybox_lsm_none "Don't try to achieve \"watertight\" by plugging the holes in a\ncollander, instead use conventional unix security (and possibly\nLinux Containers) for a simple straightforward system."
-
-#define HELP_toybox_suid "Support for the Set User ID bit, to install toybox suid root and drop\npermissions for commands which do not require root access. To use\nthis change ownership of the file to the root user and set the suid\nbit in the file permissions:\n\nchown root:root toybox; chmod +s toybox\n\nprompt \"Security Blanket\"\ndefault TOYBOX_LSM_NONE\nhelp\nSelect a Linux Security Module to complicate your system\nuntil you can't find holes in it."
-
-#define HELP_toybox "usage: toybox [--long | --help | --version | [command] [arguments...]]\n\nWith no arguments, shows available commands. First argument is\nname of a command to run, followed by any arguments to that command.\n\n--long Show path to each command\n\nTo install command symlinks with paths, try:\n for i in $(/bin/toybox --long); do ln -s /bin/toybox $i; done\nor all in one directory:\n for i in $(./toybox); do ln -s toybox $i; done; PATH=$PWD:$PATH\n\nMost toybox commands also understand the following arguments:\n\n--help Show command help (only)\n--version Show toybox version (only)\n\nThe filename \"-\" means stdin/stdout, and \"--\" stops argument parsing.\n\nNumerical arguments accept a single letter suffix for\nkilo, mega, giga, tera, peta, and exabytes, plus an additional\n\"d\" to indicate decimal 1000's instead of 1024.\n\nDurations can be decimal fractions and accept minute (\"m\"), hour (\"h\"),\nor day (\"d\") suffixes (so 0.1m = 6s)."
-
-#define HELP_setenforce "usage: setenforce [enforcing|permissive|1|0]\n\nSets whether SELinux is enforcing (1) or permissive (0)."
-
-#define HELP_sendevent "usage: sendevent DEVICE TYPE CODE VALUE\n\nSends a Linux input event."
-
-#define HELP_runcon "usage: runcon CONTEXT COMMAND [ARGS...]\n\nRun a command in a specified security context."
-
-#define HELP_restorecon "usage: restorecon [-D] [-F] [-R] [-n] [-v] FILE...\n\nRestores the default security contexts for the given files.\n\n-D Apply to /data/data too\n-F Force reset\n-R Recurse into directories\n-n Don't make any changes; useful with -v to see what would change\n-v Verbose"
-
-#define HELP_log "usage: log [-p PRI] [-t TAG] MESSAGE...\n\nLogs message to logcat.\n\n-p Use the given priority instead of INFO:\n d: DEBUG e: ERROR f: FATAL i: INFO v: VERBOSE w: WARN s: SILENT\n-t Use the given tag instead of \"log\""
-
-#define HELP_load_policy "usage: load_policy FILE\n\nLoad the specified SELinux policy file."
-
-#define HELP_getenforce "usage: getenforce\n\nShows whether SELinux is disabled, enforcing, or permissive."
-
-#define HELP_skeleton_alias "usage: skeleton_alias [-dq] [-b NUMBER]\n\nExample of a second command with different arguments in the same source\nfile as the first. This allows shared infrastructure not added to lib/."
-
-#define HELP_skeleton "usage: skeleton [-a] [-b STRING] [-c NUMBER] [-d LIST] [-e COUNT] [...]\n\nTemplate for new commands. You don't need this.\n\nWhen creating a new command, copy this file and delete the parts you\ndon't need. Be sure to replace all instances of \"skeleton\" (upper and lower\ncase) with your new command name.\n\nFor simple commands, \"hello.c\" is probably a better starting point."
-
-#define HELP_logwrapper "usage: logwrapper ...\n\nAppend command line to $WRAPLOG, then call second instance\nof command in $PATH."
-
-#define HELP_hostid "usage: hostid\n\nPrint the numeric identifier for the current host."
-
-#define HELP_hello "usage: hello\n\nA hello world program.\n\nMostly used as a simple template for adding new commands.\nOccasionally nice to smoketest kernel booting via \"init=/usr/bin/hello\"."
-
-#define HELP_demo_utf8towc "usage: demo_utf8towc\n\nPrint differences between toybox's utf8 conversion routines vs libc du jour."
-
-#define HELP_demo_scankey "usage: demo_scankey\n\nMove a letter around the screen. Hit ESC to exit."
-
-#define HELP_demo_number "usage: demo_number [-hsbi] NUMBER...\n\n-b Use \"B\" for single byte units (HR_B)\n-d Decimal units\n-h Human readable\n-s Space between number and units (HR_SPACE)"
-
-#define HELP_demo_many_options "usage: demo_many_options -[a-zA-Z]\n\nPrint the optflags value of the command arguments, in hex."
-
-#define HELP_umount "usage: umount [-a [-t TYPE[,TYPE...]]] [-vrfD] [DIR...]\n\nUnmount the listed filesystems.\n\n-a Unmount all mounts in /proc/mounts instead of command line list\n-D Don't free loopback device(s)\n-f Force unmount\n-l Lazy unmount (detach from filesystem now, close when last user does)\n-n Don't use /proc/mounts\n-r Remount read only if unmounting fails\n-t Restrict \"all\" to mounts of TYPE (or use \"noTYPE\" to skip)\n-v Verbose"
-
-#define HELP_sync "usage: sync\n\nWrite pending cached data to disk (synchronize), blocking until done."
-
-#define HELP_su "usage: su [-lp] [-u UID] [-g GID,...] [-s SHELL] [-c CMD] [USER [COMMAND...]]\n\nSwitch user, prompting for password of new user when not run as root.\n\nWith one argument, switch to USER and run user's shell from /etc/passwd.\nWith no arguments, USER is root. If COMMAND line provided after USER,\nexec() it as new USER (bypasing shell). If -u or -g specified, first\nargument (if any) isn't USER (it's COMMAND).\n\nfirst argument is USER name to switch to (which must exist).\nNon-root users are prompted for new user's password.\n\n-s Shell to use (default is user's shell from /etc/passwd)\n-c Command line to pass to -s shell (ala sh -c \"CMD\")\n-l Reset environment as if new login.\n-u Switch to UID instead of USER\n-g Switch to GID (only root allowed, can be comma separated list)\n-p Preserve environment (except for $PATH and $IFS)"
-
-#define HELP_seq "usage: seq [-w|-f fmt_str] [-s sep_str] [first] [increment] last\n\nCount from first to last, by increment. Omitted arguments default\nto 1. Two arguments are used as first and last. Arguments can be\nnegative or floating point.\n\n-f Use fmt_str as a printf-style floating point format string\n-s Use sep_str as separator, default is a newline character\n-w Pad to equal width with leading zeroes"
-
-#define HELP_pidof "usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...\n\nPrint the PIDs of all processes with the given names.\n\n-s Single shot, only return one pid\n-o Omit PID(s)\n-x Match shell scripts too"
-
-#define HELP_passwd_sad "Password changes are checked to make sure they're at least 6 chars long,\ndon't include the entire username (but not a subset of it), or the entire\nprevious password (but changing password1, password2, password3 is fine).\nThis heuristic accepts \"aaaaaa\" and \"123456\"."
-
-#define HELP_passwd "usage: passwd [-a ALGO] [-dlu] [USER]\n\nUpdate user's authentication tokens. Defaults to current user.\n\n-a ALGO Encryption method (des, md5, sha256, sha512) default: des\n-d Set password to ''\n-l Lock (disable) account\n-u Unlock (enable) account"
-
-#define HELP_mount "usage: mount [-afFrsvw] [-t TYPE] [-o OPTION,] [[DEVICE] DIR]\n\nMount new filesystem(s) on directories. With no arguments, display existing\nmounts.\n\n-a Mount all entries in /etc/fstab (with -t, only entries of that TYPE)\n-O Only mount -a entries that have this option\n-f Fake it (don't actually mount)\n-r Read only (same as -o ro)\n-w Read/write (default, same as -o rw)\n-t Specify filesystem type\n-v Verbose\n\nOPTIONS is a comma separated list of options, which can also be supplied\nas --longopts.\n\nAutodetects loopback mounts (a file on a directory) and bind mounts (file\non file, directory on directory), so you don't need to say --bind or --loop.\nYou can also \"mount -a /path\" to mount everything in /etc/fstab under /path,\neven if it's noauto. DEVICE starting with UUID= is identified by blkid -U."
-
-#define HELP_mktemp "usage: mktemp [-dqu] [-p DIR] [TEMPLATE]\n\nSafely create a new file \"DIR/TEMPLATE\" and print its name.\n\n-d Create directory instead of file (--directory)\n-p Put new file in DIR (--tmpdir)\n-q Quiet, no error messages\n-t Prefer $TMPDIR > DIR > /tmp (default DIR > $TMPDIR > /tmp)\n-u Don't create anything, just print what would be created\n\nEach X in TEMPLATE is replaced with a random printable character. The\ndefault TEMPLATE is tmp.XXXXXXXXXX."
-
-#define HELP_mknod_z "usage: mknod [-Z CONTEXT] ...\n\n-Z Set security context to created file"
-
-#define HELP_mknod "usage: mknod [-m MODE] NAME TYPE [MAJOR MINOR]\n\nCreate a special file NAME with a given type. TYPE is b for block device,\nc or u for character device, p for named pipe (which ignores MAJOR/MINOR).\n\n-m Mode (file permissions) of new device, in octal or u+x format"
-
-#define HELP_sha512sum "See sha1sum"
-
-#define HELP_sha384sum "See sha1sum"
-
-#define HELP_sha256sum "See sha1sum"
-
-#define HELP_sha224sum "See sha1sum"
-
-#define HELP_sha1sum "usage: sha?sum [-bcs] [FILE]...\n\nCalculate sha hash for each input file, reading from stdin if none. Output\none hash (40 hex digits for sha1, 56 for sha224, 64 for sha256, 96 for sha384,\nand 128 for sha512) for each input file, followed by filename.\n\n-b Brief (hash only, no filename)\n-c Check each line of each FILE is the same hash+filename we'd output\n-s No output, exit status 0 if all hashes match, 1 otherwise"
-
-#define HELP_md5sum "usage: md5sum [-bcs] [FILE]...\n\nCalculate md5 hash for each input file, reading from stdin if none.\nOutput one hash (32 hex digits) for each input file, followed by filename.\n\n-b Brief (hash only, no filename)\n-c Check each line of each FILE is the same hash+filename we'd output\n-s No output, exit status 0 if all hashes match, 1 otherwise"
-
-#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"
-
-#define HELP_gunzip "usage: gunzip [-cfk] [FILE...]\n\nDecompress files. With no files, decompresses stdin to stdout.\nOn success, the input files are removed and replaced by new\nfiles without the .gz suffix.\n\n-c Output to stdout (act as zcat)\n-f Force: allow read from tty\n-k Keep input files (default is to remove)"
-
-#define HELP_gzip "usage: gzip [-19cdfk] [FILE...]\n\nCompress files. With no files, compresses stdin to stdout.\nOn success, the input files are removed and replaced by new\nfiles with the .gz suffix.\n\n-c Output to stdout\n-d Decompress (act as gunzip)\n-f Force: allow overwrite of output file\n-k Keep input files (default is to remove)\n-# Compression level 1-9 (1:fastest, 6:default, 9:best)"
-
-#define HELP_dmesg "usage: dmesg [-Cc] [-r|-t|-T] [-n LEVEL] [-s SIZE] [-w]\n\nPrint or control the kernel ring buffer.\n\n-C Clear ring buffer without printing\n-c Clear ring buffer after printing\n-n Set kernel logging LEVEL (1-9)\n-r Raw output (with <level markers>)\n-S Use syslog(2) rather than /dev/kmsg\n-s Show the last SIZE many bytes\n-T Human readable timestamps\n-t Don't print timestamps\n-w Keep waiting for more output (aka --follow)"
-
-#define HELP_tunctl "usage: tunctl [-dtT] [-u USER] NAME\n\nCreate and delete tun/tap virtual ethernet devices.\n\n-T Use tap (ethernet frames) instead of tun (ip packets)\n-d Delete tun/tap device\n-t Create tun/tap device\n-u Set owner (user who can read/write device without root access)"
-
-#define HELP_sntp "usage: sntp [-saSdDq] [-r SHIFT] [-mM[ADDRESS]] [-p PORT] [SERVER]\n\nSimple Network Time Protocol client. Query SERVER and display time.\n\n-p Use PORT (default 123)\n-s Set system clock suddenly\n-a Adjust system clock gradually\n-S Serve time instead of querying (bind to SERVER address if specified)\n-m Wait for updates from multicast ADDRESS (RFC 4330 default 224.0.1.1)\n-M Multicast server on ADDRESS (deault 224.0.0.1)\n-t TTL (multicast only, default 1)\n-d Daemonize (run in background re-querying )\n-D Daemonize but stay in foreground: re-query time every 1000 seconds\n-r Retry shift (every 1<<SHIFT seconds)\n-q Quiet (don't display time)"
-
-#define HELP_rfkill "usage: rfkill COMMAND [DEVICE]\n\nEnable/disable wireless devices.\n\nCommands:\nlist [DEVICE] List current state\nblock DEVICE Disable device\nunblock DEVICE Enable device\n\nDEVICE is an index number, or one of:\nall, wlan(wifi), bluetooth, uwb(ultrawideband), wimax, wwan, gps, fm."
-
-#define HELP_ping "usage: ping [OPTIONS] HOST\n\nCheck network connectivity by sending packets to a host and reporting\nits response.\n\nSend ICMP ECHO_REQUEST packets to ipv4 or ipv6 addresses and prints each\necho it receives back, with round trip time. Returns true if host alive.\n\nOptions:\n-4, -6 Force IPv4 or IPv6\n-c CNT Send CNT many packets (default 3, 0 = infinite)\n-f Flood (print . and \\b to show drops, default -c 15 -i 0.2)\n-i TIME Interval between packets (default 1, need root for < .2)\n-I IFACE/IP Source interface or address\n-m MARK Tag outgoing packets using SO_MARK\n-q Quiet (stops after one returns true if host is alive)\n-s SIZE Data SIZE in bytes (default 56)\n-t TTL Set Time To Live (number of hops)\n-W SEC Seconds to wait for response after last -c packet (default 3)\n-w SEC Exit after this many seconds"
-
-#define HELP_netstat "usage: netstat [-pWrxwutneal]\n\nDisplay networking information. Default is netstat -tuwx\n\n-r Routing table\n-a All sockets (not just connected)\n-l Listening server sockets\n-t TCP sockets\n-u UDP sockets\n-w Raw sockets\n-x Unix sockets\n-e Extended info\n-n Don't resolve names\n-W Wide display\n-p Show PID/program name of sockets"
-
-#define HELP_netcat_listen "usage: netcat [-t] [-lL COMMAND...]\n\n-l Listen for one incoming connection\n-L Listen for multiple incoming connections (server mode)\n-t Allocate tty (must come before -l or -L)\n\nThe command line after -l or -L is executed (as a child process) to handle\neach incoming connection. If blank -l waits for a connection and forwards\nit to stdin/stdout. If no -p specified, -l prints port it bound to and\nbackgrounds itself (returning immediately).\n\nFor a quick-and-dirty server, try something like:\nnetcat -s 127.0.0.1 -p 1234 -tL /bin/bash -l"
-
-#define HELP_netcat "usage: netcat [-46U] [-u] [-wpq #] [-s addr] {IPADDR PORTNUM|-f FILENAME}\n\nForward stdin/stdout to a file or network connection.\n\n-4 Force IPv4\n-6 Force IPv6\n-f Use FILENAME (ala /dev/ttyS0) instead of network\n-p Local port number\n-q Quit SECONDS after EOF on stdin, even if stdout hasn't closed yet\n-s Local source address\n-u Use UDP\n-U Use a UNIX domain socket\n-w SECONDS timeout to establish connection\n-W SECONDS timeout for more data on an idle connection\n\nUse \"stty 115200 -F /dev/ttyS0 && stty raw -echo -ctlecho\" with\nnetcat -f to connect to a serial port."
-
-#define HELP_microcom "usage: microcom [-s SPEED] [-X] DEVICE\n\nSimple serial console.\n\n-s Set baud rate to SPEED\n-X Ignore ^@ (send break) and ^] (exit)"
-
-#define HELP_ifconfig "usage: ifconfig [-aS] [INTERFACE [ACTION...]]\n\nDisplay or configure network interface.\n\nWith no arguments, display active interfaces. First argument is interface\nto operate on, one argument by itself displays that interface.\n\n-a All interfaces displayed, not just active ones\n-S Short view, one line per interface\n\nStandard ACTIONs to perform on an INTERFACE:\n\nADDR[/MASK] - set IPv4 address (1.2.3.4/5) and activate interface\nadd|del ADDR[/LEN] - add/remove IPv6 address (1111::8888/128)\nup|down - activate or deactivate interface\n\nAdvanced ACTIONs (default values usually suffice):\n\ndefault - remove IPv4 address\nnetmask ADDR - set IPv4 netmask via 255.255.255.0 instead of /24\ntxqueuelen LEN - number of buffered packets before output blocks\nmtu LEN - size of outgoing packets (Maximum Transmission Unit)\nbroadcast ADDR - Set broadcast address\npointopoint ADDR - PPP and PPPOE use this instead of \"route add default gw\"\nhw TYPE ADDR - set hardware (mac) address (type = ether|infiniband)\n\nFlags you can set on an interface (or -remove by prefixing with -):\n\narp - don't use Address Resolution Protocol to map LAN routes\npromisc - don't discard packets that aren't to this LAN hardware address\nmulticast - force interface into multicast mode if the driver doesn't\nallmulti - promisc for multicast packets"
-
-#define HELP_ftpput "An ftpget that defaults to -s instead of -g"
-
-#define HELP_ftpget "usage: ftpget [-cvgslLmMdD] [-P PORT] [-p PASSWORD] [-u USER] HOST [LOCAL] REMOTE\n\nTalk to ftp server. By default get REMOTE file via passive anonymous\ntransfer, optionally saving under a LOCAL name. Can also send, list, etc.\n\n-c Continue partial transfer\n-p Use PORT instead of \"21\"\n-P Use PASSWORD instead of \"ftpget@\"\n-u Use USER instead of \"anonymous\"\n-v Verbose\n\nWays to interact with FTP server:\n-d Delete file\n-D Remove directory\n-g Get file (default)\n-l List directory\n-L List (filenames only)\n-m Move file on server from LOCAL to REMOTE\n-M mkdir\n-s Send file"
-
-#define HELP_yes "usage: yes [args...]\n\nRepeatedly output line until killed. If no args, output 'y'."
-
-#define HELP_xxd "usage: xxd [-c n] [-g n] [-i] [-l n] [-o n] [-p] [-r] [-s n] [file]\n\nHexdump a file to stdout. If no file is listed, copy from stdin.\nFilename \"-\" is a synonym for stdin.\n\n-c n Show n bytes per line (default 16)\n-g n Group bytes by adding a ' ' every n bytes (default 2)\n-i Include file output format (comma-separated hex byte literals)\n-l n Limit of n bytes before stopping (default is no limit)\n-o n Add n to display offset\n-p Plain hexdump (30 bytes/line, no grouping)\n-r Reverse operation: turn a hexdump into a binary file\n-s n Skip to offset n"
-
-#define HELP_which "usage: which [-a] filename ...\n\nSearch $PATH for executable files matching filename(s).\n\n-a Show all matches"
-
-#define HELP_watch "usage: watch [-teb] [-n SEC] PROG ARGS\n\nRun PROG every -n seconds, showing output. Hit q to quit.\n\n-n Loop period in seconds (default 2)\n-t Don't print header\n-e Exit on error\n-b Beep on command error\n-x Exec command directly (vs \"sh -c\")"
-
-#define HELP_w "usage: w\n\nShow who is logged on and since how long they logged in."
-
-#define HELP_vmstat "usage: vmstat [-n] [DELAY [COUNT]]\n\nPrint virtual memory statistics, repeating each DELAY seconds, COUNT times.\n(With no DELAY, prints one line. With no COUNT, repeats until killed.)\n\nShow processes running and blocked, kilobytes swapped, free, buffered, and\ncached, kilobytes swapped in and out per second, file disk blocks input and\noutput per second, interrupts and context switches per second, percent\nof CPU time spent running user code, system code, idle, and awaiting I/O.\nFirst line is since system started, later lines are since last line.\n\n-n Display the header only once"
-
-#define HELP_vconfig "usage: vconfig COMMAND [OPTIONS]\n\nCreate and remove virtual ethernet devices\n\nadd [interface-name] [vlan_id]\nrem [vlan-name]\nset_flag [interface-name] [flag-num] [0 | 1]\nset_egress_map [vlan-name] [skb_priority] [vlan_qos]\nset_ingress_map [vlan-name] [skb_priority] [vlan_qos]\nset_name_type [name-type]"
-
-#define HELP_uuidgen "usage: uuidgen\n\nCreate and print a new RFC4122 random UUID."
-
-#define HELP_usleep "usage: usleep MICROSECONDS\n\nPause for MICROSECONDS microseconds."
-
-#define HELP_uptime "usage: uptime [-ps]\n\nTell the current time, how long the system has been running, the number\nof users, and the system load averages for the past 1, 5 and 15 minutes.\n\n-p Pretty (human readable) uptime\n-s Since when has the system been up?"
-
-#define HELP_truncate "usage: truncate [-c] -s SIZE file...\n\nSet length of file(s), extending sparsely if necessary.\n\n-c Don't create file if it doesn't exist\n-s New size (with optional prefix and suffix)\n\nSIZE prefix: + add, - subtract, < shrink to, > expand to,\n / multiple rounding down, % multiple rounding up\nSIZE suffix: k=1024, m=1024^2, g=1024^3, t=1024^4, p=1024^5, e=1024^6"
-
-#define HELP_timeout "usage: timeout [-k DURATION] [-s SIGNAL] DURATION COMMAND...\n\nRun command line as a child process, sending child a signal if the\ncommand doesn't exit soon enough.\n\nDURATION can be a decimal fraction. An optional suffix can be \"m\"\n(minutes), \"h\" (hours), \"d\" (days), or \"s\" (seconds, the default).\n\n-s Send specified signal (default TERM)\n-k Send KILL signal if child still running this long after first signal\n-v Verbose\n--foreground Don't create new process group\n--preserve-status Exit with the child's exit status"
-
-#define HELP_taskset "usage: taskset [-ap] [mask] [PID | cmd [args...]]\n\nLaunch a new task which may only run on certain processors, or change\nthe processor affinity of an existing PID.\n\nMask is a hex string where each bit represents a processor the process\nis allowed to run on. PID without a mask displays existing affinity.\n\n-p Set/get the affinity of given PID instead of a new command\n-a Set/get the affinity of all threads of the PID"
-
-#define HELP_nproc "usage: nproc [--all]\n\nPrint number of processors.\n\n--all Show all processors, not just ones this task can run on"
-
-#define HELP_tac "usage: tac [FILE...]\n\nOutput lines in reverse order."
-
-#define HELP_sysctl "usage: sysctl [-aAeNnqw] [-p [FILE] | KEY[=VALUE]...]\n\nRead/write system control data (under /proc/sys).\n\n-a,A Show all values\n-e Don't warn about unknown keys\n-N Don't print key values\n-n Don't print key names\n-p Read values from FILE (default /etc/sysctl.conf)\n-q Don't show value after write\n-w Only write values (object to reading)"
-
-#define HELP_switch_root "usage: switch_root [-c /dev/console] NEW_ROOT NEW_INIT...\n\nUse from PID 1 under initramfs to free initramfs, chroot to NEW_ROOT,\nand exec NEW_INIT.\n\n-c Redirect console to device in NEW_ROOT\n-h Hang instead of exiting on failure (avoids kernel panic)"
-
-#define HELP_swapon "usage: swapon [-d] [-p priority] filename\n\nEnable swapping on a given device/file.\n\n-d Discard freed SSD pages\n-p Priority (highest priority areas allocated first)"
-
-#define HELP_swapoff "usage: swapoff swapregion\n\nDisable swapping on a given swapregion."
-
-#define HELP_stat "usage: stat [-tfL] [-c FORMAT] FILE...\n\nDisplay status of files or filesystems.\n\n-c Output specified FORMAT string instead of default\n-f Display filesystem status instead of file status\n-L Follow symlinks\n-t terse (-c \"%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o\")\n (with -f = -c \"%n %i %l %t %s %S %b %f %a %c %d\")\n\nThe valid format escape sequences for files:\n%a Access bits (octal) |%A Access bits (flags)|%b Size/512\n%B Bytes per %b (512) |%C Security context |%d Device ID (dec)\n%D Device ID (hex) |%f All mode bits (hex)|%F File type\n%g Group ID |%G Group name |%h Hard links\n%i Inode |%m Mount point |%n Filename\n%N Long filename |%o I/O block size |%s Size (bytes)\n%t Devtype major (hex) |%T Devtype minor (hex)|%u User ID\n%U User name |%x Access time |%X Access unix time\n%y Modification time |%Y Mod unix time |%z Creation time\n%Z Creation unix time\n\nThe valid format escape sequences for filesystems:\n%a Available blocks |%b Total blocks |%c Total inodes\n%d Free inodes |%f Free blocks |%i File system ID\n%l Max filename length |%n File name |%s Fragment size\n%S Best transfer size |%t FS type (hex) |%T FS type (driver name)"
-
-#define HELP_shred "usage: shred [-fuz] [-n COUNT] [-s SIZE] FILE...\n\nSecurely delete a file by overwriting its contents with random data.\n\n-f Force (chmod if necessary)\n-n COUNT Random overwrite iterations (default 1)\n-o OFFSET Start at OFFSET\n-s SIZE Use SIZE instead of detecting file size\n-u Unlink (actually delete file when done)\n-x Use exact size (default without -s rounds up to next 4k)\n-z Zero at end\n\nNote: data journaling filesystems render this command useless, you must\noverwrite all free space (fill up disk) to erase old data on those."
-
-#define HELP_setsid "usage: setsid [-t] command [args...]\n\nRun process in a new session.\n\n-t Grab tty (become foreground process, receiving keyboard signals)"
-
-#define HELP_setfattr "usage: setfattr [-h] [-x|-n NAME] [-v VALUE] FILE...\n\nWrite POSIX extended attributes.\n\n-h Do not dereference symlink\n-n Set given attribute\n-x Remove given attribute\n-v Set value for attribute -n (default is empty)"
-
-#define HELP_rmmod "usage: rmmod [-wf] [MODULE]\n\nUnload the module named MODULE from the Linux kernel.\n-f Force unload of a module\n-w Wait until the module is no longer used"
-
-#define HELP_rev "usage: rev [FILE...]\n\nOutput each line reversed, when no files are given stdin is used."
-
-#define HELP_reset "usage: reset\n\nReset the terminal."
-
-#define HELP_reboot "usage: reboot/halt/poweroff [-fn]\n\nRestart, halt or powerdown the system.\n\n-f Don't signal init\n-n Don't sync before stopping the system"
-
-#define HELP_realpath "usage: realpath FILE...\n\nDisplay the canonical absolute pathname"
-
-#define HELP_readlink "usage: readlink FILE...\n\nWith no options, show what symlink points to, return error if not symlink.\n\nOptions for producing canonical paths (all symlinks/./.. resolved):\n\n-e Canonical path to existing entry (fail if missing)\n-f Full path (fail if directory missing)\n-m Ignore missing entries, show where it would be\n-n No trailing newline\n-q Quiet (no output, just error code)"
-
-#define HELP_readahead "usage: readahead FILE...\n\nPreload files into disk cache."
-
-#define HELP_pwdx "usage: pwdx PID...\n\nPrint working directory of processes listed on command line."
-
-#define HELP_printenv "usage: printenv [-0] [env_var...]\n\nPrint environment variables.\n\n-0 Use \\0 as delimiter instead of \\n"
-
-#define HELP_pmap "usage: pmap [-xq] [pids...]\n\nReport the memory map of a process or processes.\n\n-x Show the extended format\n-q Do not display some header/footer lines"
-
-#define HELP_pivot_root "usage: pivot_root OLD NEW\n\nSwap OLD and NEW filesystems (as if by simultaneous mount --move), and\nmove all processes with chdir or chroot under OLD into NEW (including\nkernel threads) so OLD may be unmounted.\n\nThe directory NEW must exist under OLD. This doesn't work on initramfs,\nwhich can't be moved (about the same way PID 1 can't be killed; see\nswitch_root instead)."
-
-#define HELP_partprobe "usage: partprobe DEVICE...\n\nTell the kernel about partition table changes\n\nAsk the kernel to re-read the partition table on the specified devices."
-
-#define HELP_oneit "usage: oneit [-p] [-c /dev/tty0] command [...]\n\nSimple init program that runs a single supplied command line with a\ncontrolling tty (so CTRL-C can kill it).\n\n-c Which console device to use (/dev/console doesn't do CTRL-C, etc)\n-p Power off instead of rebooting when command exits\n-r Restart child when it exits\n-3 Write 32 bit PID of each exiting reparented process to fd 3 of child\n (Blocking writes, child must read to avoid eventual deadlock.)\n\nSpawns a single child process (because PID 1 has signals blocked)\nin its own session, reaps zombies until the child exits, then\nreboots the system (or powers off with -p, or restarts the child with -r).\n\nResponds to SIGUSR1 by halting the system, SIGUSR2 by powering off,\nand SIGTERM or SIGINT reboot."
-
-#define HELP_nsenter "usage: nsenter [-t pid] [-F] [-i] [-m] [-n] [-p] [-u] [-U] COMMAND...\n\nRun COMMAND in an existing (set of) namespace(s).\n\n-t PID to take namespaces from (--target)\n-F don't fork, even if -p is used (--no-fork)\n\nThe namespaces to switch are:\n\n-i SysV IPC: message queues, semaphores, shared memory (--ipc)\n-m Mount/unmount tree (--mount)\n-n Network address, sockets, routing, iptables (--net)\n-p Process IDs and init, will fork unless -F is used (--pid)\n-u Host and domain names (--uts)\n-U UIDs, GIDs, capabilities (--user)\n\nIf -t isn't specified, each namespace argument must provide a path\nto a namespace file, ala \"-i=/proc/$PID/ns/ipc\""
-
-#define HELP_unshare "usage: unshare [-imnpuUr] COMMAND...\n\nCreate new container namespace(s) for this process and its children, so\nsome attribute is not shared with the parent process.\n\n-f Fork command in the background (--fork)\n-i SysV IPC (message queues, semaphores, shared memory) (--ipc)\n-m Mount/unmount tree (--mount)\n-n Network address, sockets, routing, iptables (--net)\n-p Process IDs and init (--pid)\n-r Become root (map current euid/egid to 0/0, implies -U) (--map-root-user)\n-u Host and domain names (--uts)\n-U UIDs, GIDs, capabilities (--user)\n\nA namespace allows a set of processes to have a different view of the\nsystem than other sets of processes."
-
-#define HELP_nbd_client "usage: nbd-client [-ns] HOST PORT DEVICE\n\n-n Do not fork into background\n-s nbd swap support (lock server into memory)"
-
-#define HELP_mountpoint "usage: mountpoint [-qd] DIR\n mountpoint [-qx] DEVICE\n\nCheck whether the directory or device is a mountpoint.\n\n-q Be quiet, return zero if directory is a mountpoint\n-d Print major/minor device number of the directory\n-x Print major/minor device number of the block device"
-
-#define HELP_modinfo "usage: modinfo [-0] [-b basedir] [-k kernel] [-F field] [module|file...]\n\nDisplay module fields for modules specified by name or .ko path.\n\n-F Only show the given field\n-0 Separate fields with NUL rather than newline\n-b Use <basedir> as root for /lib/modules/\n-k Look in given directory under /lib/modules/"
-
-#define HELP_mkswap "usage: mkswap [-L LABEL] DEVICE\n\nSet up a Linux swap area on a device or file."
-
-#define HELP_mkpasswd "usage: mkpasswd [-P FD] [-m TYPE] [-S SALT] [PASSWORD] [SALT]\n\nCrypt PASSWORD using crypt(3)\n\n-P FD Read password from file descriptor FD\n-m TYPE Encryption method (des, md5, sha256, or sha512; default is des)\n-S SALT"
-
-#define HELP_mix "usage: mix [-d DEV] [-c CHANNEL] [-l VOL] [-r RIGHT]\n\nList OSS sound channels (module snd-mixer-oss), or set volume(s).\n\n-c CHANNEL Set/show volume of CHANNEL (default first channel found)\n-d DEV Device node (default /dev/mixer)\n-l VOL Volume level\n-r RIGHT Volume of right stereo channel (with -r, -l sets left volume)"
-
-#define HELP_mcookie "usage: mcookie [-vV]\n\nGenerate a 128-bit strong random number.\n\n-v show entropy source (verbose)\n-V show version"
-
-#define HELP_makedevs "usage: makedevs [-d device_table] rootdir\n\nCreate a range of special files as specified in a device table.\n\n-d File containing device table (default reads from stdin)\n\nEach line of the device table has the fields:\n<name> <type> <mode> <uid> <gid> <major> <minor> <start> <increment> <count>\nWhere name is the file name, and type is one of the following:\n\nb Block device\nc Character device\nd Directory\nf Regular file\np Named pipe (fifo)\n\nOther fields specify permissions, user and group id owning the file,\nand additional fields for device special files. Use '-' for blank entries,\nunspecified fields are treated as '-'."
-
-#define HELP_lsusb "usage: lsusb\n\nList USB hosts/devices."
-
-#define HELP_lspci_text "usage: lspci [-n] [-i FILE ]\n\n-n Numeric output (repeat for readable and numeric)\n-i PCI ID database (default /usr/share/misc/pci.ids)"
-
-#define HELP_lspci "usage: lspci [-ekm]\n\nList PCI devices.\n\n-e Print all 6 digits in class\n-k Print kernel driver\n-m Machine parseable format"
-
-#define HELP_lsmod "usage: lsmod\n\nDisplay the currently loaded modules, their sizes and their dependencies."
-
-#define HELP_chattr "usage: chattr [-R] [-+=AacDdijsStTu] [-v version] [File...]\n\nChange file attributes on a Linux second extended file system.\n\n-R Recurse\n-v Set the file's version/generation number\n\nOperators:\n '-' Remove attributes\n '+' Add attributes\n '=' Set attributes\n\nAttributes:\n A Don't track atime\n a Append mode only\n c Enable compress\n D Write dir contents synchronously\n d Don't backup with dump\n i Cannot be modified (immutable)\n j Write all data to journal first\n s Zero disk storage when deleted\n S Write file contents synchronously\n t Disable tail-merging of partial blocks with other files\n u Allow file to be undeleted"
-
-#define HELP_lsattr "usage: lsattr [-Radlv] [Files...]\n\nList file attributes on a Linux second extended file system.\n(AacDdijsStu defined in chattr --help)\n\n-R Recursively list attributes of directories and their contents\n-a List all files in directories, including files that start with '.'\n-d List directories like other files, rather than listing their contents\n-l List long flag names\n-v List the file's version/generation number"
-
-#define HELP_losetup "usage: losetup [-cdrs] [-o OFFSET] [-S SIZE] {-d DEVICE...|-j FILE|-af|{DEVICE FILE}}\n\nAssociate a loopback device with a file, or show current file (if any)\nassociated with a loop device.\n\nInstead of a device:\n-a Iterate through all loopback devices\n-f Find first unused loop device (may create one)\n-j FILE Iterate through all loopback devices associated with FILE\n\nexisting:\n-c Check capacity (file size changed)\n-d DEV Detach loopback device\n-D Detach all loopback devices\n\nnew:\n-s Show device name (alias --show)\n-o OFF Start association at offset OFF into FILE\n-r Read only\n-S SIZE Limit SIZE of loopback association (alias --sizelimit)"
-
-#define HELP_login "usage: login [-p] [-h host] [-f USERNAME] [USERNAME]\n\nLog in as a user, prompting for username and password if necessary.\n\n-p Preserve environment\n-h The name of the remote host for this login\n-f login as USERNAME without authentication"
-
-#define HELP_iorenice "usage: iorenice PID [CLASS] [PRIORITY]\n\nDisplay or change I/O priority of existing process. CLASS can be\n\"rt\" for realtime, \"be\" for best effort, \"idle\" for only when idle, or\n\"none\" to leave it alone. PRIORITY can be 0-7 (0 is highest, default 4)."
-
-#define HELP_ionice "usage: ionice [-t] [-c CLASS] [-n LEVEL] [COMMAND...|-p PID]\n\nChange the I/O scheduling priority of a process. With no arguments\n(or just -p), display process' existing I/O class/priority.\n\n-c CLASS = 1-3: 1(realtime), 2(best-effort, default), 3(when-idle)\n-n LEVEL = 0-7: (0 is highest priority, default = 5)\n-p Affect existing PID instead of spawning new child\n-t Ignore failure to set I/O priority\n\nSystem default iopriority is generally -c 2 -n 4."
-
-#define HELP_insmod "usage: insmod MODULE [MODULE_OPTIONS]\n\nLoad the module named MODULE passing options if given."
-
-#define HELP_inotifyd "usage: inotifyd PROG FILE[:MASK] ...\n\nWhen a filesystem event matching MASK occurs to a FILE, run PROG as:\n\n PROG EVENTS FILE [DIRFILE]\n\nIf PROG is \"-\" events are sent to stdout.\n\nThis file is:\n a accessed c modified e metadata change w closed (writable)\n r opened D deleted M moved 0 closed (unwritable)\n u unmounted o overflow x unwatchable\n\nA file in this directory is:\n m moved in y moved out n created d deleted\n\nWhen x event happens for all FILEs, inotifyd exits (after waiting for PROG)."
-
-#define HELP_i2cset "usage: i2cset [-fy] BUS CHIP ADDR VALUE... MODE\n\nWrite an i2c register. MODE is b for byte, w for 16-bit word, i for I2C block.\n\n-f Force access to busy devices\n-y Answer \"yes\" to confirmation prompts (for script use)"
-
-#define HELP_i2cget "usage: i2cget [-fy] BUS CHIP ADDR\n\nRead an i2c register.\n\n-f Force access to busy devices\n-y Answer \"yes\" to confirmation prompts (for script use)"
-
-#define HELP_i2cdump "usage: i2cdump [-fy] BUS CHIP\n\nDump i2c registers.\n\n-f Force access to busy devices\n-y Answer \"yes\" to confirmation prompts (for script use)"
-
-#define HELP_i2cdetect "usage: i2cdetect [-ary] BUS [FIRST LAST]\nusage: i2cdetect -F BUS\nusage: i2cdetect -l\n\nDetect i2c devices.\n\n-a All addresses (0x00-0x7f rather than 0x03-0x77)\n-F Show functionality\n-l List all buses\n-r Probe with SMBus Read Byte\n-y Answer \"yes\" to confirmation prompts (for script use)"
-
-#define HELP_hwclock "usage: hwclock [-rswtluf]\n\nGet/set the hardware clock.\n\n-f FILE Use specified device file instead of /dev/rtc (--rtc)\n-l Hardware clock uses localtime (--localtime)\n-r Show hardware clock time (--show)\n-s Set system time from hardware clock (--hctosys)\n-t Set the system time based on the current timezone (--systz)\n-u Hardware clock uses UTC (--utc)\n-w Set hardware clock from system time (--systohc)"
-
-#define HELP_hexedit "usage: hexedit FILENAME\n\nHexadecimal file editor. All changes are written to disk immediately.\n\n-r Read only (display but don't edit)\n\nKeys:\nArrows Move left/right/up/down by one line/column\nPg Up/Pg Dn Move up/down by one page\n0-9, a-f Change current half-byte to hexadecimal value\nu Undo\nq/^c/^d/<esc> Quit"
-
-#define HELP_help_extras "usage: help [-ah]\n\n-a All commands\n-h HTML output"
-
-#define HELP_help "usage: help [command]\n\nShow usage information for toybox commands.\nRun \"toybox\" with no arguments for a list of available commands."
-
-#define HELP_fsync "usage: fsync [-d] [FILE...]\n\nSynchronize a file's in-core state with storage device.\n\n-d Avoid syncing metadata"
-
-#define HELP_fsfreeze "usage: fsfreeze {-f | -u} MOUNTPOINT\n\nFreeze or unfreeze a filesystem.\n\n-f Freeze\n-u Unfreeze"
-
-#define HELP_freeramdisk "usage: freeramdisk [RAM device]\n\nFree all memory allocated to specified ramdisk"
-
-#define HELP_free "usage: free [-bkmgt]\n\nDisplay the total, free and used amount of physical memory and swap space.\n\n-bkmgt Output units (default is bytes)\n-h Human readable (K=1024)"
-
-#define HELP_fmt "usage: fmt [-w WIDTH] [FILE...]\n\nReformat input to wordwrap at a given line length, preserving existing\nindentation level, writing to stdout.\n\n-w WIDTH Maximum characters per line (default 75)"
-
-#define HELP_flock "usage: flock [-sxun] fd\n\nManage advisory file locks.\n\n-s Shared lock\n-x Exclusive lock (default)\n-u Unlock\n-n Non-blocking: fail rather than wait for the lock"
-
-#define HELP_fallocate "usage: fallocate [-l size] [-o offset] file\n\nTell the filesystem to allocate space for a file."
-
-#define HELP_factor "usage: factor NUMBER...\n\nFactor integers."
-
-#define HELP_eject "usage: eject [-stT] [DEVICE]\n\nEject DEVICE or default /dev/cdrom\n\n-s SCSI device\n-t Close tray\n-T Open/close tray (toggle)"
-
-#define HELP_unix2dos "usage: unix2dos [FILE...]\n\nConvert newline format from unix \"\\n\" to dos \"\\r\\n\".\nIf no files listed copy from stdin, \"-\" is a synonym for stdin."
-
-#define HELP_dos2unix "usage: dos2unix [FILE...]\n\nConvert newline format from dos \"\\r\\n\" to unix \"\\n\".\nIf no files listed copy from stdin, \"-\" is a synonym for stdin."
-
-#define HELP_devmem "usage: devmem ADDR [WIDTH [DATA]]\n\nRead/write physical address via /dev/mem.\n\nWIDTH is 1, 2, 4, or 8 bytes (default 4)."
-
-#define HELP_count "usage: count\n\nCopy stdin to stdout, displaying simple progress indicator to stderr."
-
-#define HELP_clear "Clear the screen."
-
-#define HELP_chvt "usage: chvt N\n\nChange to virtual terminal number N. (This only works in text mode.)\n\nVirtual terminals are the Linux VGA text mode displays, ordinarily\nswitched between via alt-F1, alt-F2, etc. Use ctrl-alt-F1 to switch\nfrom X to a virtual terminal, and alt-F6 (or F7, or F8) to get back."
-
-#define HELP_chrt "usage: chrt [-Rmofrbi] {-p PID [PRIORITY] | [PRIORITY COMMAND...]}\n\nGet/set a process' real-time scheduling policy and priority.\n\n-p Set/query given pid (instead of running COMMAND)\n-R Set SCHED_RESET_ON_FORK\n-m Show min/max priorities available\n\nSet policy (default -r):\n\n -o SCHED_OTHER -f SCHED_FIFO -r SCHED_RR\n -b SCHED_BATCH -i SCHED_IDLE"
-
-#define HELP_chroot "usage: chroot NEWROOT [COMMAND [ARG...]]\n\nRun command within a new root directory. If no command, run /bin/sh."
-
-#define HELP_chcon "usage: chcon [-hRv] CONTEXT FILE...\n\nChange the SELinux security context of listed file[s].\n\n-h Change symlinks instead of what they point to\n-R Recurse into subdirectories\n-v Verbose"
-
-#define HELP_bzcat "usage: bzcat [FILE...]\n\nDecompress listed files to stdout. Use stdin if no files listed."
-
-#define HELP_bunzip2 "usage: bunzip2 [-cftkv] [FILE...]\n\nDecompress listed files (file.bz becomes file) deleting archive file(s).\nRead from stdin if no files listed.\n\n-c Force output to stdout\n-f Force decompression (if FILE doesn't end in .bz, replace original)\n-k Keep input files (-c and -t imply this)\n-t Test integrity\n-v Verbose"
-
-#define HELP_blockdev "usage: blockdev --OPTION... BLOCKDEV...\n\nCall ioctl(s) on each listed block device\n\n--setro Set read only\n--setrw Set read write\n--getro Get read only\n--getss Get sector size\n--getbsz Get block size\n--setbsz BYTES Set block size\n--getsz Get device size in 512-byte sectors\n--getsize Get device size in sectors (deprecated)\n--getsize64 Get device size in bytes\n--getra Get readahead in 512-byte sectors\n--setra SECTORS Set readahead\n--flushbufs Flush buffers\n--rereadpt Reread partition table"
-
-#define HELP_fstype "usage: fstype DEV...\n\nPrint type of filesystem on a block device or image."
-
-#define HELP_blkid "usage: blkid [-s TAG] [-UL] DEV...\n\nPrint type, label and UUID of filesystem on a block device or image.\n\n-U Show UUID only (or device with that UUID)\n-L Show LABEL only (or device with that LABEL)\n-s TAG Only show matching tags (default all)"
-
-#define HELP_base64 "usage: base64 [-di] [-w COLUMNS] [FILE...]\n\nEncode or decode in base64.\n\n-d Decode\n-i Ignore non-alphabetic characters\n-w Wrap output at COLUMNS (default 76 or 0 for no wrap)"
-
-#define HELP_ascii "usage: ascii\n\nDisplay ascii character set."
-
-#define HELP_acpi "usage: acpi [-abctV]\n\nShow status of power sources and thermal devices.\n\n-a Show power adapters\n-b Show batteries\n-c Show cooling device state\n-t Show temperatures\n-V Show everything"
-
-#define HELP_xzcat "usage: xzcat [filename...]\n\nDecompress listed files to stdout. Use stdin if no files listed."
-
-#define HELP_wget "usage: wget -O filename URL\n-O filename: specify output filename\nURL: uniform resource location, FTP/HTTP only, not HTTPS\n\nexamples:\n wget -O index.html http://www.example.com\n wget -O sample.jpg ftp://ftp.example.com:21/sample.jpg"
-
-#define HELP_vi "usage: vi FILE\nVisual text editor. Predates the existence of standardized cursor keys,\nso the controls are weird and historical."
-
-#define HELP_userdel "usage: userdel [-r] USER\nusage: deluser [-r] USER\n\nDelete USER from the SYSTEM\n\n-r remove home directory"
-
-#define HELP_useradd "usage: useradd [-SDH] [-h DIR] [-s SHELL] [-G GRP] [-g NAME] [-u UID] USER [GROUP]\n\nCreate new user, or add USER to GROUP\n\n-D Don't assign a password\n-g NAME Real name\n-G GRP Add user to existing group\n-h DIR Home directory\n-H Don't create home directory\n-s SHELL Login shell\n-S Create a system user\n-u UID User id"
-
-#define HELP_traceroute "usage: traceroute [-46FUIldnvr] [-f 1ST_TTL] [-m MAXTTL] [-p PORT] [-q PROBES]\n[-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-g GATEWAY] [-i IFACE] [-z PAUSE_MSEC] HOST [BYTES]\n\ntraceroute6 [-dnrv] [-m MAXTTL] [-p PORT] [-q PROBES][-s SRC_IP] [-t TOS] [-w WAIT_SEC]\n [-i IFACE] HOST [BYTES]\n\nTrace the route to HOST\n\n-4,-6 Force IP or IPv6 name resolution\n-F Set the don't fragment bit (supports IPV4 only)\n-U Use UDP datagrams instead of ICMP ECHO (supports IPV4 only)\n-I Use ICMP ECHO instead of UDP datagrams (supports IPV4 only)\n-l Display the TTL value of the returned packet (supports IPV4 only)\n-d Set SO_DEBUG options to socket\n-n Print numeric addresses\n-v verbose\n-r Bypass routing tables, send directly to HOST\n-m Max time-to-live (max number of hops)(RANGE 1 to 255)\n-p Base UDP port number used in probes(default 33434)(RANGE 1 to 65535)\n-q Number of probes per TTL (default 3)(RANGE 1 to 255)\n-s IP address to use as the source address\n-t Type-of-service in probe packets (default 0)(RANGE 0 to 255)\n-w Time in seconds to wait for a response (default 3)(RANGE 0 to 86400)\n-g Loose source route gateway (8 max) (supports IPV4 only)\n-z Pause Time in ms (default 0)(RANGE 0 to 86400) (supports IPV4 only)\n-f Start from the 1ST_TTL hop (instead from 1)(RANGE 1 to 255) (supports IPV4 only)\n-i Specify a network interface to operate with"
-
-#define HELP_tr "usage: tr [-cds] SET1 [SET2]\n\nTranslate, squeeze, or delete characters from stdin, writing to stdout\n\n-c/-C Take complement of SET1\n-d Delete input characters coded SET1\n-s Squeeze multiple output characters of SET2 into one character"
-
-#define HELP_tftpd "usage: tftpd [-cr] [-u USER] [DIR]\n\nTransfer file from/to tftp server.\n\n-r read only\n-c Allow file creation via upload\n-u run as USER\n-l Log to syslog (inetd mode requires this)"
-
-#define HELP_tftp "usage: tftp [OPTIONS] HOST [PORT]\n\nTransfer file from/to tftp server.\n\n-l FILE Local FILE\n-r FILE Remote FILE\n-g Get file\n-p Put file\n-b SIZE Transfer blocks of SIZE octets(8 <= SIZE <= 65464)"
-
-#define HELP_telnetd "Handle incoming telnet connections\n\n-l LOGIN Exec LOGIN on connect\n-f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue\n-K Close connection as soon as login exits\n-p PORT Port to listen on\n-b ADDR[:PORT] Address to bind to\n-F Run in foreground\n-i Inetd mode\n-w SEC Inetd 'wait' mode, linger time SEC\n-S Log to syslog (implied by -i or without -F and -w)"
-
-#define HELP_telnet "usage: telnet HOST [PORT]\n\nConnect to telnet server"
-
-#define HELP_tcpsvd "usage: tcpsvd [-hEv] [-c N] [-C N[:MSG]] [-b N] [-u User] [-l Name] IP Port Prog\nusage: udpsvd [-hEv] [-c N] [-u User] [-l Name] IP Port Prog\n\nCreate TCP/UDP socket, bind to IP:PORT and listen for incoming connection.\nRun PROG for each connection.\n\nIP IP to listen on, 0 = all\nPORT Port to listen on\nPROG ARGS Program to run\n-l NAME Local hostname (else looks up local hostname in DNS)\n-u USER[:GRP] Change to user/group after bind\n-c N Handle up to N (> 0) connections simultaneously\n-b N (TCP Only) Allow a backlog of approximately N TCP SYNs\n-C N[:MSG] (TCP Only) Allow only up to N (> 0) connections from the same IP\n New connections from this IP address are closed\n immediately. MSG is written to the peer before close\n-h Look up peer's hostname\n-E Don't set up environment variables\n-v Verbose"
-
-#define HELP_syslogd "usage: syslogd [-a socket] [-O logfile] [-f config file] [-m interval]\n [-p socket] [-s SIZE] [-b N] [-R HOST] [-l N] [-nSLKD]\n\nSystem logging utility\n\n-a Extra unix socket for listen\n-O FILE Default log file <DEFAULT: /var/log/messages>\n-f FILE Config file <DEFAULT: /etc/syslog.conf>\n-p Alternative unix domain socket <DEFAULT : /dev/log>\n-n Avoid auto-backgrounding\n-S Smaller output\n-m MARK interval <DEFAULT: 20 minutes> (RANGE: 0 to 71582787)\n-R HOST Log to IP or hostname on PORT (default PORT=514/UDP)\"\n-L Log locally and via network (default is network only if -R)\"\n-s SIZE Max size (KB) before rotation (default:200KB, 0=off)\n-b N rotated logs to keep (default:1, max=99, 0=purge)\n-K Log to kernel printk buffer (use dmesg to read it)\n-l N Log only messages more urgent than prio(default:8 max:8 min:1)\n-D Drop duplicates"
-
-#define HELP_sulogin "usage: sulogin [-t time] [tty]\n\nSingle User Login.\n-t Default Time for Single User Login"
-
-#define HELP_stty "usage: stty [-ag] [-F device] SETTING...\n\nGet/set terminal configuration.\n\n-F Open device instead of stdin\n-a Show all current settings (default differences from \"sane\")\n-g Show all current settings usable as input to stty\n\nSpecial characters (syntax ^c or undef): intr quit erase kill eof eol eol2\nswtch start stop susp rprnt werase lnext discard\n\nControl/input/output/local settings as shown by -a, '-' prefix to disable\n\nCombo settings: cooked/raw, evenp/oddp/parity, nl, ek, sane\n\nN set input and output speed (ispeed N or ospeed N for just one)\ncols N set number of columns\nrows N set number of rows\nline N set line discipline\nmin N set minimum chars per read\ntime N set read timeout\nspeed show speed only\nsize show size only"
-
-#define HELP_exit "usage: exit [status]\n\nExit shell. If no return value supplied on command line, use value\nof most recent command, or 0 if none."
-
-#define HELP_cd "usage: cd [-PL] [path]\n\nChange current directory. With no arguments, go $HOME.\n\n-P Physical path: resolve symlinks in path\n-L Local path: .. trims directories off $PWD (default)"
-
-#define HELP_sh "usage: sh [-c command] [script]\n\nCommand shell. Runs a shell script, or reads input interactively\nand responds to it.\n\n-c command line to execute\n-i interactive mode (default when STDIN is a tty)"
-
-#define HELP_route "usage: route [-ne] [-A [46]] [add|del TARGET [OPTIONS]]\n\nDisplay, add or delete network routes in the \"Forwarding Information Base\".\n\n-n Show numerical addresses (no DNS lookups)\n-e display netstat fields\n\nRouting means sending packets out a network interface to an address.\nThe kernel can tell where to send packets one hop away by examining each\ninterface's address and netmask, so the most common use of this command\nis to identify a \"gateway\" that forwards other traffic.\n\nAssigning an address to an interface automatically creates an appropriate\nnetwork route (\"ifconfig eth0 10.0.2.15/8\" does \"route add 10.0.0.0/8 eth0\"\nfor you), although some devices (such as loopback) won't show it in the\ntable. For machines more than one hop away, you need to specify a gateway\n(ala \"route add default gw 10.0.2.2\").\n\nThe address \"default\" is a wildcard address (0.0.0.0/0) matching all\npackets without a more specific route.\n\nAvailable OPTIONS include:\nreject - blocking route (force match failure)\ndev NAME - force packets out this interface (ala \"eth0\")\nnetmask - old way of saying things like ADDR/24\ngw ADDR - forward packets to gateway ADDR"
-
-#define HELP_deallocvt "usage: deallocvt [N]\n\nDeallocate unused virtual terminal /dev/ttyN, or all unused consoles."
-
-#define HELP_openvt "usage: openvt [-c N] [-sw] [command [command_options]]\n\nstart a program on a new virtual terminal (VT)\n\n-c N Use VT N\n-s Switch to new VT\n-w Wait for command to exit\n\nif -sw used together, switch back to originating VT when command completes"
-
-#define HELP_more "usage: more [FILE...]\n\nView FILE(s) (or stdin) one screenfull at a time."
-
-#define HELP_modprobe "usage: modprobe [-alrqvsDb] [-d DIR] MODULE [symbol=value][...]\n\nmodprobe utility - inserts modules and dependencies.\n\n-a Load multiple MODULEs\n-d Load modules from DIR, option may be used multiple times\n-l List (MODULE is a pattern)\n-r Remove MODULE (stacks) or do autoclean\n-q Quiet\n-v Verbose\n-s Log to syslog\n-D Show dependencies\n-b Apply blacklist to module names too"
-
-#define HELP_mke2fs_extended "usage: mke2fs [-E stride=###] [-O option[,option]]\n\n-E stride= Set RAID stripe size (in blocks)\n-O [opts] Specify fewer ext2 option flags (for old kernels)\n All of these are on by default (as appropriate)\n none Clear default options (all but journaling)\n dir_index Use htree indexes for large directories\n filetype Store file type info in directory entry\n has_journal Set by -j\n journal_dev Set by -J device=XXX\n sparse_super Don't allocate huge numbers of redundant superblocks"
-
-#define HELP_mke2fs_label "usage: mke2fs [-L label] [-M path] [-o string]\n\n-L Volume label\n-M Path to mount point\n-o Created by"
-
-#define HELP_mke2fs_gen "usage: gene2fs [options] device filename\n\nThe [options] are the same as mke2fs."
-
-#define HELP_mke2fs_journal "usage: mke2fs [-j] [-J size=###,device=XXX]\n\n-j Create journal (ext3)\n-J Journal options\n size: Number of blocks (1024-102400)\n device: Specify an external journal"
-
-#define HELP_mke2fs "usage: mke2fs [-Fnq] [-b ###] [-N|i ###] [-m ###] device\n\nCreate an ext2 filesystem on a block device or filesystem image.\n\n-F Force to run on a mounted device\n-n Don't write to device\n-q Quiet (no output)\n-b size Block size (1024, 2048, or 4096)\n-N inodes Allocate this many inodes\n-i bytes Allocate one inode for every XXX bytes of device\n-m percent Reserve this percent of filesystem space for root user"
-
-#define HELP_mdev_conf "The mdev config file (/etc/mdev.conf) contains lines that look like:\nhd[a-z][0-9]* 0:3 660\n(sd[a-z]) root:disk 660 =usb_storage\n\nEach line must contain three whitespace separated fields. The first\nfield is a regular expression matching one or more device names,\nthe second and third fields are uid:gid and file permissions for\nmatching devices. Fourth field is optional. It could be used to change\ndevice name (prefix '='), path (prefix '=' and postfix '/') or create a\nsymlink (prefix '>')."
-
-#define HELP_mdev "usage: mdev [-s]\n\nCreate devices in /dev using information from /sys.\n\n-s Scan all entries in /sys to populate /dev"
-
-#define HELP_man "usage: man [-M PATH] [-k STRING] | [SECTION] COMMAND\n\nRead manual page for system command.\n\n-k List pages with STRING in their short description\n-M Override $MANPATH\n\nMan pages are divided into 8 sections:\n1 commands 2 system calls 3 library functions 4 /dev files\n5 file formats 6 games 7 miscellaneous 8 system management\n\nSections are searched in the order 1 8 3 2 5 4 6 7 unless you specify a\nsection. Each section has a page called \"intro\", and there's a global\nintroduction under \"man-pages\"."
-
-#define HELP_lsof "usage: lsof [-lt] [-p PID1,PID2,...] [FILE...]\n\nList all open files belonging to all active processes, or processes using\nlisted FILE(s).\n\n-l list uids numerically\n-p for given comma-separated pids only (default all pids)\n-t terse (pid only) output"
-
-#define HELP_last "usage: last [-W] [-f FILE]\n\nShow listing of last logged in users.\n\n-W Display the information without host-column truncation\n-f FILE Read from file FILE instead of /var/log/wtmp"
-
-#define HELP_klogd "usage: klogd [-n] [-c N]\n\n-c N Print to console messages more urgent than prio N (1-8)\"\n-n Run in foreground"
-
-#define HELP_ipcs "usage: ipcs [[-smq] -i shmid] | [[-asmq] [-tcplu]]\n\n-i Show specific resource\nResource specification:\n-a All (default)\n-m Shared memory segments\n-q Message queues\n-s Semaphore arrays\nOutput format:\n-c Creator\n-l Limits\n-p Pid\n-t Time\n-u Summary"
-
-#define HELP_ipcrm "usage: ipcrm [ [-q msqid] [-m shmid] [-s semid]\n [-Q msgkey] [-M shmkey] [-S semkey] ... ]\n\n-mM Remove memory segment after last detach\n-qQ Remove message queue\n-sS Remove semaphore"
-
-#define HELP_ip "usage: ip [ OPTIONS ] OBJECT { COMMAND }\n\nShow / manipulate routing, devices, policy routing and tunnels.\n\nwhere OBJECT := {address | link | route | rule | tunnel}\nOPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }"
-
-#define HELP_init "usage: init\n\nSystem V style init.\n\nFirst program to run (as PID 1) when the system comes up, reading\n/etc/inittab to determine actions."
-
-#define HELP_host "usage: host [-av] [-t TYPE] NAME [SERVER]\n\nPerform DNS lookup on NAME, which can be a domain name to lookup,\nor an IPv4 dotted or IPv6 colon-separated address to reverse lookup.\nSERVER (if present) is the DNS server to use.\n\n-a -v -t ANY\n-t TYPE query records of type TYPE\n-v verbose"
-
-#define HELP_groupdel "usage: groupdel [USER] GROUP\n\nDelete a group or remove a user from a group"
-
-#define HELP_groupadd "usage: groupadd [-S] [-g GID] [USER] GROUP\n\nAdd a group or add a user to a group\n\n -g GID Group id\n -S Create a system group"
-
-#define HELP_getty "usage: getty [OPTIONS] BAUD_RATE[,BAUD_RATE]... TTY [TERMTYPE]\n\n-h Enable hardware RTS/CTS flow control\n-L Set CLOCAL (ignore Carrier Detect state)\n-m Get baud rate from modem's CONNECT status message\n-n Don't prompt for login name\n-w Wait for CR or LF before sending /etc/issue\n-i Don't display /etc/issue\n-f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue\n-l LOGIN Invoke LOGIN instead of /bin/login\n-t SEC Terminate after SEC if no login name is read\n-I INITSTR Send INITSTR before anything else\n-H HOST Log HOST into the utmp file as the hostname"
-
-#define HELP_getfattr "usage: getfattr [-d] [-h] [-n NAME] FILE...\n\nRead POSIX extended attributes.\n\n-d Show values as well as names\n-h Do not dereference symbolic links\n-n Show only attributes with the given name\n--only-values Don't show names"
-
-#define HELP_fsck "usage: fsck [-ANPRTV] [-C FD] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]...\n\nCheck and repair filesystems\n\n-A Walk /etc/fstab and check all filesystems\n-N Don't execute, just show what would be done\n-P With -A, check filesystems in parallel\n-R With -A, skip the root filesystem\n-T Don't show title on startup\n-V Verbose\n-C n Write status information to specified file descriptor\n-t TYPE List of filesystem types to check"
-
-#define HELP_fold "usage: fold [-bsu] [-w WIDTH] [FILE...]\n\nFolds (wraps) or unfolds ascii text by adding or removing newlines.\nDefault line width is 80 columns for folding and infinite for unfolding.\n\n-b Fold based on bytes instead of columns\n-s Fold/unfold at whitespace boundaries if possible\n-u Unfold text (and refold if -w is given)\n-w Set lines to WIDTH columns or bytes"
-
-#define HELP_fdisk "usage: fdisk [-lu] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SECTSZ] DISK\n\nChange partition table\n\n-u Start and End are in sectors (instead of cylinders)\n-l Show partition table for each DISK, then exit\n-b size sector size (512, 1024, 2048 or 4096)\n-C CYLINDERS Set number of cylinders/heads/sectors\n-H HEADS\n-S SECTORS"
-
-#define HELP_expr "usage: expr ARG1 OPERATOR ARG2...\n\nEvaluate expression and print result. For example, \"expr 1 + 2\".\n\nThe supported operators are (grouped from highest to lowest priority):\n\n ( ) : * / % + - != <= < >= > = & |\n\nEach constant and operator must be a separate command line argument.\nAll operators are infix, meaning they expect a constant (or expression\nthat resolves to a constant) on each side of the operator. Operators of\nthe same priority (within each group above) are evaluated left to right.\nParentheses may be used (as separate arguments) to elevate the priority\nof expressions.\n\nCalling expr from a command shell requires a lot of \\( or '*' escaping\nto avoid interpreting shell control characters.\n\nThe & and | operators are logical (not bitwise) and may operate on\nstrings (a blank string is \"false\"). Comparison operators may also\noperate on strings (alphabetical sort).\n\nConstants may be strings or integers. Comparison, logical, and regex\noperators may operate on strings (a blank string is \"false\"), other\noperators require integers."
-
-#define HELP_dumpleases "usage: dumpleases [-r|-a] [-f LEASEFILE]\n\nDisplay DHCP leases granted by udhcpd\n-f FILE, Lease file\n-r Show remaining time\n-a Show expiration time"
-
-#define HELP_diff "usage: diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2\n\n-a Treat all files as text\n-b Ignore changes in the amount of whitespace\n-B Ignore changes whose lines are all blank\n-d Try hard to find a smaller set of changes\n-i Ignore case differences\n-L Use LABEL instead of the filename in the unified header\n-N Treat absent files as empty\n-q Output only whether files differ\n-r Recurse\n-S Start with FILE when comparing directories\n-T Make tabs line up by prefixing a tab when necessary\n-s Report when two files are the same\n-t Expand tabs to spaces in output\n-u Unified diff\n-U Output LINES lines of context\n-w Ignore all whitespace\n\n--color Colored output\n--strip-trailing-cr Strip trailing '\\r's from input lines"
-
-#define HELP_dhcpd "usage: dhcpd [-46fS] [-i IFACE] [-P N] [CONFFILE]\n\n -f Run in foreground\n -i Interface to use\n -S Log to syslog too\n -P N Use port N (default ipv4 67, ipv6 547)\n -4, -6 Run as a DHCPv4 or DHCPv6 server"
-
-#define HELP_dhcp6 "usage: dhcp6 [-fbnqvR] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]\n\n Configure network dynamically using DHCP.\n\n -i Interface to use (default eth0)\n -p Create pidfile\n -s Run PROG at DHCP events\n -t Send up to N Solicit packets\n -T Pause between packets (default 3 seconds)\n -A Wait N seconds after failure (default 20)\n -f Run in foreground\n -b Background if lease is not obtained\n -n Exit if lease is not obtained\n -q Exit after obtaining lease\n -R Release IP on exit\n -S Log to syslog too\n -r Request this IP address\n -v Verbose\n\n Signals:\n USR1 Renew current lease\n USR2 Release current lease"
-
-#define HELP_dhcp "usage: dhcp [-fbnqvoCRB] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]\n [-H HOSTNAME] [-V VENDOR] [-x OPT:VAL] [-O OPT]\n\n Configure network dynamically using DHCP.\n\n -i Interface to use (default eth0)\n -p Create pidfile\n -s Run PROG at DHCP events (default /usr/share/dhcp/default.script)\n -B Request broadcast replies\n -t Send up to N discover packets\n -T Pause between packets (default 3 seconds)\n -A Wait N seconds after failure (default 20)\n -f Run in foreground\n -b Background if lease is not obtained\n -n Exit if lease is not obtained\n -q Exit after obtaining lease\n -R Release IP on exit\n -S Log to syslog too\n -a Use arping to validate offered address\n -O Request option OPT from server (cumulative)\n -o Don't request any options (unless -O is given)\n -r Request this IP address\n -x OPT:VAL Include option OPT in sent packets (cumulative)\n -F Ask server to update DNS mapping for NAME\n -H Send NAME as client hostname (default none)\n -V VENDOR Vendor identifier (default 'toybox VERSION')\n -C Don't send MAC as client identifier\n -v Verbose\n\n Signals:\n USR1 Renew current lease\n USR2 Release current lease"
-
-#define HELP_dd "usage: dd [if=FILE] [of=FILE] [ibs=N] [obs=N] [iflag=FLAGS] [oflag=FLAGS]\n [bs=N] [count=N] [seek=N] [skip=N]\n [conv=notrunc|noerror|sync|fsync] [status=noxfer|none]\n\nCopy/convert files.\n\nif=FILE Read from FILE instead of stdin\nof=FILE Write to FILE instead of stdout\nbs=N Read and write N bytes at a time\nibs=N Input block size\nobs=N Output block size\ncount=N Copy only N input blocks\nskip=N Skip N input blocks\nseek=N Skip N output blocks\niflag=FLAGS Set input flags\noflag=FLAGS Set output flags\nconv=notrunc Don't truncate output file\nconv=noerror Continue after read errors\nconv=sync Pad blocks with zeros\nconv=fsync Physically write data out before finishing\nstatus=noxfer Don't show transfer rate\nstatus=none Don't show transfer rate or records in/out\n\nFLAGS is a comma-separated list of:\n\ncount_bytes (iflag) interpret count=N in bytes, not blocks\nseek_bytes (oflag) interpret seek=N in bytes, not blocks\nskip_bytes (iflag) interpret skip=N in bytes, not blocks\n\nNumbers may be suffixed by c (*1), w (*2), b (*512), kD (*1000), k (*1024),\nMD (*1000*1000), M (*1024*1024), GD (*1000*1000*1000) or G (*1024*1024*1024)."
-
-#define HELP_crontab "usage: crontab [-u user] FILE\n [-u user] [-e | -l | -r]\n [-c dir]\n\nFiles used to schedule the execution of programs.\n\n-c crontab dir\n-e edit user's crontab\n-l list user's crontab\n-r delete user's crontab\n-u user\nFILE Replace crontab by FILE ('-': stdin)"
-
-#define HELP_crond "usage: crond [-fbS] [-l N] [-d N] [-L LOGFILE] [-c DIR]\n\nA daemon to execute scheduled commands.\n\n-b Background (default)\n-c crontab dir\n-d Set log level, log to stderr\n-f Foreground\n-l Set log level. 0 is the most verbose, default 8\n-S Log to syslog (default)\n-L Log to file"
-
-#define HELP_brctl "usage: brctl COMMAND [BRIDGE [INTERFACE]]\n\nManage ethernet bridges\n\nCommands:\nshow Show a list of bridges\naddbr BRIDGE Create BRIDGE\ndelbr BRIDGE Delete BRIDGE\naddif BRIDGE IFACE Add IFACE to BRIDGE\ndelif BRIDGE IFACE Delete IFACE from BRIDGE\nsetageing BRIDGE TIME Set ageing time\nsetfd BRIDGE TIME Set bridge forward delay\nsethello BRIDGE TIME Set hello time\nsetmaxage BRIDGE TIME Set max message age\nsetpathcost BRIDGE PORT COST Set path cost\nsetportprio BRIDGE PORT PRIO Set port priority\nsetbridgeprio BRIDGE PRIO Set bridge priority\nstp BRIDGE [1/yes/on|0/no/off] STP on/off"
-
-#define HELP_bootchartd "usage: bootchartd {start [PROG ARGS]}|stop|init\n\nCreate /var/log/bootlog.tgz with boot chart data\n\nstart: start background logging; with PROG, run PROG,\n then kill logging with USR1\nstop: send USR1 to all bootchartd processes\ninit: start background logging; stop when getty/xdm is seen\n (for init scripts)\n\nUnder PID 1: as init, then exec $bootchart_init, /init, /sbin/init"
-
-#define HELP_bc "usage: bc [-ilqsw] [file ...]\n\nbc is a command-line calculator with a Turing-complete language.\n\noptions:\n\n -i --interactive force interactive mode\n -l --mathlib use predefined math routines:\n\n s(expr) = sine of expr in radians\n c(expr) = cosine of expr in radians\n a(expr) = arctangent of expr, returning radians\n l(expr) = natural log of expr\n e(expr) = raises e to the power of expr\n j(n, x) = Bessel function of integer order n of x\n\n -q --quiet don't print version and copyright\n -s --standard error if any non-POSIX extensions are used\n -w --warn warn if any non-POSIX extensions are used"
-
-#define HELP_arping "usage: arping [-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP\n\nSend ARP requests/replies\n\n-f Quit on first ARP reply\n-q Quiet\n-b Keep broadcasting, don't go unicast\n-D Duplicated address detection mode\n-U Unsolicited ARP mode, update your neighbors\n-A ARP answer mode, update your neighbors\n-c N Stop after sending N ARP requests\n-w TIMEOUT Time to wait for ARP reply, seconds\n-I IFACE Interface to use (default eth0)\n-s SRC_IP Sender IP address\nDST_IP Target IP address"
-
-#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 (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."
-
-#define HELP_wc "usage: wc -lwcm [FILE...]\n\nCount lines, words, and characters in input.\n\n-l Show lines\n-w Show words\n-c Show bytes\n-m Show characters\n\nBy default outputs lines, words, bytes, and filename for each\nargument (or from stdin if none). Displays only either bytes\nor characters."
-
-#define HELP_uuencode "usage: uuencode [-m] [file] encode-filename\n\nUuencode stdin (or file) to stdout, with encode-filename in the output.\n\n-m Base64"
-
-#define HELP_uudecode "usage: uudecode [-o OUTFILE] [INFILE]\n\nDecode file from stdin (or INFILE).\n\n-o Write to OUTFILE instead of filename in header"
-
-#define HELP_unlink "usage: unlink FILE\n\nDelete one file."
-
-#define HELP_uniq "usage: uniq [-cduiz] [-w maxchars] [-f fields] [-s char] [input_file [output_file]]\n\nReport or filter out repeated lines in a file\n\n-c Show counts before each line\n-d Show only lines that are repeated\n-u Show only lines that are unique\n-i Ignore case when comparing lines\n-z Lines end with \\0 not \\n\n-w Compare maximum X chars per line\n-f Ignore first X fields\n-s Ignore first X chars"
-
-#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"
-
-#define HELP_true "Return zero."
-
-#define HELP_touch "usage: touch [-amch] [-d DATE] [-t TIME] [-r FILE] FILE...\n\nUpdate the access and modification times of each FILE to the current time.\n\n-a Change access time\n-m Change modification time\n-c Don't create file\n-h Change symlink\n-d Set time to DATE (in YYYY-MM-DDThh:mm:SS[.frac][tz] format)\n-t Set time to TIME (in [[CC]YY]MMDDhhmm[.ss][frac] format)\n-r Set time same as reference FILE"
-
-#define HELP_time "usage: time [-pv] COMMAND [ARGS...]\n\nRun command line and report real, user, and system time elapsed in seconds.\n(real = clock on the wall, user = cpu used by command's code,\nsystem = cpu used by OS on behalf of command.)\n\n-p POSIX format output (default)\n-v Verbose"
-
-#define HELP_test "usage: test [-bcdefghLPrSsuwx PATH] [-nz STRING] [-t FD] [X ?? Y]\n\nReturn true or false by performing tests. (With no arguments return false.)\n\n--- Tests with a single argument (after the option):\nPATH is/has:\n -b block device -f regular file -p fifo -u setuid bit\n -c char device -g setgid -r read bit -w write bit\n -d directory -h symlink -S socket -x execute bit\n -e exists -L symlink -s nonzero size\nSTRING is:\n -n nonzero size -z zero size (STRING by itself implies -n)\nFD (integer file descriptor) is:\n -t a TTY\n\n--- Tests with one argument on each side of an operator:\nTwo strings:\n = are identical != differ\nTwo integers:\n -eq equal -gt first > second -lt first < second\n -ne not equal -ge first >= second -le first <= second\n\n--- Modify or combine tests:\n ! EXPR not (swap true/false) EXPR -a EXPR and (are both true)\n ( EXPR ) evaluate this first EXPR -o EXPR or (is either true)"
-
-#define HELP_tee "usage: tee [-ai] [file...]\n\nCopy stdin to each listed file, and also to stdout.\nFilename \"-\" is a synonym for stdout.\n\n-a Append to files\n-i Ignore SIGINT"
-
-#define HELP_tar "usage: tar [-cxt] [-fvohmjkOS] [-XTCf NAME] [FILES]\n\nCreate, extract, or list files in a .tar (or compressed t?z) file.\n\nOptions:\nc Create x Extract t Test (list)\nf tar FILE (default -) C Change to DIR first v Verbose display\no Ignore owner h Follow symlinks m Ignore mtime\nJ xz compression j bzip2 compression z gzip compression\nO Extract to stdout X exclude names in FILE T include names in FILE\n\n--exclude FILENAME to exclude --full-time Show seconds with -tv\n--mode MODE Adjust modes --mtime TIME Override timestamps\n--owner NAME Set file owner to NAME --group NAME Set file group to NAME\n--sparse Record sparse files\n--restrict All archive contents must extract under one subdirctory\n--numeric-owner Save/use/display uid and gid, not user/group name\n--no-recursion Don't store directory contents"
-
-#define HELP_tail "usage: tail [-n|c NUMBER] [-f] [FILE...]\n\nCopy last lines from files to stdout. If no files listed, copy from\nstdin. Filename \"-\" is a synonym for stdin.\n\n-n Output the last NUMBER lines (default 10), +X counts from start\n-c Output the last NUMBER bytes, +NUMBER counts from start\n-f Follow FILE(s), waiting for more data to be appended"
-
-#define HELP_strings "usage: strings [-fo] [-t oxd] [-n LEN] [FILE...]\n\nDisplay printable strings in a binary file\n\n-f Show filename\n-n At least LEN characters form a string (default 4)\n-o Show offset (ala -t d)\n-t Show offset type (o=octal, d=decimal, x=hexadecimal)"
-
-#define HELP_split "usage: split [-a SUFFIX_LEN] [-b BYTES] [-l LINES] [INPUT [OUTPUT]]\n\nCopy INPUT (or stdin) data to a series of OUTPUT (or \"x\") files with\nalphabetically increasing suffix (aa, ab, ac... az, ba, bb...).\n\n-a Suffix length (default 2)\n-b BYTES/file (10, 10k, 10m, 10g...)\n-l LINES/file (default 1000)"
-
-#define HELP_sort "usage: sort [-Mbcdfginrsuz] [FILE...] [-k#[,#[x]] [-t X]] [-o FILE]\n\nSort all lines of text from input files (or stdin) to stdout.\n-M Month sort (jan, feb, etc)\n-V Version numbers (name-1.234-rc6.5b.tgz)\n-b Ignore leading blanks (or trailing blanks in second part of key)\n-c Check whether input is sorted\n-d Dictionary order (use alphanumeric and whitespace chars only)\n-f Force uppercase (case insensitive sort)\n-g General numeric sort (double precision with nan and inf)\n-i Ignore nonprinting characters\n-k Sort by \"key\" (see below)\n-n Numeric order (instead of alphabetical)\n-o Output to FILE instead of stdout\n-r Reverse\n-s Skip fallback sort (only sort with keys)\n-t Use a key separator other than whitespace\n-u Unique lines only\n-x Hexadecimal numerical sort\n-z Zero (null) terminated lines\n\nSorting by key looks at a subset of the words on each line. -k2 uses the\nsecond word to the end of the line, -k2,2 looks at only the second word,\n-k2,4 looks from the start of the second to the end of the fourth word.\n-k2.4,5 starts from the fourth character of the second word, to the end\nof the fifth word. Specifying multiple keys uses the later keys as tie\nbreakers, in order. A type specifier appended to a sort key (such as -2,2n)\napplies only to sorting that key."
-
-#define HELP_sleep "usage: sleep DURATION\n\nWait before exiting.\n\nDURATION can be a decimal fraction. An optional suffix can be \"m\"\n(minutes), \"h\" (hours), \"d\" (days), or \"s\" (seconds, the default)."
-
-#define HELP_sed "usage: sed [-inrzE] [-e SCRIPT]...|SCRIPT [-f SCRIPT_FILE]... [FILE...]\n\nStream editor. Apply one or more editing SCRIPTs to each line of input\n(from FILE or stdin) producing output (by default to stdout).\n\n-e Add SCRIPT to list\n-f Add contents of SCRIPT_FILE to list\n-i Edit each file in place (-iEXT keeps backup file with extension EXT)\n-n No default output (use the p command to output matched lines)\n-r Use extended regular expression syntax\n-E POSIX alias for -r\n-s Treat input files separately (implied by -i)\n-z Use \\0 rather than \\n as the input line separator\n\nA SCRIPT is a series of one or more COMMANDs separated by newlines or\nsemicolons. All -e SCRIPTs are concatenated together as if separated\nby newlines, followed by all lines from -f SCRIPT_FILEs, in order.\nIf no -e or -f SCRIPTs are specified, the first argument is the SCRIPT.\n\nEach COMMAND may be preceded by an address which limits the command to\napply only to the specified line(s). Commands without an address apply to\nevery line. Addresses are of the form:\n\n [ADDRESS[,ADDRESS]][!]COMMAND\n\nThe ADDRESS may be a decimal line number (starting at 1), a /regular\nexpression/ within a pair of forward slashes, or the character \"$\" which\nmatches the last line of input. (In -s or -i mode this matches the last\nline of each file, otherwise just the last line of the last file.) A single\naddress matches one line, a pair of comma separated addresses match\neverything from the first address to the second address (inclusive). If\nboth addresses are regular expressions, more than one range of lines in\neach file can match. The second address can be +N to end N lines later.\n\nREGULAR EXPRESSIONS in sed are started and ended by the same character\n(traditionally / but anything except a backslash or a newline works).\nBackslashes may be used to escape the delimiter if it occurs in the\nregex, and for the usual printf escapes (\\abcefnrtv and octal, hex,\nand unicode). An empty regex repeats the previous one. ADDRESS regexes\n(above) require the first delimiter to be escaped with a backslash when\nit isn't a forward slash (to distinguish it from the COMMANDs below).\n\nSed mostly operates on individual lines one at a time. It reads each line,\nprocesses it, and either writes it to the output or discards it before\nreading the next line. Sed can remember one additional line in a separate\nbuffer (using the h, H, g, G, and x commands), and can read the next line\nof input early (using the n and N command), but other than that command\nscripts operate on individual lines of text.\n\nEach COMMAND starts with a single character. The following commands take\nno arguments:\n\n ! Run this command when the test _didn't_ match.\n\n { Start a new command block, continuing until a corresponding \"}\".\n Command blocks may nest. If the block has an address, commands within\n the block are only run for lines within the block's address range.\n\n } End command block (this command cannot have an address)\n\n d Delete this line and move on to the next one\n (ignores remaining COMMANDs)\n\n D Delete one line of input and restart command SCRIPT (same as \"d\"\n unless you've glued lines together with \"N\" or similar)\n\n g Get remembered line (overwriting current line)\n\n G Get remembered line (appending to current line)\n\n h Remember this line (overwriting remembered line)\n\n H Remember this line (appending to remembered line, if any)\n\n l Print line, escaping \\abfrtv (but not newline), octal escaping other\n nonprintable characters, wrapping lines to terminal width with a\n backslash, and appending $ to actual end of line.\n\n n Print default output and read next line, replacing current line\n (If no next line available, quit processing script)\n\n N Append next line of input to this line, separated by a newline\n (This advances the line counter for address matching and \"=\", if no\n next line available quit processing script without default output)\n\n p Print this line\n\n P Print this line up to first newline (from \"N\")\n\n q Quit (print default output, no more commands processed or lines read)\n\n x Exchange this line with remembered line (overwrite in both directions)\n\n = Print the current line number (followed by a newline)\n\nThe following commands (may) take an argument. The \"text\" arguments (to\nthe \"a\", \"b\", and \"c\" commands) may end with an unescaped \"\\\" to append\nthe next line (for which leading whitespace is not skipped), and also\ntreat \";\" as a literal character (use \"\\;\" instead).\n\n a [text] Append text to output before attempting to read next line\n\n b [label] Branch, jumps to :label (or with no label, to end of SCRIPT)\n\n c [text] Delete line, output text at end of matching address range\n (ignores remaining COMMANDs)\n\n i [text] Print text\n\n r [file] Append contents of file to output before attempting to read\n next line.\n\n s/S/R/F Search for regex S, replace matched text with R using flags F.\n The first character after the \"s\" (anything but newline or\n backslash) is the delimiter, escape with \\ to use normally.\n\n The replacement text may contain \"&\" to substitute the matched\n text (escape it with backslash for a literal &), or \\1 through\n \\9 to substitute a parenthetical subexpression in the regex.\n You can also use the normal backslash escapes such as \\n and\n a backslash at the end of the line appends the next line.\n\n The flags are:\n\n [0-9] A number, substitute only that occurrence of pattern\n g Global, substitute all occurrences of pattern\n i Ignore case when matching\n p Print the line if match was found and replaced\n w [file] Write (append) line to file if match replaced\n\n t [label] Test, jump to :label only if an \"s\" command found a match in\n this line since last test (replacing with same text counts)\n\n T [label] Test false, jump only if \"s\" hasn't found a match.\n\n w [file] Write (append) line to file\n\n y/old/new/ Change each character in 'old' to corresponding character\n in 'new' (with standard backslash escapes, delimiter can be\n any repeated character except \\ or \\n)\n\n : [label] Labeled target for jump commands\n\n # Comment, ignore rest of this line of SCRIPT\n\nDeviations from POSIX: allow extended regular expressions with -r,\nediting in place with -i, separate with -s, NUL-separated input with -z,\nprintf escapes in text, line continuations, semicolons after all commands,\n2-address anywhere an address is allowed, \"T\" command, multiline\ncontinuations for [abc], \\; to end [abc] argument before end of line."
-
-#define HELP_rmdir "usage: rmdir [-p] [dirname...]\n\nRemove one or more directories.\n\n-p Remove path\n--ignore-fail-on-non-empty Ignore failures caused by non-empty directories"
-
-#define HELP_rm "usage: rm [-fiRrv] FILE...\n\nRemove each argument from the filesystem.\n\n-f Force: remove without confirmation, no error if it doesn't exist\n-i Interactive: prompt for confirmation\n-rR Recursive: remove directory contents\n-v Verbose"
-
-#define HELP_renice "usage: renice [-gpu] -n increment ID ..."
-
-#define HELP_pwd "usage: pwd [-L|-P]\n\nPrint working (current) directory.\n\n-L Use shell's path from $PWD (when applicable)\n-P Print canonical absolute path"
-
-#define HELP_pkill "usage: pkill [-fnovx] [-SIGNAL|-l SIGNAL] [PATTERN] [-G GID,] [-g PGRP,] [-P PPID,] [-s SID,] [-t TERM,] [-U UID,] [-u EUID,]\n\n-l Send SIGNAL (default SIGTERM)\n-V Verbose\n-f Check full command line for PATTERN\n-G Match real Group ID(s)\n-g Match Process Group(s) (0 is current user)\n-n Newest match only\n-o Oldest match only\n-P Match Parent Process ID(s)\n-s Match Session ID(s) (0 for current)\n-t Match Terminal(s)\n-U Match real User ID(s)\n-u Match effective User ID(s)\n-v Negate the match\n-x Match whole command (not substring)"
-
-#define HELP_pgrep "usage: pgrep [-clfnovx] [-d DELIM] [-L SIGNAL] [PATTERN] [-G GID,] [-g PGRP,] [-P PPID,] [-s SID,] [-t TERM,] [-U UID,] [-u EUID,]\n\nSearch for process(es). PATTERN is an extended regular expression checked\nagainst command names.\n\n-c Show only count of matches\n-d Use DELIM instead of newline\n-L Send SIGNAL instead of printing name\n-l Show command name\n-f Check full command line for PATTERN\n-G Match real Group ID(s)\n-g Match Process Group(s) (0 is current user)\n-n Newest match only\n-o Oldest match only\n-P Match Parent Process ID(s)\n-s Match Session ID(s) (0 for current)\n-t Match Terminal(s)\n-U Match real User ID(s)\n-u Match effective User ID(s)\n-v Negate the match\n-x Match whole command (not substring)"
-
-#define HELP_iotop "usage: iotop [-AaKObq] [-n NUMBER] [-d SECONDS] [-p PID,] [-u USER,]\n\nRank processes by I/O.\n\n-A All I/O, not just disk\n-a Accumulated I/O (not percentage)\n-H Show threads\n-K Kilobytes\n-k Fallback sort FIELDS (default -[D]IO,-ETIME,-PID)\n-m Maximum number of tasks to show\n-O Only show processes doing I/O\n-o Show FIELDS (default PID,PR,USER,[D]READ,[D]WRITE,SWAP,[D]IO,COMM)\n-s Sort by field number (0-X, default 6)\n-b Batch mode (no tty)\n-d Delay SECONDS between each cycle (default 3)\n-n Exit after NUMBER iterations\n-p Show these PIDs\n-u Show these USERs\n-q Quiet (no header lines)\n\nCursor LEFT/RIGHT to change sort, UP/DOWN move list, space to force\nupdate, R to reverse sort, Q to exit."
-
-#define HELP_top "usage: top [-Hbq] [-k FIELD,] [-o FIELD,] [-s SORT] [-n NUMBER] [-m LINES] [-d SECONDS] [-p PID,] [-u USER,]\n\nShow process activity in real time.\n\n-H Show threads\n-k Fallback sort FIELDS (default -S,-%CPU,-ETIME,-PID)\n-o Show FIELDS (def PID,USER,PR,NI,VIRT,RES,SHR,S,%CPU,%MEM,TIME+,CMDLINE)\n-O Add FIELDS (replacing PR,NI,VIRT,RES,SHR,S from default)\n-s Sort by field number (1-X, default 9)\n-b Batch mode (no tty)\n-d Delay SECONDS between each cycle (default 3)\n-m Maximum number of tasks to show\n-n Exit after NUMBER iterations\n-p Show these PIDs\n-u Show these USERs\n-q Quiet (no header lines)\n\nCursor LEFT/RIGHT to change sort, UP/DOWN move list, space to force\nupdate, R to reverse sort, Q to exit."
-
-#define HELP_ps "usage: ps [-AadefLlnwZ] [-gG GROUP,] [-k FIELD,] [-o FIELD,] [-p PID,] [-t TTY,] [-uU USER,]\n\nList processes.\n\nWhich processes to show (-gGuUpPt selections may be comma separated lists):\n\n-A All -a Has terminal not session leader\n-d All but session leaders -e Synonym for -A\n-g In GROUPs -G In real GROUPs (before sgid)\n-p PIDs (--pid) -P Parent PIDs (--ppid)\n-s In session IDs -t Attached to selected TTYs\n-T Show threads also -u Owned by selected USERs\n-U Real USERs (before suid)\n\nOutput modifiers:\n\n-k Sort FIELDs (-FIELD to reverse) -M Measure/pad future field widths\n-n Show numeric USER and GROUP -w Wide output (don't truncate fields)\n\nWhich FIELDs to show. (-o HELP for list, default = -o PID,TTY,TIME,CMD)\n\n-f Full listing (-o USER:12=UID,PID,PPID,C,STIME,TTY,TIME,ARGS=CMD)\n-l Long listing (-o F,S,UID,PID,PPID,C,PRI,NI,ADDR,SZ,WCHAN,TTY,TIME,CMD)\n-o Output FIELDs instead of defaults, each with optional :size and =title\n-O Add FIELDS to defaults\n-Z Include LABEL"
-
-#define HELP_printf "usage: printf FORMAT [ARGUMENT...]\n\nFormat and print ARGUMENT(s) according to FORMAT, using C printf syntax\n(% escapes for cdeEfgGiosuxX, \\ escapes for abefnrtv0 or \\OCTAL or \\xHEX)."
-
-#define HELP_patch "usage: patch [-d DIR] [-i file] [-p depth] [-Rlsu] [--dry-run]\n\nApply a unified diff to one or more files.\n\n-d Modify files in DIR\n-i Input file (default=stdin)\n-l Loose match (ignore whitespace)\n-p Number of '/' to strip from start of file paths (default=all)\n-R Reverse patch\n-s Silent except for errors\n-u Ignored (only handles \"unified\" diffs)\n--dry-run Don't change files, just confirm patch applies\n\nThis version of patch only handles unified diffs, and only modifies\na file when all hunks to that file apply. Patch prints failed hunks\nto stderr, and exits with nonzero status if any hunks fail.\n\nA file compared against /dev/null (or with a date <= the epoch) is\ncreated/deleted as appropriate."
-
-#define HELP_paste "usage: paste [-s] [-d DELIMITERS] [FILE...]\n\nMerge corresponding lines from each input file.\n\n-d List of delimiter characters to separate fields with (default is \\t)\n-s Sequential mode: turn each input file into one line of output"
-
-#define HELP_od "usage: od [-bcdosxv] [-j #] [-N #] [-w #] [-A doxn] [-t acdfoux[#]]\n\nDump data in octal/hex.\n\n-A Address base (decimal, octal, hexadecimal, none)\n-j Skip this many bytes of input\n-N Stop dumping after this many bytes\n-t Output type a(scii) c(har) d(ecimal) f(loat) o(ctal) u(nsigned) (he)x\n plus optional size in bytes\n aliases: -b=-t o1, -c=-t c, -d=-t u2, -o=-t o2, -s=-t d2, -x=-t x2\n-v Don't collapse repeated lines together\n-w Total line width in bytes (default 16)"
-
-#define HELP_nohup "usage: nohup COMMAND [ARG...]\n\nRun a command that survives the end of its terminal.\n\nRedirect tty on stdin to /dev/null, tty on stdout to \"nohup.out\"."
-
-#define HELP_nl "usage: nl [-E] [-l #] [-b MODE] [-n STYLE] [-s SEPARATOR] [-v #] [-w WIDTH] [FILE...]\n\nNumber lines of input.\n\n-E Use extended regex syntax (when doing -b pREGEX)\n-b Which lines to number: a (all) t (non-empty, default) pREGEX (pattern)\n-l Only count last of this many consecutive blank lines\n-n Number STYLE: ln (left justified) rn (right justified) rz (zero pad)\n-s Separator to use between number and line (instead of TAB)\n-v Starting line number for each section (default 1)\n-w Width of line numbers (default 6)"
-
-#define HELP_nice "usage: nice [-n PRIORITY] COMMAND [ARG...]\n\nRun a command line at an increased or decreased scheduling priority.\n\nHigher numbers make a program yield more CPU time, from -20 (highest\npriority) to 19 (lowest). By default processes inherit their parent's\nniceness (usually 0). By default this command adds 10 to the parent's\npriority. Only root can set a negative niceness level."
-
-#define HELP_mkfifo_z "usage: mkfifo [-Z CONTEXT]\n\n-Z Security context"
-
-#define HELP_mkfifo "usage: mkfifo [NAME...]\n\nCreate FIFOs (named pipes)."
-
-#define HELP_mkdir_z "usage: [-Z context]\n\n-Z Set security context"
-
-#define HELP_mkdir "usage: mkdir [-vp] [-m mode] [dirname...]\n\nCreate one or more directories.\n\n-m Set permissions of directory to mode\n-p Make parent directories as needed\n-v Verbose"
-
-#define HELP_ls "usage: ls [-ACFHLRSZacdfhiklmnpqrstux1] [--color[=auto]] [directory...]\n\nList files.\n\nwhat to show:\n-a all files including .hidden -b escape nongraphic chars\n-c use ctime for timestamps -d directory, not contents\n-i inode number -p put a '/' after dir names\n-q unprintable chars as '?' -s storage used (1024 byte units)\n-u use access time for timestamps -A list all files but . and ..\n-H follow command line symlinks -L follow symlinks\n-R recursively list in subdirs -F append /dir *exe @sym |FIFO\n-Z security context\n\noutput formats:\n-1 list one file per line -C columns (sorted vertically)\n-g like -l but no owner -h human readable sizes\n-l long (show full details) -m comma separated\n-n like -l but numeric uid/gid -o like -l but no group\n-x columns (horizontal sort) -ll long with nanoseconds (--full-time)\n--color device=yellow symlink=turquoise/red dir=blue socket=purple\n files: exe=green suid=red suidfile=redback stickydir=greenback\n =auto means detect if output is a tty.\n\nsorting (default is alphabetical):\n-f unsorted -r reverse -t timestamp -S size"
-
-#define HELP_logger "usage: logger [-s] [-t TAG] [-p [FACILITY.]PRIORITY] [message...]\n\nLog message (or stdin) to syslog.\n\n-s Also write message to stderr\n-t Use TAG instead of username to identify message source\n-p Specify PRIORITY with optional FACILITY. Default is \"user.notice\""
-
-#define HELP_ln "usage: ln [-sfnv] [-t DIR] [FROM...] TO\n\nCreate a link between FROM and TO.\nOne/two/many arguments work like \"mv\" or \"cp\".\n\n-s Create a symbolic link\n-f Force the creation of the link, even if TO already exists\n-n Symlink at TO treated as file\n-t Create links in DIR\n-T TO always treated as file, max 2 arguments\n-v Verbose"
-
-#define HELP_link "usage: link FILE NEWLINK\n\nCreate hardlink to a file."
-
-#define HELP_killall5 "usage: killall5 [-l [SIGNAL]] [-SIGNAL|-s SIGNAL] [-o PID]...\n\nSend a signal to all processes outside current session.\n\n-l List signal name(s) and number(s)\n-o PID Omit PID\n-s Send SIGNAL (default SIGTERM)"
-
-#define HELP_kill "usage: kill [-l [SIGNAL] | -s SIGNAL | -SIGNAL] pid...\n\nSend signal to process(es).\n\n-l List signal name(s) and number(s)\n-s Send SIGNAL (default SIGTERM)"
-
-#define HELP_whoami "usage: whoami\n\nPrint the current user name."
-
-#define HELP_logname "usage: logname\n\nPrint the current user name."
-
-#define HELP_groups "usage: groups [user]\n\nPrint the groups a user is in."
-
-#define HELP_id_z "usage: id [-Z]\n\n-Z Show only security context"
-
-#define HELP_id "usage: id [-nGgru] [USER...]\n\nPrint user and group ID.\n\n-n Print names instead of numeric IDs (to be used with -Ggu)\n-G Show only the group IDs\n-g Show only the effective group ID\n-r Show real ID instead of effective ID\n-u Show only the effective user ID"
-
-#define HELP_iconv "usage: iconv [-f FROM] [-t TO] [FILE...]\n\nConvert character encoding of files.\n\n-c Omit invalid chars\n-f Convert from (default utf8)\n-t Convert to (default utf8)"
-
-#define HELP_head "usage: head [-n number] [file...]\n\nCopy first lines from files to stdout. If no files listed, copy from\nstdin. Filename \"-\" is a synonym for stdin.\n\n-n Number of lines to copy\n-c Number of bytes to copy\n-q Never print headers\n-v Always print headers"
-
-#define HELP_grep "usage: grep [-EFrivwcloqsHbhn] [-ABC NUM] [-m MAX] [-e REGEX]... [-MS PATTERN]... [-f REGFILE] [FILE]...\n\nShow lines matching regular expressions. If no -e, first argument is\nregular expression to match. With no files (or \"-\" filename) read stdin.\nReturns 0 if matched, 1 if no match found, 2 for command errors.\n\n-e Regex to match. (May be repeated.)\n-f File listing regular expressions to match.\n\nfile search:\n-r Recurse into subdirectories (defaults FILE to \".\")\n-R Recurse into subdirectories and symlinks to directories\n-M Match filename pattern (--include)\n-S Skip filename pattern (--exclude)\n--exclude-dir=PATTERN Skip directory pattern\n-I Ignore binary files\n\nmatch type:\n-A Show NUM lines after -B Show NUM lines before match\n-C NUM lines context (A+B) -E extended regex syntax\n-F fixed (literal match) -a always text (not binary)\n-i case insensitive -m match MAX many lines\n-v invert match -w whole word (implies -E)\n-x whole line -z input NUL terminated\n\ndisplay modes: (default: matched line)\n-c count of matching lines -l show only matching filenames\n-o only matching part -q quiet (errors only)\n-s silent (no error msg) -Z output NUL terminated\n\noutput prefix (default: filename if checking more than 1 file)\n-H force filename -b byte offset of match\n-h hide filename -n line number of match"
-
-#define HELP_getconf "usage: getconf -a [PATH] | -l | NAME [PATH]\n\nGet system configuration values. Values from pathconf(3) require a path.\n\n-a Show all (defaults to \"/\" if no path given)\n-l List available value names (grouped by source)"
-
-#define HELP_find "usage: find [-HL] [DIR...] [<options>]\n\nSearch directories for matching files.\nDefault: search \".\", match all, -print matches.\n\n-H Follow command line symlinks -L Follow all symlinks\n\nMatch filters:\n-name PATTERN filename with wildcards (-iname case insensitive)\n-path PATTERN path name with wildcards (-ipath case insensitive)\n-user UNAME belongs to user UNAME -nouser user ID not known\n-group GROUP belongs to group GROUP -nogroup group ID not known\n-perm [-/]MODE permissions (-=min /=any) -prune ignore dir contents\n-size N[c] 512 byte blocks (c=bytes) -xdev only this filesystem\n-links N hardlink count -atime N[u] accessed N units ago\n-ctime N[u] created N units ago -mtime N[u] modified N units ago\n-newer FILE newer mtime than FILE -mindepth N at least N dirs down\n-depth ignore contents of dir -maxdepth N at most N dirs down\n-inum N inode number N -empty empty files and dirs\n-type [bcdflps] type is (block, char, dir, file, symlink, pipe, socket)\n-true always true -false always false\n-context PATTERN security context\n-newerXY FILE X=acm time > FILE's Y=acm time (Y=t: FILE is literal time)\n\nNumbers N may be prefixed by a - (less than) or + (greater than). Units for\n-Xtime are d (days, default), h (hours), m (minutes), or s (seconds).\n\nCombine matches with:\n!, -a, -o, ( ) not, and, or, group expressions\n\nActions:\n-print Print match with newline -print0 Print match with null\n-exec Run command with path -execdir Run command in file's dir\n-ok Ask before exec -okdir Ask before execdir\n-delete Remove matching file/dir -printf FORMAT Print using format string\n\nCommands substitute \"{}\" with matched file. End with \";\" to run each file,\nor \"+\" (next argument after \"{}\") to collect and run with multiple files.\n\n-printf FORMAT characters are \\ escapes and:\n%b 512 byte blocks used\n%f basename %g textual gid %G numeric gid\n%i decimal inode %l target of symlink %m octal mode\n%M ls format type/mode %p path to file %P path to file minus DIR\n%s size in bytes %T@ mod time as unixtime\n%u username %U numeric uid %Z security context"
-
-#define HELP_file "usage: file [-bhLs] [file...]\n\nExamine the given files and describe their content types.\n\n-b Brief (no filename)\n-h Don't follow symlinks (default)\n-L Follow symlinks\n-s Show block/char device contents"
-
-#define HELP_false "Return nonzero."
-
-#define HELP_expand "usage: expand [-t TABLIST] [FILE...]\n\nExpand tabs to spaces according to tabstops.\n\n-t TABLIST\n\nSpecify tab stops, either a single number instead of the default 8,\nor a comma separated list of increasing numbers representing tabstop\npositions (absolute, not increments) with each additional tab beyond\nthat becoming one space."
-
-#define HELP_env "usage: env [-i] [-u NAME] [NAME=VALUE...] [COMMAND [ARG...]]\n\nSet the environment for command invocation, or list environment variables.\n\n-i Clear existing environment\n-u NAME Remove NAME from the environment\n-0 Use null instead of newline in output"
-
-#define HELP_echo "usage: echo [-neE] [args...]\n\nWrite each argument to stdout, with one space between each, followed\nby a newline.\n\n-n No trailing newline\n-E Print escape sequences literally (default)\n-e Process the following escape sequences:\n \\\\ Backslash\n \\0NNN Octal values (1 to 3 digits)\n \\a Alert (beep/flash)\n \\b Backspace\n \\c Stop output here (avoids trailing newline)\n \\f Form feed\n \\n Newline\n \\r Carriage return\n \\t Horizontal tab\n \\v Vertical tab\n \\xHH Hexadecimal values (1 to 2 digits)"
-
-#define HELP_du "usage: du [-d N] [-askxHLlmc] [file...]\n\nShow disk usage, space consumed by files and directories.\n\nSize in:\n-k 1024 byte blocks (default)\n-K 512 byte blocks (posix)\n-m Megabytes\n-h Human readable (e.g., 1K 243M 2G)\n\nWhat to show:\n-a All files, not just directories\n-H Follow symlinks on cmdline\n-L Follow all symlinks\n-s Only total size of each argument\n-x Don't leave this filesystem\n-c Cumulative total\n-d N Only depth < N\n-l Disable hardlink filter"
-
-#define HELP_dirname "usage: dirname PATH...\n\nShow directory portion of path."
-
-#define HELP_df "usage: df [-HPkhi] [-t type] [FILESYSTEM ...]\n\nThe \"disk free\" command shows total/used/available disk space for\neach filesystem listed on the command line, or all currently mounted\nfilesystems.\n\n-a Show all (including /proc and friends)\n-P The SUSv3 \"Pedantic\" option\n-k Sets units back to 1024 bytes (the default without -P)\n-h Human readable (K=1024)\n-H Human readable (k=1000)\n-i Show inodes instead of blocks\n-t type Display only filesystems of this type\n\nPedantic provides a slightly less useful output format dictated by Posix,\nand sets the units to 512 bytes instead of the default 1024 bytes."
-
-#define HELP_date "usage: date [-u] [-r FILE] [-d DATE] [+DISPLAY_FORMAT] [-D SET_FORMAT] [SET]\n\nSet/get the current date/time. With no SET shows the current date.\n\n-d Show DATE instead of current time (convert date format)\n-D +FORMAT for SET or -d (instead of MMDDhhmm[[CC]YY][.ss])\n-r Use modification time of FILE instead of current date\n-u Use UTC instead of current timezone\n\nSupported input formats:\n\nMMDDhhmm[[CC]YY][.ss] POSIX\n@UNIXTIME[.FRACTION] seconds since midnight 1970-01-01\nYYYY-MM-DD [hh:mm[:ss]] ISO 8601\nhh:mm[:ss] 24-hour time today\n\nAll input formats can be preceded by TZ=\"id\" to set the input time zone\nseparately from the output time zone. Otherwise $TZ sets both.\n\n+FORMAT specifies display format string using strftime(3) syntax:\n\n%% literal % %n newline %t tab\n%S seconds (00-60) %M minute (00-59) %m month (01-12)\n%H hour (0-23) %I hour (01-12) %p AM/PM\n%y short year (00-99) %Y year %C century\n%a short weekday name %A weekday name %u day of week (1-7, 1=mon)\n%b short month name %B month name %Z timezone name\n%j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)\n%N nanosec (output only)\n\n%U Week of year (0-53 start sunday) %W Week of year (0-53 start monday)\n%V Week of year (1-53 start monday, week < 4 days not part of this year)\n\n%D = \"%m/%d/%y\" %r = \"%I : %M : %S %p\" %T = \"%H:%M:%S\" %h = \"%b\"\n%x locale date %X locale time %c locale date/time"
-
-#define HELP_cut "usage: cut [-Ds] [-bcfF LIST] [-dO DELIM] [FILE...]\n\nPrint selected parts of lines from each FILE to standard output.\n\nEach selection LIST is comma separated, either numbers (counting from 1)\nor dash separated ranges (inclusive, with X- meaning to end of line and -X\nfrom start). By default selection ranges are sorted and collated, use -D\nto prevent that.\n\n-b Select bytes\n-c Select UTF-8 characters\n-C Select unicode columns\n-d Use DELIM (default is TAB for -f, run of whitespace for -F)\n-D Don't sort/collate selections or match -fF lines without delimiter\n-f Select fields (words) separated by single DELIM character\n-F Select fields separated by DELIM regex\n-O Output delimiter (default one space for -F, input delim for -f)\n-s Skip lines without delimiters"
-
-#define HELP_cpio "usage: cpio -{o|t|i|p DEST} [-v] [--verbose] [-F FILE] [--no-preserve-owner]\n [ignored: -mdu -H newc]\n\nCopy files into and out of a \"newc\" format cpio archive.\n\n-F FILE Use archive FILE instead of stdin/stdout\n-p DEST Copy-pass mode, copy stdin file list to directory DEST\n-i Extract from archive into file system (stdin=archive)\n-o Create archive (stdin=list of files, stdout=archive)\n-t Test files (list only, stdin=archive, stdout=list of files)\n-v Verbose\n--no-preserve-owner (don't set ownership during extract)\n--trailer Add legacy trailer (prevents concatenation)"
-
-#define HELP_install "usage: install [-dDpsv] [-o USER] [-g GROUP] [-m MODE] [SOURCE...] DEST\n\nCopy files and set attributes.\n\n-d Act like mkdir -p\n-D Create leading directories for DEST\n-g Make copy belong to GROUP\n-m Set permissions to MODE\n-o Make copy belong to USER\n-p Preserve timestamps\n-s Call \"strip -p\"\n-v Verbose"
-
-#define HELP_mv "usage: mv [-fivn] SOURCE... DEST\n\n-f Force copy by deleting destination file\n-i Interactive, prompt before overwriting existing DEST\n-v Verbose\n-n No clobber (don't overwrite DEST)"
-
-#define HELP_cp_preserve "--preserve takes either a comma separated list of attributes, or the first\nletter(s) of:\n\n mode - permissions (ignore umask for rwx, copy suid and sticky bit)\n ownership - user and group\n timestamps - file creation, modification, and access times.\n context - security context\n xattr - extended attributes\n all - all of the above\n\nusage: cp [--preserve=motcxa] [-adlnrsvfipRHLP] SOURCE... DEST\n\nCopy files from SOURCE to DEST. If more than one SOURCE, DEST must\nbe a directory.\n-v Verbose\n-s Symlink instead of copy\n-r Synonym for -R\n-n No clobber (don't overwrite DEST)\n-l Hard link instead of copy\n-d Don't dereference symlinks\n-a Same as -dpr\n-P Do not follow symlinks [default]\n-L Follow all symlinks\n-H Follow symlinks listed on command line\n-R Recurse into subdirectories (DEST must be a directory)\n-p Preserve timestamps, ownership, and mode\n-i Interactive, prompt before overwriting existing DEST\n-F Delete any existing destination file first (--remove-destination)\n-f Delete destination files we can't write to\n-D Create leading dirs under DEST (--parents)"
-
-#define HELP_cp "usage: cp [--preserve=motcxa] [-adlnrsvfipRHLP] SOURCE... DEST\n\nCopy files from SOURCE to DEST. If more than one SOURCE, DEST must\nbe a directory.\n-v Verbose\n-s Symlink instead of copy\n-r Synonym for -R\n-n No clobber (don't overwrite DEST)\n-l Hard link instead of copy\n-d Don't dereference symlinks\n-a Same as -dpr\n-P Do not follow symlinks [default]\n-L Follow all symlinks\n-H Follow symlinks listed on command line\n-R Recurse into subdirectories (DEST must be a directory)\n-p Preserve timestamps, ownership, and mode\n-i Interactive, prompt before overwriting existing DEST\n-F Delete any existing destination file first (--remove-destination)\n-f Delete destination files we can't write to\n-D Create leading dirs under DEST (--parents)\n--preserve takes either a comma separated list of attributes, or the first\nletter(s) of:\n\n mode - permissions (ignore umask for rwx, copy suid and sticky bit)\n ownership - user and group\n timestamps - file creation, modification, and access times.\n context - security context\n xattr - extended attributes\n all - all of the above"
-
-#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 [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."
-
-#define HELP_cksum "usage: cksum [-IPLN] [file...]\n\nFor each file, output crc32 checksum value, length and name of file.\nIf no files listed, copy from stdin. Filename \"-\" is a synonym for stdin.\n\n-H Hexadecimal checksum (defaults to decimal)\n-L Little endian (defaults to big endian)\n-P Pre-inversion\n-I Skip post-inversion\n-N Do not include length in CRC calculation (or output)"
-
-#define HELP_chmod "usage: chmod [-R] MODE FILE...\n\nChange mode of listed file[s] (recursively with -R).\n\nMODE can be (comma-separated) stanzas: [ugoa][+-=][rwxstXugo]\n\nStanzas are applied in order: For each category (u = user,\ng = group, o = other, a = all three, if none specified default is a),\nset (+), clear (-), or copy (=), r = read, w = write, x = execute.\ns = u+s = suid, g+s = sgid, o+s = sticky. (+t is an alias for o+s).\nsuid/sgid: execute as the user/group who owns the file.\nsticky: can't delete files you don't own out of this directory\nX = x for directories or if any category already has x set.\n\nOr MODE can be an octal value up to 7777 ug uuugggooo top +\nbit 1 = o+x, bit 1<<8 = u+w, 1<<11 = g+1 sstrwxrwxrwx bottom\n\nExamples:\nchmod u+w file - allow owner of \"file\" to write to it.\nchmod 744 file - user can read/write/execute, everyone else read only"
-
-#define HELP_chown "see: chgrp"
-
-#define HELP_chgrp "usage: chgrp/chown [-RHLP] [-fvh] group file...\n\nChange group of one or more files.\n\n-f Suppress most error messages\n-h Change symlinks instead of what they point to\n-R Recurse into subdirectories (implies -h)\n-H With -R change target of symlink, follow command line symlinks\n-L With -R change target of symlink, follow all symlinks\n-P With -R change symlink, do not follow symlinks (default)\n-v Verbose"
-
-#define HELP_catv "usage: catv [-evt] [filename...]\n\nDisplay nonprinting characters as escape sequences. Use M-x for\nhigh ascii characters (>127), and ^x for other nonprinting chars.\n\n-e Mark each newline with $\n-t Show tabs as ^I\n-v Don't use ^x or M-x escapes"
-
-#define HELP_cat "usage: cat [-etuv] [file...]\n\nCopy (concatenate) files to stdout. If no files listed, copy from stdin.\nFilename \"-\" is a synonym for stdin.\n\n-e Mark each newline with $\n-t Show tabs as ^I\n-u Copy one byte at a time (slow)\n-v Display nonprinting characters as escape sequences with M-x for\n high ascii characters (>127), and ^x for other nonprinting chars"
-
-#define HELP_cal "usage: cal [[month] year]\n\nPrint a calendar.\n\nWith one argument, prints all months of the specified year.\nWith two arguments, prints calendar for month and year."
-
-#define HELP_basename "usage: basename [-a] [-s SUFFIX] NAME... | NAME [SUFFIX]\n\nReturn non-directory portion of a pathname removing suffix.\n\n-a All arguments are names\n-s SUFFIX Remove suffix (implies -a)"
-
diff --git a/android/mac/generated/config.h b/android/mac/generated/config.h
deleted file mode 100644
index e04fd9c5..00000000
--- a/android/mac/generated/config.h
+++ /dev/null
@@ -1,646 +0,0 @@
-#define CFG_TOYBOX_ANDROID_SCHEDPOLICY 0
-#define USE_TOYBOX_ANDROID_SCHEDPOLICY(...)
-#define CFG_TOYBOX_CONTAINER 0
-#define USE_TOYBOX_CONTAINER(...)
-#define CFG_TOYBOX_DEBUG 0
-#define USE_TOYBOX_DEBUG(...)
-#define CFG_TOYBOX_FALLOCATE 0
-#define USE_TOYBOX_FALLOCATE(...)
-#define CFG_TOYBOX_FIFREEZE 0
-#define USE_TOYBOX_FIFREEZE(...)
-#define CFG_TOYBOX_FLOAT 1
-#define USE_TOYBOX_FLOAT(...) __VA_ARGS__
-#define CFG_TOYBOX_FORK 1
-#define USE_TOYBOX_FORK(...) __VA_ARGS__
-#define CFG_TOYBOX_FREE 0
-#define USE_TOYBOX_FREE(...)
-#define CFG_TOYBOX_GETRANDOM 0
-#define USE_TOYBOX_GETRANDOM(...)
-#define CFG_TOYBOX_HELP_DASHDASH 1
-#define USE_TOYBOX_HELP_DASHDASH(...) __VA_ARGS__
-#define CFG_TOYBOX_HELP 1
-#define USE_TOYBOX_HELP(...) __VA_ARGS__
-#define CFG_TOYBOX_I18N 1
-#define USE_TOYBOX_I18N(...) __VA_ARGS__
-#define CFG_TOYBOX_ICONV 1
-#define USE_TOYBOX_ICONV(...) __VA_ARGS__
-#define CFG_TOYBOX_LIBCRYPTO 1
-#define USE_TOYBOX_LIBCRYPTO(...) __VA_ARGS__
-#define CFG_TOYBOX_LIBZ 1
-#define USE_TOYBOX_LIBZ(...) __VA_ARGS__
-#define CFG_TOYBOX_LSM_NONE 1
-#define USE_TOYBOX_LSM_NONE(...) __VA_ARGS__
-#define CFG_TOYBOX_MUSL_NOMMU_IS_BROKEN 0
-#define USE_TOYBOX_MUSL_NOMMU_IS_BROKEN(...)
-#define CFG_TOYBOX_NORECURSE 0
-#define USE_TOYBOX_NORECURSE(...)
-#define CFG_TOYBOX_ON_ANDROID 0
-#define USE_TOYBOX_ON_ANDROID(...)
-#define CFG_TOYBOX_PEDANTIC_ARGS 0
-#define USE_TOYBOX_PEDANTIC_ARGS(...)
-#define CFG_TOYBOX_PRLIMIT 0
-#define USE_TOYBOX_PRLIMIT(...)
-#define CFG_TOYBOX_SELINUX 0
-#define USE_TOYBOX_SELINUX(...)
-#define CFG_TOYBOX_SHADOW 0
-#define USE_TOYBOX_SHADOW(...)
-#define CFG_TOYBOX_SMACK 0
-#define USE_TOYBOX_SMACK(...)
-#define CFG_TOYBOX_SUID 1
-#define USE_TOYBOX_SUID(...) __VA_ARGS__
-#define CFG_TOYBOX_UID_SYS 100
-#define CFG_TOYBOX_UID_USR 500
-#define CFG_TOYBOX_UTMPX 0
-#define USE_TOYBOX_UTMPX(...)
-#define CFG_TOYBOX 1
-#define USE_TOYBOX(...) __VA_ARGS__
-#define CFG_ACPI 0
-#define USE_ACPI(...)
-#define CFG_ARCH 0
-#define USE_ARCH(...)
-#define CFG_ARPING 0
-#define USE_ARPING(...)
-#define CFG_ARP 0
-#define USE_ARP(...)
-#define CFG_ASCII 0
-#define USE_ASCII(...)
-#define CFG_BASE64 0
-#define USE_BASE64(...)
-#define CFG_BASENAME 1
-#define USE_BASENAME(...) __VA_ARGS__
-#define CFG_BC 1
-#define USE_BC(...) __VA_ARGS__
-#define CFG_BLKID 0
-#define USE_BLKID(...)
-#define CFG_BLOCKDEV 0
-#define USE_BLOCKDEV(...)
-#define CFG_BOOTCHARTD 0
-#define USE_BOOTCHARTD(...)
-#define CFG_BRCTL 0
-#define USE_BRCTL(...)
-#define CFG_BUNZIP2 0
-#define USE_BUNZIP2(...)
-#define CFG_BZCAT 0
-#define USE_BZCAT(...)
-#define CFG_CAL 0
-#define USE_CAL(...)
-#define CFG_CATV 0
-#define USE_CATV(...)
-#define CFG_CAT_V 1
-#define USE_CAT_V(...) __VA_ARGS__
-#define CFG_CAT 1
-#define USE_CAT(...) __VA_ARGS__
-#define CFG_CD 0
-#define USE_CD(...)
-#define CFG_CHATTR 0
-#define USE_CHATTR(...)
-#define CFG_CHCON 0
-#define USE_CHCON(...)
-#define CFG_CHGRP 0
-#define USE_CHGRP(...)
-#define CFG_CHMOD 1
-#define USE_CHMOD(...) __VA_ARGS__
-#define CFG_CHOWN 0
-#define USE_CHOWN(...)
-#define CFG_CHROOT 0
-#define USE_CHROOT(...)
-#define CFG_CHRT 0
-#define USE_CHRT(...)
-#define CFG_CHVT 0
-#define USE_CHVT(...)
-#define CFG_CKSUM 0
-#define USE_CKSUM(...)
-#define CFG_CLEAR 0
-#define USE_CLEAR(...)
-#define CFG_CMP 1
-#define USE_CMP(...) __VA_ARGS__
-#define CFG_COMM 1
-#define USE_COMM(...) __VA_ARGS__
-#define CFG_COUNT 0
-#define USE_COUNT(...)
-#define CFG_CPIO 0
-#define USE_CPIO(...)
-#define CFG_CP_PRESERVE 1
-#define USE_CP_PRESERVE(...) __VA_ARGS__
-#define CFG_CP 1
-#define USE_CP(...) __VA_ARGS__
-#define CFG_CRC32 0
-#define USE_CRC32(...)
-#define CFG_CROND 0
-#define USE_CROND(...)
-#define CFG_CRONTAB 0
-#define USE_CRONTAB(...)
-#define CFG_CUT 1
-#define USE_CUT(...) __VA_ARGS__
-#define CFG_DATE 1
-#define USE_DATE(...) __VA_ARGS__
-#define CFG_DD 1
-#define USE_DD(...) __VA_ARGS__
-#define CFG_DEALLOCVT 0
-#define USE_DEALLOCVT(...)
-#define CFG_DEBUG_DHCP 0
-#define USE_DEBUG_DHCP(...)
-#define CFG_DEMO_MANY_OPTIONS 0
-#define USE_DEMO_MANY_OPTIONS(...)
-#define CFG_DEMO_NUMBER 0
-#define USE_DEMO_NUMBER(...)
-#define CFG_DEMO_SCANKEY 0
-#define USE_DEMO_SCANKEY(...)
-#define CFG_DEMO_UTF8TOWC 0
-#define USE_DEMO_UTF8TOWC(...)
-#define CFG_DEVMEM 0
-#define USE_DEVMEM(...)
-#define CFG_DF 0
-#define USE_DF(...)
-#define CFG_DHCP6 0
-#define USE_DHCP6(...)
-#define CFG_DHCPD 0
-#define USE_DHCPD(...)
-#define CFG_DHCP 0
-#define USE_DHCP(...)
-#define CFG_DIFF 1
-#define USE_DIFF(...) __VA_ARGS__
-#define CFG_DIRNAME 1
-#define USE_DIRNAME(...) __VA_ARGS__
-#define CFG_DMESG 0
-#define USE_DMESG(...)
-#define CFG_DNSDOMAINNAME 0
-#define USE_DNSDOMAINNAME(...)
-#define CFG_DOS2UNIX 1
-#define USE_DOS2UNIX(...) __VA_ARGS__
-#define CFG_DUMPLEASES 0
-#define USE_DUMPLEASES(...)
-#define CFG_DU 1
-#define USE_DU(...) __VA_ARGS__
-#define CFG_ECHO 1
-#define USE_ECHO(...) __VA_ARGS__
-#define CFG_EGREP 1
-#define USE_EGREP(...) __VA_ARGS__
-#define CFG_EJECT 0
-#define USE_EJECT(...)
-#define CFG_ENV 1
-#define USE_ENV(...) __VA_ARGS__
-#define CFG_EXIT 0
-#define USE_EXIT(...)
-#define CFG_EXPAND 0
-#define USE_EXPAND(...)
-#define CFG_EXPR 1
-#define USE_EXPR(...) __VA_ARGS__
-#define CFG_FACTOR 0
-#define USE_FACTOR(...)
-#define CFG_FALLOCATE 0
-#define USE_FALLOCATE(...)
-#define CFG_FALSE 0
-#define USE_FALSE(...)
-#define CFG_FDISK 0
-#define USE_FDISK(...)
-#define CFG_FGREP 0
-#define USE_FGREP(...)
-#define CFG_FILE 0
-#define USE_FILE(...)
-#define CFG_FIND 1
-#define USE_FIND(...) __VA_ARGS__
-#define CFG_FLOCK 0
-#define USE_FLOCK(...)
-#define CFG_FMT 0
-#define USE_FMT(...)
-#define CFG_FOLD 0
-#define USE_FOLD(...)
-#define CFG_FREE 0
-#define USE_FREE(...)
-#define CFG_FREERAMDISK 0
-#define USE_FREERAMDISK(...)
-#define CFG_FSCK 0
-#define USE_FSCK(...)
-#define CFG_FSFREEZE 0
-#define USE_FSFREEZE(...)
-#define CFG_FSTYPE 0
-#define USE_FSTYPE(...)
-#define CFG_FSYNC 0
-#define USE_FSYNC(...)
-#define CFG_FTPGET 0
-#define USE_FTPGET(...)
-#define CFG_FTPPUT 0
-#define USE_FTPPUT(...)
-#define CFG_GETCONF 1
-#define USE_GETCONF(...) __VA_ARGS__
-#define CFG_GETENFORCE 0
-#define USE_GETENFORCE(...)
-#define CFG_GETFATTR 0
-#define USE_GETFATTR(...)
-#define CFG_GETTY 0
-#define USE_GETTY(...)
-#define CFG_GREP 1
-#define USE_GREP(...) __VA_ARGS__
-#define CFG_GROUPADD 0
-#define USE_GROUPADD(...)
-#define CFG_GROUPDEL 0
-#define USE_GROUPDEL(...)
-#define CFG_GROUPS 0
-#define USE_GROUPS(...)
-#define CFG_GUNZIP 0
-#define USE_GUNZIP(...)
-#define CFG_GZIP 0
-#define USE_GZIP(...)
-#define CFG_HEAD 1
-#define USE_HEAD(...) __VA_ARGS__
-#define CFG_HELLO 0
-#define USE_HELLO(...)
-#define CFG_HELP_EXTRAS 0
-#define USE_HELP_EXTRAS(...)
-#define CFG_HELP 0
-#define USE_HELP(...)
-#define CFG_HEXEDIT 0
-#define USE_HEXEDIT(...)
-#define CFG_HOSTID 0
-#define USE_HOSTID(...)
-#define CFG_HOST 0
-#define USE_HOST(...)
-#define CFG_HOSTNAME 1
-#define USE_HOSTNAME(...) __VA_ARGS__
-#define CFG_HWCLOCK 0
-#define USE_HWCLOCK(...)
-#define CFG_I2CDETECT 0
-#define USE_I2CDETECT(...)
-#define CFG_I2CDUMP 0
-#define USE_I2CDUMP(...)
-#define CFG_I2CGET 0
-#define USE_I2CGET(...)
-#define CFG_I2CSET 0
-#define USE_I2CSET(...)
-#define CFG_ICONV 0
-#define USE_ICONV(...)
-#define CFG_ID 1
-#define USE_ID(...) __VA_ARGS__
-#define CFG_ID_Z 0
-#define USE_ID_Z(...)
-#define CFG_IFCONFIG 0
-#define USE_IFCONFIG(...)
-#define CFG_INIT 0
-#define USE_INIT(...)
-#define CFG_INOTIFYD 0
-#define USE_INOTIFYD(...)
-#define CFG_INSMOD 0
-#define USE_INSMOD(...)
-#define CFG_INSTALL 0
-#define USE_INSTALL(...)
-#define CFG_IONICE 0
-#define USE_IONICE(...)
-#define CFG_IORENICE 0
-#define USE_IORENICE(...)
-#define CFG_IOTOP 0
-#define USE_IOTOP(...)
-#define CFG_IPCRM 0
-#define USE_IPCRM(...)
-#define CFG_IPCS 0
-#define USE_IPCS(...)
-#define CFG_IP 0
-#define USE_IP(...)
-#define CFG_KILLALL5 0
-#define USE_KILLALL5(...)
-#define CFG_KILLALL 0
-#define USE_KILLALL(...)
-#define CFG_KILL 0
-#define USE_KILL(...)
-#define CFG_KLOGD 0
-#define USE_KLOGD(...)
-#define CFG_KLOGD_SOURCE_RING_BUFFER 0
-#define USE_KLOGD_SOURCE_RING_BUFFER(...)
-#define CFG_LAST 0
-#define USE_LAST(...)
-#define CFG_LINK 0
-#define USE_LINK(...)
-#define CFG_LN 1
-#define USE_LN(...) __VA_ARGS__
-#define CFG_LOAD_POLICY 0
-#define USE_LOAD_POLICY(...)
-#define CFG_LOGGER 0
-#define USE_LOGGER(...)
-#define CFG_LOGIN 0
-#define USE_LOGIN(...)
-#define CFG_LOG 0
-#define USE_LOG(...)
-#define CFG_LOGNAME 0
-#define USE_LOGNAME(...)
-#define CFG_LOGWRAPPER 0
-#define USE_LOGWRAPPER(...)
-#define CFG_LOSETUP 0
-#define USE_LOSETUP(...)
-#define CFG_LSATTR 0
-#define USE_LSATTR(...)
-#define CFG_LSMOD 0
-#define USE_LSMOD(...)
-#define CFG_LSOF 0
-#define USE_LSOF(...)
-#define CFG_LSPCI 0
-#define USE_LSPCI(...)
-#define CFG_LSPCI_TEXT 0
-#define USE_LSPCI_TEXT(...)
-#define CFG_LSUSB 0
-#define USE_LSUSB(...)
-#define CFG_LS 1
-#define USE_LS(...) __VA_ARGS__
-#define CFG_MAKEDEVS 0
-#define USE_MAKEDEVS(...)
-#define CFG_MAN 0
-#define USE_MAN(...)
-#define CFG_MCOOKIE 0
-#define USE_MCOOKIE(...)
-#define CFG_MD5SUM 1
-#define USE_MD5SUM(...) __VA_ARGS__
-#define CFG_MDEV_CONF 0
-#define USE_MDEV_CONF(...)
-#define CFG_MDEV 0
-#define USE_MDEV(...)
-#define CFG_MICROCOM 1
-#define USE_MICROCOM(...) __VA_ARGS__
-#define CFG_MIX 0
-#define USE_MIX(...)
-#define CFG_MKDIR 1
-#define USE_MKDIR(...) __VA_ARGS__
-#define CFG_MKDIR_Z 0
-#define USE_MKDIR_Z(...)
-#define CFG_MKE2FS_EXTENDED 0
-#define USE_MKE2FS_EXTENDED(...)
-#define CFG_MKE2FS_GEN 0
-#define USE_MKE2FS_GEN(...)
-#define CFG_MKE2FS 0
-#define USE_MKE2FS(...)
-#define CFG_MKE2FS_JOURNAL 0
-#define USE_MKE2FS_JOURNAL(...)
-#define CFG_MKE2FS_LABEL 0
-#define USE_MKE2FS_LABEL(...)
-#define CFG_MKFIFO 0
-#define USE_MKFIFO(...)
-#define CFG_MKFIFO_Z 0
-#define USE_MKFIFO_Z(...)
-#define CFG_MKNOD 0
-#define USE_MKNOD(...)
-#define CFG_MKNOD_Z 0
-#define USE_MKNOD_Z(...)
-#define CFG_MKPASSWD 0
-#define USE_MKPASSWD(...)
-#define CFG_MKSWAP 0
-#define USE_MKSWAP(...)
-#define CFG_MKTEMP 1
-#define USE_MKTEMP(...) __VA_ARGS__
-#define CFG_MODINFO 0
-#define USE_MODINFO(...)
-#define CFG_MODPROBE 0
-#define USE_MODPROBE(...)
-#define CFG_MORE 0
-#define USE_MORE(...)
-#define CFG_MOUNT 0
-#define USE_MOUNT(...)
-#define CFG_MOUNTPOINT 0
-#define USE_MOUNTPOINT(...)
-#define CFG_MV 1
-#define USE_MV(...) __VA_ARGS__
-#define CFG_NBD_CLIENT 0
-#define USE_NBD_CLIENT(...)
-#define CFG_NETCAT 0
-#define USE_NETCAT(...)
-#define CFG_NETCAT_LISTEN 0
-#define USE_NETCAT_LISTEN(...)
-#define CFG_NETSTAT 0
-#define USE_NETSTAT(...)
-#define CFG_NICE 0
-#define USE_NICE(...)
-#define CFG_NL 0
-#define USE_NL(...)
-#define CFG_NOHUP 0
-#define USE_NOHUP(...)
-#define CFG_NPROC 0
-#define USE_NPROC(...)
-#define CFG_NSENTER 0
-#define USE_NSENTER(...)
-#define CFG_OD 1
-#define USE_OD(...) __VA_ARGS__
-#define CFG_ONEIT 0
-#define USE_ONEIT(...)
-#define CFG_OPENVT 0
-#define USE_OPENVT(...)
-#define CFG_PARTPROBE 0
-#define USE_PARTPROBE(...)
-#define CFG_PASSWD 0
-#define USE_PASSWD(...)
-#define CFG_PASSWD_SAD 0
-#define USE_PASSWD_SAD(...)
-#define CFG_PASTE 1
-#define USE_PASTE(...) __VA_ARGS__
-#define CFG_PATCH 1
-#define USE_PATCH(...) __VA_ARGS__
-#define CFG_PGREP 0
-#define USE_PGREP(...)
-#define CFG_PIDOF 0
-#define USE_PIDOF(...)
-#define CFG_PING 0
-#define USE_PING(...)
-#define CFG_PIVOT_ROOT 0
-#define USE_PIVOT_ROOT(...)
-#define CFG_PKILL 0
-#define USE_PKILL(...)
-#define CFG_PMAP 0
-#define USE_PMAP(...)
-#define CFG_PRINTENV 0
-#define USE_PRINTENV(...)
-#define CFG_PRINTF 0
-#define USE_PRINTF(...)
-#define CFG_PS 0
-#define USE_PS(...)
-#define CFG_PWDX 0
-#define USE_PWDX(...)
-#define CFG_PWD 1
-#define USE_PWD(...) __VA_ARGS__
-#define CFG_READAHEAD 0
-#define USE_READAHEAD(...)
-#define CFG_READLINK 1
-#define USE_READLINK(...) __VA_ARGS__
-#define CFG_REALPATH 1
-#define USE_REALPATH(...) __VA_ARGS__
-#define CFG_REBOOT 0
-#define USE_REBOOT(...)
-#define CFG_RENICE 0
-#define USE_RENICE(...)
-#define CFG_RESET 0
-#define USE_RESET(...)
-#define CFG_RESTORECON 0
-#define USE_RESTORECON(...)
-#define CFG_REV 0
-#define USE_REV(...)
-#define CFG_RFKILL 0
-#define USE_RFKILL(...)
-#define CFG_RMDIR 1
-#define USE_RMDIR(...) __VA_ARGS__
-#define CFG_RMMOD 0
-#define USE_RMMOD(...)
-#define CFG_RM 1
-#define USE_RM(...) __VA_ARGS__
-#define CFG_ROUTE 0
-#define USE_ROUTE(...)
-#define CFG_RUNCON 0
-#define USE_RUNCON(...)
-#define CFG_SED 1
-#define USE_SED(...) __VA_ARGS__
-#define CFG_SENDEVENT 0
-#define USE_SENDEVENT(...)
-#define CFG_SEQ 1
-#define USE_SEQ(...) __VA_ARGS__
-#define CFG_SETENFORCE 0
-#define USE_SETENFORCE(...)
-#define CFG_SETFATTR 0
-#define USE_SETFATTR(...)
-#define CFG_SETSID 1
-#define USE_SETSID(...) __VA_ARGS__
-#define CFG_SHA1SUM 1
-#define USE_SHA1SUM(...) __VA_ARGS__
-#define CFG_SHA224SUM 0
-#define USE_SHA224SUM(...)
-#define CFG_SHA256SUM 1
-#define USE_SHA256SUM(...) __VA_ARGS__
-#define CFG_SHA384SUM 0
-#define USE_SHA384SUM(...)
-#define CFG_SHA512SUM 1
-#define USE_SHA512SUM(...) __VA_ARGS__
-#define CFG_SH 0
-#define USE_SH(...)
-#define CFG_SHRED 0
-#define USE_SHRED(...)
-#define CFG_SKELETON_ALIAS 0
-#define USE_SKELETON_ALIAS(...)
-#define CFG_SKELETON 0
-#define USE_SKELETON(...)
-#define CFG_SLEEP 1
-#define USE_SLEEP(...) __VA_ARGS__
-#define CFG_SNTP 0
-#define USE_SNTP(...)
-#define CFG_SORT_FLOAT 1
-#define USE_SORT_FLOAT(...) __VA_ARGS__
-#define CFG_SORT 1
-#define USE_SORT(...) __VA_ARGS__
-#define CFG_SPLIT 0
-#define USE_SPLIT(...)
-#define CFG_STAT 1
-#define USE_STAT(...) __VA_ARGS__
-#define CFG_STRINGS 0
-#define USE_STRINGS(...)
-#define CFG_STTY 0
-#define USE_STTY(...)
-#define CFG_SU 0
-#define USE_SU(...)
-#define CFG_SULOGIN 0
-#define USE_SULOGIN(...)
-#define CFG_SWAPOFF 0
-#define USE_SWAPOFF(...)
-#define CFG_SWAPON 0
-#define USE_SWAPON(...)
-#define CFG_SWITCH_ROOT 0
-#define USE_SWITCH_ROOT(...)
-#define CFG_SYNC 0
-#define USE_SYNC(...)
-#define CFG_SYSCTL 0
-#define USE_SYSCTL(...)
-#define CFG_SYSLOGD 0
-#define USE_SYSLOGD(...)
-#define CFG_TAC 0
-#define USE_TAC(...)
-#define CFG_TAIL 1
-#define USE_TAIL(...) __VA_ARGS__
-#define CFG_TAR 1
-#define USE_TAR(...) __VA_ARGS__
-#define CFG_TASKSET 0
-#define USE_TASKSET(...)
-#define CFG_TCPSVD 0
-#define USE_TCPSVD(...)
-#define CFG_TEE 1
-#define USE_TEE(...) __VA_ARGS__
-#define CFG_TELNETD 0
-#define USE_TELNETD(...)
-#define CFG_TELNET 0
-#define USE_TELNET(...)
-#define CFG_TEST 0
-#define USE_TEST(...)
-#define CFG_TFTPD 0
-#define USE_TFTPD(...)
-#define CFG_TFTP 0
-#define USE_TFTP(...)
-#define CFG_TIME 0
-#define USE_TIME(...)
-#define CFG_TIMEOUT 1
-#define USE_TIMEOUT(...) __VA_ARGS__
-#define CFG_TOP 0
-#define USE_TOP(...)
-#define CFG_TOUCH 1
-#define USE_TOUCH(...) __VA_ARGS__
-#define CFG_TRACEROUTE 0
-#define USE_TRACEROUTE(...)
-#define CFG_TRUE 1
-#define USE_TRUE(...) __VA_ARGS__
-#define CFG_TRUNCATE 1
-#define USE_TRUNCATE(...) __VA_ARGS__
-#define CFG_TR 1
-#define USE_TR(...) __VA_ARGS__
-#define CFG_TTY 0
-#define USE_TTY(...)
-#define CFG_TUNCTL 0
-#define USE_TUNCTL(...)
-#define CFG_ULIMIT 0
-#define USE_ULIMIT(...)
-#define CFG_UMOUNT 0
-#define USE_UMOUNT(...)
-#define CFG_UNAME 1
-#define USE_UNAME(...) __VA_ARGS__
-#define CFG_UNIQ 1
-#define USE_UNIQ(...) __VA_ARGS__
-#define CFG_UNIX2DOS 1
-#define USE_UNIX2DOS(...) __VA_ARGS__
-#define CFG_UNLINK 0
-#define USE_UNLINK(...)
-#define CFG_UNSHARE 0
-#define USE_UNSHARE(...)
-#define CFG_UPTIME 0
-#define USE_UPTIME(...)
-#define CFG_USERADD 0
-#define USE_USERADD(...)
-#define CFG_USERDEL 0
-#define USE_USERDEL(...)
-#define CFG_USLEEP 0
-#define USE_USLEEP(...)
-#define CFG_UUDECODE 0
-#define USE_UUDECODE(...)
-#define CFG_UUENCODE 0
-#define USE_UUENCODE(...)
-#define CFG_UUIDGEN 0
-#define USE_UUIDGEN(...)
-#define CFG_VCONFIG 0
-#define USE_VCONFIG(...)
-#define CFG_VI 0
-#define USE_VI(...)
-#define CFG_VMSTAT 0
-#define USE_VMSTAT(...)
-#define CFG_WATCH 0
-#define USE_WATCH(...)
-#define CFG_WC 1
-#define USE_WC(...) __VA_ARGS__
-#define CFG_WGET 0
-#define USE_WGET(...)
-#define CFG_WHICH 1
-#define USE_WHICH(...) __VA_ARGS__
-#define CFG_WHOAMI 1
-#define USE_WHOAMI(...) __VA_ARGS__
-#define CFG_WHO 0
-#define USE_WHO(...)
-#define CFG_W 0
-#define USE_W(...)
-#define CFG_XARGS_PEDANTIC 0
-#define USE_XARGS_PEDANTIC(...)
-#define CFG_XARGS 1
-#define USE_XARGS(...) __VA_ARGS__
-#define CFG_XXD 1
-#define USE_XXD(...) __VA_ARGS__
-#define CFG_XZCAT 0
-#define USE_XZCAT(...)
-#define CFG_YES 0
-#define USE_YES(...)
-#define CFG_ZCAT 0
-#define USE_ZCAT(...)
diff --git a/android/mac/generated/flags.h b/android/mac/generated/flags.h
deleted file mode 100644
index 5779a492..00000000
--- a/android/mac/generated/flags.h
+++ /dev/null
@@ -1,6200 +0,0 @@
-#undef FORCED_FLAG
-#undef FORCED_FLAGLL
-#ifdef FORCE_FLAGS
-#define FORCED_FLAG 1
-#define FORCED_FLAGLL 1LL
-#else
-#define FORCED_FLAG 0
-#define FORCED_FLAGLL 0
-#endif
-
-// acpi abctV
-#undef OPTSTR_acpi
-#define OPTSTR_acpi "abctV"
-#ifdef CLEANUP_acpi
-#undef CLEANUP_acpi
-#undef FOR_acpi
-#undef FLAG_V
-#undef FLAG_t
-#undef FLAG_c
-#undef FLAG_b
-#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]"
-#ifdef CLEANUP_arp
-#undef CLEANUP_arp
-#undef FOR_arp
-#undef FLAG_H
-#undef FLAG_A
-#undef FLAG_p
-#undef FLAG_a
-#undef FLAG_d
-#undef FLAG_s
-#undef FLAG_D
-#undef FLAG_n
-#undef FLAG_i
-#undef FLAG_v
-#endif
-
-// arping <1>1s:I:w#<0c#<0AUDbqf[+AU][+Df]
-#undef OPTSTR_arping
-#define OPTSTR_arping "<1>1s:I:w#<0c#<0AUDbqf[+AU][+Df]"
-#ifdef CLEANUP_arping
-#undef CLEANUP_arping
-#undef FOR_arping
-#undef FLAG_f
-#undef FLAG_q
-#undef FLAG_b
-#undef FLAG_D
-#undef FLAG_U
-#undef FLAG_A
-#undef FLAG_c
-#undef FLAG_w
-#undef FLAG_I
-#undef FLAG_s
-#endif
-
-// ascii
-#undef OPTSTR_ascii
-#define OPTSTR_ascii 0
-#ifdef CLEANUP_ascii
-#undef CLEANUP_ascii
-#undef FOR_ascii
-#endif
-
-// base64 diw#<0=76[!dw]
-#undef OPTSTR_base64
-#define OPTSTR_base64 "diw#<0=76[!dw]"
-#ifdef CLEANUP_base64
-#undef CLEANUP_base64
-#undef FOR_base64
-#undef FLAG_w
-#undef FLAG_i
-#undef FLAG_d
-#endif
-
-// basename ^<1as: ^<1as:
-#undef OPTSTR_basename
-#define OPTSTR_basename "^<1as:"
-#ifdef CLEANUP_basename
-#undef CLEANUP_basename
-#undef FOR_basename
-#undef FLAG_s
-#undef FLAG_a
-#endif
-
-// bc i(interactive)l(mathlib)q(quiet)s(standard)w(warn) i(interactive)l(mathlib)q(quiet)s(standard)w(warn)
-#undef OPTSTR_bc
-#define OPTSTR_bc "i(interactive)l(mathlib)q(quiet)s(standard)w(warn)"
-#ifdef CLEANUP_bc
-#undef CLEANUP_bc
-#undef FOR_bc
-#undef FLAG_w
-#undef FLAG_s
-#undef FLAG_q
-#undef FLAG_l
-#undef FLAG_i
-#endif
-
-// blkid ULs*[!LU]
-#undef OPTSTR_blkid
-#define OPTSTR_blkid "ULs*[!LU]"
-#ifdef CLEANUP_blkid
-#undef CLEANUP_blkid
-#undef FOR_blkid
-#undef FLAG_s
-#undef FLAG_L
-#undef FLAG_U
-#endif
-
-// blockdev <1>1(setro)(setrw)(getro)(getss)(getbsz)(setbsz)#<0(getsz)(getsize)(getsize64)(getra)(setra)#<0(flushbufs)(rereadpt)
-#undef OPTSTR_blockdev
-#define OPTSTR_blockdev "<1>1(setro)(setrw)(getro)(getss)(getbsz)(setbsz)#<0(getsz)(getsize)(getsize64)(getra)(setra)#<0(flushbufs)(rereadpt)"
-#ifdef CLEANUP_blockdev
-#undef CLEANUP_blockdev
-#undef FOR_blockdev
-#undef FLAG_rereadpt
-#undef FLAG_flushbufs
-#undef FLAG_setra
-#undef FLAG_getra
-#undef FLAG_getsize64
-#undef FLAG_getsize
-#undef FLAG_getsz
-#undef FLAG_setbsz
-#undef FLAG_getbsz
-#undef FLAG_getss
-#undef FLAG_getro
-#undef FLAG_setrw
-#undef FLAG_setro
-#endif
-
-// bootchartd
-#undef OPTSTR_bootchartd
-#define OPTSTR_bootchartd 0
-#ifdef CLEANUP_bootchartd
-#undef CLEANUP_bootchartd
-#undef FOR_bootchartd
-#endif
-
-// brctl <1
-#undef OPTSTR_brctl
-#define OPTSTR_brctl "<1"
-#ifdef CLEANUP_brctl
-#undef CLEANUP_brctl
-#undef FOR_brctl
-#endif
-
-// bunzip2 cftkv
-#undef OPTSTR_bunzip2
-#define OPTSTR_bunzip2 "cftkv"
-#ifdef CLEANUP_bunzip2
-#undef CLEANUP_bunzip2
-#undef FOR_bunzip2
-#undef FLAG_v
-#undef FLAG_k
-#undef FLAG_t
-#undef FLAG_f
-#undef FLAG_c
-#endif
-
-// bzcat
-#undef OPTSTR_bzcat
-#define OPTSTR_bzcat 0
-#ifdef CLEANUP_bzcat
-#undef CLEANUP_bzcat
-#undef FOR_bzcat
-#endif
-
-// cal >2
-#undef OPTSTR_cal
-#define OPTSTR_cal ">2"
-#ifdef CLEANUP_cal
-#undef CLEANUP_cal
-#undef FOR_cal
-#endif
-
-// cat uvte uvte
-#undef OPTSTR_cat
-#define OPTSTR_cat "uvte"
-#ifdef CLEANUP_cat
-#undef CLEANUP_cat
-#undef FOR_cat
-#undef FLAG_e
-#undef FLAG_t
-#undef FLAG_v
-#undef FLAG_u
-#endif
-
-// catv vte
-#undef OPTSTR_catv
-#define OPTSTR_catv "vte"
-#ifdef CLEANUP_catv
-#undef CLEANUP_catv
-#undef FOR_catv
-#undef FLAG_e
-#undef FLAG_t
-#undef FLAG_v
-#endif
-
-// cd
-#undef OPTSTR_cd
-#define OPTSTR_cd 0
-#ifdef CLEANUP_cd
-#undef CLEANUP_cd
-#undef FOR_cd
-#endif
-
-// chattr
-#undef OPTSTR_chattr
-#define OPTSTR_chattr 0
-#ifdef CLEANUP_chattr
-#undef CLEANUP_chattr
-#undef FOR_chattr
-#endif
-
-// chcon <2hvR
-#undef OPTSTR_chcon
-#define OPTSTR_chcon "<2hvR"
-#ifdef CLEANUP_chcon
-#undef CLEANUP_chcon
-#undef FOR_chcon
-#undef FLAG_R
-#undef FLAG_v
-#undef FLAG_h
-#endif
-
-// chgrp <2hPLHRfv[-HLP]
-#undef OPTSTR_chgrp
-#define OPTSTR_chgrp "<2hPLHRfv[-HLP]"
-#ifdef CLEANUP_chgrp
-#undef CLEANUP_chgrp
-#undef FOR_chgrp
-#undef FLAG_v
-#undef FLAG_f
-#undef FLAG_R
-#undef FLAG_H
-#undef FLAG_L
-#undef FLAG_P
-#undef FLAG_h
-#endif
-
-// chmod <2?vRf[-vf] <2?vRf[-vf]
-#undef OPTSTR_chmod
-#define OPTSTR_chmod "<2?vRf[-vf]"
-#ifdef CLEANUP_chmod
-#undef CLEANUP_chmod
-#undef FOR_chmod
-#undef FLAG_f
-#undef FLAG_R
-#undef FLAG_v
-#endif
-
-// chroot ^<1
-#undef OPTSTR_chroot
-#define OPTSTR_chroot "^<1"
-#ifdef CLEANUP_chroot
-#undef CLEANUP_chroot
-#undef FOR_chroot
-#endif
-
-// chrt ^mp#<0iRbrfo[!ibrfo]
-#undef OPTSTR_chrt
-#define OPTSTR_chrt "^mp#<0iRbrfo[!ibrfo]"
-#ifdef CLEANUP_chrt
-#undef CLEANUP_chrt
-#undef FOR_chrt
-#undef FLAG_o
-#undef FLAG_f
-#undef FLAG_r
-#undef FLAG_b
-#undef FLAG_R
-#undef FLAG_i
-#undef FLAG_p
-#undef FLAG_m
-#endif
-
-// chvt <1
-#undef OPTSTR_chvt
-#define OPTSTR_chvt "<1"
-#ifdef CLEANUP_chvt
-#undef CLEANUP_chvt
-#undef FOR_chvt
-#endif
-
-// cksum HIPLN
-#undef OPTSTR_cksum
-#define OPTSTR_cksum "HIPLN"
-#ifdef CLEANUP_cksum
-#undef CLEANUP_cksum
-#undef FOR_cksum
-#undef FLAG_N
-#undef FLAG_L
-#undef FLAG_P
-#undef FLAG_I
-#undef FLAG_H
-#endif
-
-// clear
-#undef OPTSTR_clear
-#define OPTSTR_clear 0
-#ifdef CLEANUP_clear
-#undef CLEANUP_clear
-#undef FOR_clear
-#endif
-
-// cmp <1>2ls(silent)(quiet)[!ls] <1>2ls(silent)(quiet)[!ls]
-#undef OPTSTR_cmp
-#define OPTSTR_cmp "<1>2ls(silent)(quiet)[!ls]"
-#ifdef CLEANUP_cmp
-#undef CLEANUP_cmp
-#undef FOR_cmp
-#undef FLAG_s
-#undef FLAG_l
-#endif
-
-// comm <2>2321 <2>2321
-#undef OPTSTR_comm
-#define OPTSTR_comm "<2>2321"
-#ifdef CLEANUP_comm
-#undef CLEANUP_comm
-#undef FOR_comm
-#undef FLAG_1
-#undef FLAG_2
-#undef FLAG_3
-#endif
-
-// count
-#undef OPTSTR_count
-#define OPTSTR_count 0
-#ifdef CLEANUP_count
-#undef CLEANUP_count
-#undef FOR_count
-#endif
-
-// cp <2(preserve):;D(parents)RHLPprdaslvnF(remove-destination)fi[-HLPd][-ni] <2(preserve):;D(parents)RHLPprdaslvnF(remove-destination)fi[-HLPd][-ni]
-#undef OPTSTR_cp
-#define OPTSTR_cp "<2(preserve):;D(parents)RHLPprdaslvnF(remove-destination)fi[-HLPd][-ni]"
-#ifdef CLEANUP_cp
-#undef CLEANUP_cp
-#undef FOR_cp
-#undef FLAG_i
-#undef FLAG_f
-#undef FLAG_F
-#undef FLAG_n
-#undef FLAG_v
-#undef FLAG_l
-#undef FLAG_s
-#undef FLAG_a
-#undef FLAG_d
-#undef FLAG_r
-#undef FLAG_p
-#undef FLAG_P
-#undef FLAG_L
-#undef FLAG_H
-#undef FLAG_R
-#undef FLAG_D
-#undef FLAG_preserve
-#endif
-
-// cpio (no-preserve-owner)(trailer)mduH:p:|i|t|F:v(verbose)o|[!pio][!pot][!pF]
-#undef OPTSTR_cpio
-#define OPTSTR_cpio "(no-preserve-owner)(trailer)mduH:p:|i|t|F:v(verbose)o|[!pio][!pot][!pF]"
-#ifdef CLEANUP_cpio
-#undef CLEANUP_cpio
-#undef FOR_cpio
-#undef FLAG_o
-#undef FLAG_v
-#undef FLAG_F
-#undef FLAG_t
-#undef FLAG_i
-#undef FLAG_p
-#undef FLAG_H
-#undef FLAG_u
-#undef FLAG_d
-#undef FLAG_m
-#undef FLAG_trailer
-#undef FLAG_no_preserve_owner
-#endif
-
-// crc32
-#undef OPTSTR_crc32
-#define OPTSTR_crc32 0
-#ifdef CLEANUP_crc32
-#undef CLEANUP_crc32
-#undef FOR_crc32
-#endif
-
-// crond fbSl#<0=8d#<0L:c:[-bf][-LS][-ld]
-#undef OPTSTR_crond
-#define OPTSTR_crond "fbSl#<0=8d#<0L:c:[-bf][-LS][-ld]"
-#ifdef CLEANUP_crond
-#undef CLEANUP_crond
-#undef FOR_crond
-#undef FLAG_c
-#undef FLAG_L
-#undef FLAG_d
-#undef FLAG_l
-#undef FLAG_S
-#undef FLAG_b
-#undef FLAG_f
-#endif
-
-// crontab c:u:elr[!elr]
-#undef OPTSTR_crontab
-#define OPTSTR_crontab "c:u:elr[!elr]"
-#ifdef CLEANUP_crontab
-#undef CLEANUP_crontab
-#undef FOR_crontab
-#undef FLAG_r
-#undef FLAG_l
-#undef FLAG_e
-#undef FLAG_u
-#undef FLAG_c
-#endif
-
-// cut b*|c*|f*|F*|C*|O(output-delimiter):d:sDn[!cbf] b*|c*|f*|F*|C*|O(output-delimiter):d:sDn[!cbf]
-#undef OPTSTR_cut
-#define OPTSTR_cut "b*|c*|f*|F*|C*|O(output-delimiter):d:sDn[!cbf]"
-#ifdef CLEANUP_cut
-#undef CLEANUP_cut
-#undef FOR_cut
-#undef FLAG_n
-#undef FLAG_D
-#undef FLAG_s
-#undef FLAG_d
-#undef FLAG_O
-#undef FLAG_C
-#undef FLAG_F
-#undef FLAG_f
-#undef FLAG_c
-#undef FLAG_b
-#endif
-
-// date d:D:r:u[!dr] d:D:r:u[!dr]
-#undef OPTSTR_date
-#define OPTSTR_date "d:D:r:u[!dr]"
-#ifdef CLEANUP_date
-#undef CLEANUP_date
-#undef FOR_date
-#undef FLAG_u
-#undef FLAG_r
-#undef FLAG_D
-#undef FLAG_d
-#endif
-
-// dd
-#undef OPTSTR_dd
-#define OPTSTR_dd 0
-#ifdef CLEANUP_dd
-#undef CLEANUP_dd
-#undef FOR_dd
-#endif
-
-// deallocvt >1
-#undef OPTSTR_deallocvt
-#define OPTSTR_deallocvt ">1"
-#ifdef CLEANUP_deallocvt
-#undef CLEANUP_deallocvt
-#undef FOR_deallocvt
-#endif
-
-// demo_many_options ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba
-#undef OPTSTR_demo_many_options
-#define OPTSTR_demo_many_options "ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba"
-#ifdef CLEANUP_demo_many_options
-#undef CLEANUP_demo_many_options
-#undef FOR_demo_many_options
-#undef FLAG_a
-#undef FLAG_b
-#undef FLAG_c
-#undef FLAG_d
-#undef FLAG_e
-#undef FLAG_f
-#undef FLAG_g
-#undef FLAG_h
-#undef FLAG_i
-#undef FLAG_j
-#undef FLAG_k
-#undef FLAG_l
-#undef FLAG_m
-#undef FLAG_n
-#undef FLAG_o
-#undef FLAG_p
-#undef FLAG_q
-#undef FLAG_r
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_u
-#undef FLAG_v
-#undef FLAG_w
-#undef FLAG_x
-#undef FLAG_y
-#undef FLAG_z
-#undef FLAG_A
-#undef FLAG_B
-#undef FLAG_C
-#undef FLAG_D
-#undef FLAG_E
-#undef FLAG_F
-#undef FLAG_G
-#undef FLAG_H
-#undef FLAG_I
-#undef FLAG_J
-#undef FLAG_K
-#undef FLAG_L
-#undef FLAG_M
-#undef FLAG_N
-#undef FLAG_O
-#undef FLAG_P
-#undef FLAG_Q
-#undef FLAG_R
-#undef FLAG_S
-#undef FLAG_T
-#undef FLAG_U
-#undef FLAG_V
-#undef FLAG_W
-#undef FLAG_X
-#undef FLAG_Y
-#undef FLAG_Z
-#endif
-
-// demo_number D#=3<3hdbs
-#undef OPTSTR_demo_number
-#define OPTSTR_demo_number "D#=3<3hdbs"
-#ifdef CLEANUP_demo_number
-#undef CLEANUP_demo_number
-#undef FOR_demo_number
-#undef FLAG_s
-#undef FLAG_b
-#undef FLAG_d
-#undef FLAG_h
-#undef FLAG_D
-#endif
-
-// demo_scankey
-#undef OPTSTR_demo_scankey
-#define OPTSTR_demo_scankey 0
-#ifdef CLEANUP_demo_scankey
-#undef CLEANUP_demo_scankey
-#undef FOR_demo_scankey
-#endif
-
-// demo_utf8towc
-#undef OPTSTR_demo_utf8towc
-#define OPTSTR_demo_utf8towc 0
-#ifdef CLEANUP_demo_utf8towc
-#undef CLEANUP_demo_utf8towc
-#undef FOR_demo_utf8towc
-#endif
-
-// devmem <1>3
-#undef OPTSTR_devmem
-#define OPTSTR_devmem "<1>3"
-#ifdef CLEANUP_devmem
-#undef CLEANUP_devmem
-#undef FOR_devmem
-#endif
-
-// df HPkhit*a[-HPkh]
-#undef OPTSTR_df
-#define OPTSTR_df "HPkhit*a[-HPkh]"
-#ifdef CLEANUP_df
-#undef CLEANUP_df
-#undef FOR_df
-#undef FLAG_a
-#undef FLAG_t
-#undef FLAG_i
-#undef FLAG_h
-#undef FLAG_k
-#undef FLAG_P
-#undef FLAG_H
-#endif
-
-// dhcp V:H:F:x*r:O*A#<0=20T#<0=3t#<0=3s:p:i:SBRCaovqnbf
-#undef OPTSTR_dhcp
-#define OPTSTR_dhcp "V:H:F:x*r:O*A#<0=20T#<0=3t#<0=3s:p:i:SBRCaovqnbf"
-#ifdef CLEANUP_dhcp
-#undef CLEANUP_dhcp
-#undef FOR_dhcp
-#undef FLAG_f
-#undef FLAG_b
-#undef FLAG_n
-#undef FLAG_q
-#undef FLAG_v
-#undef FLAG_o
-#undef FLAG_a
-#undef FLAG_C
-#undef FLAG_R
-#undef FLAG_B
-#undef FLAG_S
-#undef FLAG_i
-#undef FLAG_p
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_T
-#undef FLAG_A
-#undef FLAG_O
-#undef FLAG_r
-#undef FLAG_x
-#undef FLAG_F
-#undef FLAG_H
-#undef FLAG_V
-#endif
-
-// dhcp6 r:A#<0T#<0t#<0s:p:i:SRvqnbf
-#undef OPTSTR_dhcp6
-#define OPTSTR_dhcp6 "r:A#<0T#<0t#<0s:p:i:SRvqnbf"
-#ifdef CLEANUP_dhcp6
-#undef CLEANUP_dhcp6
-#undef FOR_dhcp6
-#undef FLAG_f
-#undef FLAG_b
-#undef FLAG_n
-#undef FLAG_q
-#undef FLAG_v
-#undef FLAG_R
-#undef FLAG_S
-#undef FLAG_i
-#undef FLAG_p
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_T
-#undef FLAG_A
-#undef FLAG_r
-#endif
-
-// dhcpd >1P#<0>65535fi:S46[!46]
-#undef OPTSTR_dhcpd
-#define OPTSTR_dhcpd ">1P#<0>65535fi:S46[!46]"
-#ifdef CLEANUP_dhcpd
-#undef CLEANUP_dhcpd
-#undef FOR_dhcpd
-#undef FLAG_6
-#undef FLAG_4
-#undef FLAG_S
-#undef FLAG_i
-#undef FLAG_f
-#undef FLAG_P
-#endif
-
-// 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 <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
-#undef OPTSTR_diff
-#define OPTSTR_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"
-#ifdef CLEANUP_diff
-#undef CLEANUP_diff
-#undef FOR_diff
-#undef FLAG_U
-#undef FLAG_r
-#undef FLAG_N
-#undef FLAG_S
-#undef FLAG_L
-#undef FLAG_a
-#undef FLAG_q
-#undef FLAG_s
-#undef FLAG_T
-#undef FLAG_i
-#undef FLAG_w
-#undef FLAG_t
-#undef FLAG_u
-#undef FLAG_b
-#undef FLAG_d
-#undef FLAG_B
-#undef FLAG_strip_trailing_cr
-#undef FLAG_color
-#endif
-
-// dirname <1 <1
-#undef OPTSTR_dirname
-#define OPTSTR_dirname "<1"
-#ifdef CLEANUP_dirname
-#undef CLEANUP_dirname
-#undef FOR_dirname
-#endif
-
-// dmesg w(follow)CSTtrs#<1n#c[!Ttr][!Cc][!Sw]
-#undef OPTSTR_dmesg
-#define OPTSTR_dmesg "w(follow)CSTtrs#<1n#c[!Ttr][!Cc][!Sw]"
-#ifdef CLEANUP_dmesg
-#undef CLEANUP_dmesg
-#undef FOR_dmesg
-#undef FLAG_c
-#undef FLAG_n
-#undef FLAG_s
-#undef FLAG_r
-#undef FLAG_t
-#undef FLAG_T
-#undef FLAG_S
-#undef FLAG_C
-#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
-#ifdef CLEANUP_dos2unix
-#undef CLEANUP_dos2unix
-#undef FOR_dos2unix
-#endif
-
-// du d#<0=-1hmlcaHkKLsx[-HL][-kKmh] d#<0=-1hmlcaHkKLsx[-HL][-kKmh]
-#undef OPTSTR_du
-#define OPTSTR_du "d#<0=-1hmlcaHkKLsx[-HL][-kKmh]"
-#ifdef CLEANUP_du
-#undef CLEANUP_du
-#undef FOR_du
-#undef FLAG_x
-#undef FLAG_s
-#undef FLAG_L
-#undef FLAG_K
-#undef FLAG_k
-#undef FLAG_H
-#undef FLAG_a
-#undef FLAG_c
-#undef FLAG_l
-#undef FLAG_m
-#undef FLAG_h
-#undef FLAG_d
-#endif
-
-// dumpleases >0arf:[!ar]
-#undef OPTSTR_dumpleases
-#define OPTSTR_dumpleases ">0arf:[!ar]"
-#ifdef CLEANUP_dumpleases
-#undef CLEANUP_dumpleases
-#undef FOR_dumpleases
-#undef FLAG_f
-#undef FLAG_r
-#undef FLAG_a
-#endif
-
-// echo ^?Een[-eE] ^?Een[-eE]
-#undef OPTSTR_echo
-#define OPTSTR_echo "^?Een[-eE]"
-#ifdef CLEANUP_echo
-#undef CLEANUP_echo
-#undef FOR_echo
-#undef FLAG_n
-#undef FLAG_e
-#undef FLAG_E
-#endif
-
-// eject >1stT[!tT]
-#undef OPTSTR_eject
-#define OPTSTR_eject ">1stT[!tT]"
-#ifdef CLEANUP_eject
-#undef CLEANUP_eject
-#undef FOR_eject
-#undef FLAG_T
-#undef FLAG_t
-#undef FLAG_s
-#endif
-
-// env ^0iu* ^0iu*
-#undef OPTSTR_env
-#define OPTSTR_env "^0iu*"
-#ifdef CLEANUP_env
-#undef CLEANUP_env
-#undef FOR_env
-#undef FLAG_u
-#undef FLAG_i
-#undef FLAG_0
-#endif
-
-// exit
-#undef OPTSTR_exit
-#define OPTSTR_exit 0
-#ifdef CLEANUP_exit
-#undef CLEANUP_exit
-#undef FOR_exit
-#endif
-
-// expand t*
-#undef OPTSTR_expand
-#define OPTSTR_expand "t*"
-#ifdef CLEANUP_expand
-#undef CLEANUP_expand
-#undef FOR_expand
-#undef FLAG_t
-#endif
-
-// expr
-#undef OPTSTR_expr
-#define OPTSTR_expr 0
-#ifdef CLEANUP_expr
-#undef CLEANUP_expr
-#undef FOR_expr
-#endif
-
-// factor
-#undef OPTSTR_factor
-#define OPTSTR_factor 0
-#ifdef CLEANUP_factor
-#undef CLEANUP_factor
-#undef FOR_factor
-#endif
-
-// fallocate >1l#|o#
-#undef OPTSTR_fallocate
-#define OPTSTR_fallocate ">1l#|o#"
-#ifdef CLEANUP_fallocate
-#undef CLEANUP_fallocate
-#undef FOR_fallocate
-#undef FLAG_o
-#undef FLAG_l
-#endif
-
-// false
-#undef OPTSTR_false
-#define OPTSTR_false 0
-#ifdef CLEANUP_false
-#undef CLEANUP_false
-#undef FOR_false
-#endif
-
-// fdisk C#<0H#<0S#<0b#<512ul
-#undef OPTSTR_fdisk
-#define OPTSTR_fdisk "C#<0H#<0S#<0b#<512ul"
-#ifdef CLEANUP_fdisk
-#undef CLEANUP_fdisk
-#undef FOR_fdisk
-#undef FLAG_l
-#undef FLAG_u
-#undef FLAG_b
-#undef FLAG_S
-#undef FLAG_H
-#undef FLAG_C
-#endif
-
-// file <1bhLs[!hL]
-#undef OPTSTR_file
-#define OPTSTR_file "<1bhLs[!hL]"
-#ifdef CLEANUP_file
-#undef CLEANUP_file
-#undef FOR_file
-#undef FLAG_s
-#undef FLAG_L
-#undef FLAG_h
-#undef FLAG_b
-#endif
-
-// find ?^HL[-HL] ?^HL[-HL]
-#undef OPTSTR_find
-#define OPTSTR_find "?^HL[-HL]"
-#ifdef CLEANUP_find
-#undef CLEANUP_find
-#undef FOR_find
-#undef FLAG_L
-#undef FLAG_H
-#endif
-
-// flock <1>1nsux[-sux]
-#undef OPTSTR_flock
-#define OPTSTR_flock "<1>1nsux[-sux]"
-#ifdef CLEANUP_flock
-#undef CLEANUP_flock
-#undef FOR_flock
-#undef FLAG_x
-#undef FLAG_u
-#undef FLAG_s
-#undef FLAG_n
-#endif
-
-// fmt w#<0=75
-#undef OPTSTR_fmt
-#define OPTSTR_fmt "w#<0=75"
-#ifdef CLEANUP_fmt
-#undef CLEANUP_fmt
-#undef FOR_fmt
-#undef FLAG_w
-#endif
-
-// fold bsuw#<1
-#undef OPTSTR_fold
-#define OPTSTR_fold "bsuw#<1"
-#ifdef CLEANUP_fold
-#undef CLEANUP_fold
-#undef FOR_fold
-#undef FLAG_w
-#undef FLAG_u
-#undef FLAG_s
-#undef FLAG_b
-#endif
-
-// free htgmkb[!htgmkb]
-#undef OPTSTR_free
-#define OPTSTR_free "htgmkb[!htgmkb]"
-#ifdef CLEANUP_free
-#undef CLEANUP_free
-#undef FOR_free
-#undef FLAG_b
-#undef FLAG_k
-#undef FLAG_m
-#undef FLAG_g
-#undef FLAG_t
-#undef FLAG_h
-#endif
-
-// freeramdisk <1>1
-#undef OPTSTR_freeramdisk
-#define OPTSTR_freeramdisk "<1>1"
-#ifdef CLEANUP_freeramdisk
-#undef CLEANUP_freeramdisk
-#undef FOR_freeramdisk
-#endif
-
-// fsck ?t:ANPRTVsC#
-#undef OPTSTR_fsck
-#define OPTSTR_fsck "?t:ANPRTVsC#"
-#ifdef CLEANUP_fsck
-#undef CLEANUP_fsck
-#undef FOR_fsck
-#undef FLAG_C
-#undef FLAG_s
-#undef FLAG_V
-#undef FLAG_T
-#undef FLAG_R
-#undef FLAG_P
-#undef FLAG_N
-#undef FLAG_A
-#undef FLAG_t
-#endif
-
-// fsfreeze <1>1f|u|[!fu]
-#undef OPTSTR_fsfreeze
-#define OPTSTR_fsfreeze "<1>1f|u|[!fu]"
-#ifdef CLEANUP_fsfreeze
-#undef CLEANUP_fsfreeze
-#undef FOR_fsfreeze
-#undef FLAG_u
-#undef FLAG_f
-#endif
-
-// fstype <1
-#undef OPTSTR_fstype
-#define OPTSTR_fstype "<1"
-#ifdef CLEANUP_fstype
-#undef CLEANUP_fstype
-#undef FOR_fstype
-#endif
-
-// fsync <1d
-#undef OPTSTR_fsync
-#define OPTSTR_fsync "<1d"
-#ifdef CLEANUP_fsync
-#undef CLEANUP_fsync
-#undef FOR_fsync
-#undef FLAG_d
-#endif
-
-// ftpget <2>3P:cp:u:vgslLmMdD[-gs][!gslLmMdD][!clL]
-#undef OPTSTR_ftpget
-#define OPTSTR_ftpget "<2>3P:cp:u:vgslLmMdD[-gs][!gslLmMdD][!clL]"
-#ifdef CLEANUP_ftpget
-#undef CLEANUP_ftpget
-#undef FOR_ftpget
-#undef FLAG_D
-#undef FLAG_d
-#undef FLAG_M
-#undef FLAG_m
-#undef FLAG_L
-#undef FLAG_l
-#undef FLAG_s
-#undef FLAG_g
-#undef FLAG_v
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_c
-#undef FLAG_P
-#endif
-
-// getconf >2al >2al
-#undef OPTSTR_getconf
-#define OPTSTR_getconf ">2al"
-#ifdef CLEANUP_getconf
-#undef CLEANUP_getconf
-#undef FOR_getconf
-#undef FLAG_l
-#undef FLAG_a
-#endif
-
-// getenforce >0
-#undef OPTSTR_getenforce
-#define OPTSTR_getenforce ">0"
-#ifdef CLEANUP_getenforce
-#undef CLEANUP_getenforce
-#undef FOR_getenforce
-#endif
-
-// getfattr (only-values)dhn:
-#undef OPTSTR_getfattr
-#define OPTSTR_getfattr "(only-values)dhn:"
-#ifdef CLEANUP_getfattr
-#undef CLEANUP_getfattr
-#undef FOR_getfattr
-#undef FLAG_n
-#undef FLAG_h
-#undef FLAG_d
-#undef FLAG_only_values
-#endif
-
-// getty <2t#<0H:I:l:f:iwnmLh
-#undef OPTSTR_getty
-#define OPTSTR_getty "<2t#<0H:I:l:f:iwnmLh"
-#ifdef CLEANUP_getty
-#undef CLEANUP_getty
-#undef FOR_getty
-#undef FLAG_h
-#undef FLAG_L
-#undef FLAG_m
-#undef FLAG_n
-#undef FLAG_w
-#undef FLAG_i
-#undef FLAG_f
-#undef FLAG_l
-#undef FLAG_I
-#undef FLAG_H
-#undef FLAG_t
-#endif
-
-// grep (line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw] (line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]
-#undef OPTSTR_grep
-#define OPTSTR_grep "(line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]"
-#ifdef CLEANUP_grep
-#undef CLEANUP_grep
-#undef FOR_grep
-#undef FLAG_x
-#undef FLAG_m
-#undef FLAG_A
-#undef FLAG_B
-#undef FLAG_C
-#undef FLAG_f
-#undef FLAG_e
-#undef FLAG_q
-#undef FLAG_l
-#undef FLAG_c
-#undef FLAG_w
-#undef FLAG_v
-#undef FLAG_s
-#undef FLAG_R
-#undef FLAG_r
-#undef FLAG_o
-#undef FLAG_n
-#undef FLAG_i
-#undef FLAG_h
-#undef FLAG_b
-#undef FLAG_a
-#undef FLAG_I
-#undef FLAG_H
-#undef FLAG_F
-#undef FLAG_E
-#undef FLAG_z
-#undef FLAG_Z
-#undef FLAG_M
-#undef FLAG_S
-#undef FLAG_exclude_dir
-#undef FLAG_color
-#undef FLAG_line_buffered
-#endif
-
-// groupadd <1>2g#<0S
-#undef OPTSTR_groupadd
-#define OPTSTR_groupadd "<1>2g#<0S"
-#ifdef CLEANUP_groupadd
-#undef CLEANUP_groupadd
-#undef FOR_groupadd
-#undef FLAG_S
-#undef FLAG_g
-#endif
-
-// groupdel <1>2
-#undef OPTSTR_groupdel
-#define OPTSTR_groupdel "<1>2"
-#ifdef CLEANUP_groupdel
-#undef CLEANUP_groupdel
-#undef FOR_groupdel
-#endif
-
-// groups
-#undef OPTSTR_groups
-#define OPTSTR_groups 0
-#ifdef CLEANUP_groups
-#undef CLEANUP_groups
-#undef FOR_groups
-#endif
-
-// gunzip cdfk123456789[-123456789]
-#undef OPTSTR_gunzip
-#define OPTSTR_gunzip "cdfk123456789[-123456789]"
-#ifdef CLEANUP_gunzip
-#undef CLEANUP_gunzip
-#undef FOR_gunzip
-#undef FLAG_9
-#undef FLAG_8
-#undef FLAG_7
-#undef FLAG_6
-#undef FLAG_5
-#undef FLAG_4
-#undef FLAG_3
-#undef FLAG_2
-#undef FLAG_1
-#undef FLAG_k
-#undef FLAG_f
-#undef FLAG_d
-#undef FLAG_c
-#endif
-
-// gzip ncdfk123456789[-123456789]
-#undef OPTSTR_gzip
-#define OPTSTR_gzip "ncdfk123456789[-123456789]"
-#ifdef CLEANUP_gzip
-#undef CLEANUP_gzip
-#undef FOR_gzip
-#undef FLAG_9
-#undef FLAG_8
-#undef FLAG_7
-#undef FLAG_6
-#undef FLAG_5
-#undef FLAG_4
-#undef FLAG_3
-#undef FLAG_2
-#undef FLAG_1
-#undef FLAG_k
-#undef FLAG_f
-#undef FLAG_d
-#undef FLAG_c
-#undef FLAG_n
-#endif
-
-// head ?n(lines)#<0=10c(bytes)#<0qv[-nc] ?n(lines)#<0=10c(bytes)#<0qv[-nc]
-#undef OPTSTR_head
-#define OPTSTR_head "?n(lines)#<0=10c(bytes)#<0qv[-nc]"
-#ifdef CLEANUP_head
-#undef CLEANUP_head
-#undef FOR_head
-#undef FLAG_v
-#undef FLAG_q
-#undef FLAG_c
-#undef FLAG_n
-#endif
-
-// hello
-#undef OPTSTR_hello
-#define OPTSTR_hello 0
-#ifdef CLEANUP_hello
-#undef CLEANUP_hello
-#undef FOR_hello
-#endif
-
-// help ah
-#undef OPTSTR_help
-#define OPTSTR_help "ah"
-#ifdef CLEANUP_help
-#undef CLEANUP_help
-#undef FOR_help
-#undef FLAG_h
-#undef FLAG_a
-#endif
-
-// hexedit <1>1r
-#undef OPTSTR_hexedit
-#define OPTSTR_hexedit "<1>1r"
-#ifdef CLEANUP_hexedit
-#undef CLEANUP_hexedit
-#undef FOR_hexedit
-#undef FLAG_r
-#endif
-
-// host <1>2avt:
-#undef OPTSTR_host
-#define OPTSTR_host "<1>2avt:"
-#ifdef CLEANUP_host
-#undef CLEANUP_host
-#undef FOR_host
-#undef FLAG_t
-#undef FLAG_v
-#undef FLAG_a
-#endif
-
-// hostid >0
-#undef OPTSTR_hostid
-#define OPTSTR_hostid ">0"
-#ifdef CLEANUP_hostid
-#undef CLEANUP_hostid
-#undef FOR_hostid
-#endif
-
-// hostname >1bdsfF:[!bdsf] >1bdsfF:[!bdsf]
-#undef OPTSTR_hostname
-#define OPTSTR_hostname ">1bdsfF:[!bdsf]"
-#ifdef CLEANUP_hostname
-#undef CLEANUP_hostname
-#undef FOR_hostname
-#undef FLAG_F
-#undef FLAG_f
-#undef FLAG_s
-#undef FLAG_d
-#undef FLAG_b
-#endif
-
-// hwclock >0(fast)f(rtc):u(utc)l(localtime)t(systz)s(hctosys)r(show)w(systohc)[-ul][!rtsw]
-#undef OPTSTR_hwclock
-#define OPTSTR_hwclock ">0(fast)f(rtc):u(utc)l(localtime)t(systz)s(hctosys)r(show)w(systohc)[-ul][!rtsw]"
-#ifdef CLEANUP_hwclock
-#undef CLEANUP_hwclock
-#undef FOR_hwclock
-#undef FLAG_w
-#undef FLAG_r
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_l
-#undef FLAG_u
-#undef FLAG_f
-#undef FLAG_fast
-#endif
-
-// i2cdetect >3aFly
-#undef OPTSTR_i2cdetect
-#define OPTSTR_i2cdetect ">3aFly"
-#ifdef CLEANUP_i2cdetect
-#undef CLEANUP_i2cdetect
-#undef FOR_i2cdetect
-#undef FLAG_y
-#undef FLAG_l
-#undef FLAG_F
-#undef FLAG_a
-#endif
-
-// i2cdump <2>2fy
-#undef OPTSTR_i2cdump
-#define OPTSTR_i2cdump "<2>2fy"
-#ifdef CLEANUP_i2cdump
-#undef CLEANUP_i2cdump
-#undef FOR_i2cdump
-#undef FLAG_y
-#undef FLAG_f
-#endif
-
-// i2cget <3>3fy
-#undef OPTSTR_i2cget
-#define OPTSTR_i2cget "<3>3fy"
-#ifdef CLEANUP_i2cget
-#undef CLEANUP_i2cget
-#undef FOR_i2cget
-#undef FLAG_y
-#undef FLAG_f
-#endif
-
-// i2cset <4fy
-#undef OPTSTR_i2cset
-#define OPTSTR_i2cset "<4fy"
-#ifdef CLEANUP_i2cset
-#undef CLEANUP_i2cset
-#undef FOR_i2cset
-#undef FLAG_y
-#undef FLAG_f
-#endif
-
-// iconv cst:f:
-#undef OPTSTR_iconv
-#define OPTSTR_iconv "cst:f:"
-#ifdef CLEANUP_iconv
-#undef CLEANUP_iconv
-#undef FOR_iconv
-#undef FLAG_f
-#undef FLAG_t
-#undef FLAG_s
-#undef FLAG_c
-#endif
-
-// id >1nGgru[!Ggu] >1ZnGgru[!ZGgu]
-#undef OPTSTR_id
-#define OPTSTR_id ">1nGgru[!Ggu]"
-#ifdef CLEANUP_id
-#undef CLEANUP_id
-#undef FOR_id
-#undef FLAG_u
-#undef FLAG_r
-#undef FLAG_g
-#undef FLAG_G
-#undef FLAG_n
-#undef FLAG_Z
-#endif
-
-// ifconfig ^?aS
-#undef OPTSTR_ifconfig
-#define OPTSTR_ifconfig "^?aS"
-#ifdef CLEANUP_ifconfig
-#undef CLEANUP_ifconfig
-#undef FOR_ifconfig
-#undef FLAG_S
-#undef FLAG_a
-#endif
-
-// init
-#undef OPTSTR_init
-#define OPTSTR_init 0
-#ifdef CLEANUP_init
-#undef CLEANUP_init
-#undef FOR_init
-#endif
-
-// inotifyd <2
-#undef OPTSTR_inotifyd
-#define OPTSTR_inotifyd "<2"
-#ifdef CLEANUP_inotifyd
-#undef CLEANUP_inotifyd
-#undef FOR_inotifyd
-#endif
-
-// insmod <1
-#undef OPTSTR_insmod
-#define OPTSTR_insmod "<1"
-#ifdef CLEANUP_insmod
-#undef CLEANUP_insmod
-#undef FOR_insmod
-#endif
-
-// install <1cdDpsvm:o:g:
-#undef OPTSTR_install
-#define OPTSTR_install "<1cdDpsvm:o:g:"
-#ifdef CLEANUP_install
-#undef CLEANUP_install
-#undef FOR_install
-#undef FLAG_g
-#undef FLAG_o
-#undef FLAG_m
-#undef FLAG_v
-#undef FLAG_s
-#undef FLAG_p
-#undef FLAG_D
-#undef FLAG_d
-#undef FLAG_c
-#endif
-
-// ionice ^tc#<0>3=2n#<0>7=5p#
-#undef OPTSTR_ionice
-#define OPTSTR_ionice "^tc#<0>3=2n#<0>7=5p#"
-#ifdef CLEANUP_ionice
-#undef CLEANUP_ionice
-#undef FOR_ionice
-#undef FLAG_p
-#undef FLAG_n
-#undef FLAG_c
-#undef FLAG_t
-#endif
-
-// iorenice ?<1>3
-#undef OPTSTR_iorenice
-#define OPTSTR_iorenice "?<1>3"
-#ifdef CLEANUP_iorenice
-#undef CLEANUP_iorenice
-#undef FOR_iorenice
-#endif
-
-// iotop >0AaKOHk*o*p*u*s#<1=7d%<100=3000m#n#<1bq
-#undef OPTSTR_iotop
-#define OPTSTR_iotop ">0AaKOHk*o*p*u*s#<1=7d%<100=3000m#n#<1bq"
-#ifdef CLEANUP_iotop
-#undef CLEANUP_iotop
-#undef FOR_iotop
-#undef FLAG_q
-#undef FLAG_b
-#undef FLAG_n
-#undef FLAG_m
-#undef FLAG_d
-#undef FLAG_s
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_o
-#undef FLAG_k
-#undef FLAG_H
-#undef FLAG_O
-#undef FLAG_K
-#undef FLAG_a
-#undef FLAG_A
-#endif
-
-// ip
-#undef OPTSTR_ip
-#define OPTSTR_ip 0
-#ifdef CLEANUP_ip
-#undef CLEANUP_ip
-#undef FOR_ip
-#endif
-
-// ipcrm m*M*s*S*q*Q*
-#undef OPTSTR_ipcrm
-#define OPTSTR_ipcrm "m*M*s*S*q*Q*"
-#ifdef CLEANUP_ipcrm
-#undef CLEANUP_ipcrm
-#undef FOR_ipcrm
-#undef FLAG_Q
-#undef FLAG_q
-#undef FLAG_S
-#undef FLAG_s
-#undef FLAG_M
-#undef FLAG_m
-#endif
-
-// ipcs acptulsqmi#
-#undef OPTSTR_ipcs
-#define OPTSTR_ipcs "acptulsqmi#"
-#ifdef CLEANUP_ipcs
-#undef CLEANUP_ipcs
-#undef FOR_ipcs
-#undef FLAG_i
-#undef FLAG_m
-#undef FLAG_q
-#undef FLAG_s
-#undef FLAG_l
-#undef FLAG_u
-#undef FLAG_t
-#undef FLAG_p
-#undef FLAG_c
-#undef FLAG_a
-#endif
-
-// kill ?ls:
-#undef OPTSTR_kill
-#define OPTSTR_kill "?ls: "
-#ifdef CLEANUP_kill
-#undef CLEANUP_kill
-#undef FOR_kill
-#undef FLAG_s
-#undef FLAG_l
-#endif
-
-// killall ?s:ilqvw
-#undef OPTSTR_killall
-#define OPTSTR_killall "?s:ilqvw"
-#ifdef CLEANUP_killall
-#undef CLEANUP_killall
-#undef FOR_killall
-#undef FLAG_w
-#undef FLAG_v
-#undef FLAG_q
-#undef FLAG_l
-#undef FLAG_i
-#undef FLAG_s
-#endif
-
-// killall5 ?o*ls: [!lo][!ls]
-#undef OPTSTR_killall5
-#define OPTSTR_killall5 "?o*ls: [!lo][!ls]"
-#ifdef CLEANUP_killall5
-#undef CLEANUP_killall5
-#undef FOR_killall5
-#undef FLAG_s
-#undef FLAG_l
-#undef FLAG_o
-#endif
-
-// klogd c#<1>8n
-#undef OPTSTR_klogd
-#define OPTSTR_klogd "c#<1>8n"
-#ifdef CLEANUP_klogd
-#undef CLEANUP_klogd
-#undef FOR_klogd
-#undef FLAG_n
-#undef FLAG_c
-#endif
-
-// last f:W
-#undef OPTSTR_last
-#define OPTSTR_last "f:W"
-#ifdef CLEANUP_last
-#undef CLEANUP_last
-#undef FOR_last
-#undef FLAG_W
-#undef FLAG_f
-#endif
-
-// link <2>2
-#undef OPTSTR_link
-#define OPTSTR_link "<2>2"
-#ifdef CLEANUP_link
-#undef CLEANUP_link
-#undef FOR_link
-#endif
-
-// ln <1t:Tvnfs <1t:Tvnfs
-#undef OPTSTR_ln
-#define OPTSTR_ln "<1t:Tvnfs"
-#ifdef CLEANUP_ln
-#undef CLEANUP_ln
-#undef FOR_ln
-#undef FLAG_s
-#undef FLAG_f
-#undef FLAG_n
-#undef FLAG_v
-#undef FLAG_T
-#undef FLAG_t
-#endif
-
-// load_policy <1>1
-#undef OPTSTR_load_policy
-#define OPTSTR_load_policy "<1>1"
-#ifdef CLEANUP_load_policy
-#undef CLEANUP_load_policy
-#undef FOR_load_policy
-#endif
-
-// log <1p:t:
-#undef OPTSTR_log
-#define OPTSTR_log "<1p:t:"
-#ifdef CLEANUP_log
-#undef CLEANUP_log
-#undef FOR_log
-#undef FLAG_t
-#undef FLAG_p
-#endif
-
-// logger st:p:
-#undef OPTSTR_logger
-#define OPTSTR_logger "st:p:"
-#ifdef CLEANUP_logger
-#undef CLEANUP_logger
-#undef FOR_logger
-#undef FLAG_p
-#undef FLAG_t
-#undef FLAG_s
-#endif
-
-// login >1f:ph:
-#undef OPTSTR_login
-#define OPTSTR_login ">1f:ph:"
-#ifdef CLEANUP_login
-#undef CLEANUP_login
-#undef FOR_login
-#undef FLAG_h
-#undef FLAG_p
-#undef FLAG_f
-#endif
-
-// logname >0
-#undef OPTSTR_logname
-#define OPTSTR_logname ">0"
-#ifdef CLEANUP_logname
-#undef CLEANUP_logname
-#undef FOR_logname
-#endif
-
-// logwrapper
-#undef OPTSTR_logwrapper
-#define OPTSTR_logwrapper 0
-#ifdef CLEANUP_logwrapper
-#undef CLEANUP_logwrapper
-#undef FOR_logwrapper
-#endif
-
-// losetup >2S(sizelimit)#s(show)ro#j:fdcaD[!afj]
-#undef OPTSTR_losetup
-#define OPTSTR_losetup ">2S(sizelimit)#s(show)ro#j:fdcaD[!afj]"
-#ifdef CLEANUP_losetup
-#undef CLEANUP_losetup
-#undef FOR_losetup
-#undef FLAG_D
-#undef FLAG_a
-#undef FLAG_c
-#undef FLAG_d
-#undef FLAG_f
-#undef FLAG_j
-#undef FLAG_o
-#undef FLAG_r
-#undef FLAG_s
-#undef FLAG_S
-#endif
-
-// ls (color):;(full-time)(show-control-chars)ZgoACFHLRSabcdfhikl@mnpqrstux1[-Cxm1][-Cxml][-Cxmo][-Cxmg][-cu][-ftS][-HL][!qb] (color):;(full-time)(show-control-chars)ZgoACFHLRSabcdfhikl@mnpqrstux1[-Cxm1][-Cxml][-Cxmo][-Cxmg][-cu][-ftS][-HL][!qb]
-#undef OPTSTR_ls
-#define OPTSTR_ls "(color):;(full-time)(show-control-chars)ZgoACFHLRSabcdfhikl@mnpqrstux1[-Cxm1][-Cxml][-Cxmo][-Cxmg][-cu][-ftS][-HL][!qb]"
-#ifdef CLEANUP_ls
-#undef CLEANUP_ls
-#undef FOR_ls
-#undef FLAG_1
-#undef FLAG_x
-#undef FLAG_u
-#undef FLAG_t
-#undef FLAG_s
-#undef FLAG_r
-#undef FLAG_q
-#undef FLAG_p
-#undef FLAG_n
-#undef FLAG_m
-#undef FLAG_l
-#undef FLAG_k
-#undef FLAG_i
-#undef FLAG_h
-#undef FLAG_f
-#undef FLAG_d
-#undef FLAG_c
-#undef FLAG_b
-#undef FLAG_a
-#undef FLAG_S
-#undef FLAG_R
-#undef FLAG_L
-#undef FLAG_H
-#undef FLAG_F
-#undef FLAG_C
-#undef FLAG_A
-#undef FLAG_o
-#undef FLAG_g
-#undef FLAG_Z
-#undef FLAG_show_control_chars
-#undef FLAG_full_time
-#undef FLAG_color
-#endif
-
-// lsattr vldaR
-#undef OPTSTR_lsattr
-#define OPTSTR_lsattr "vldaR"
-#ifdef CLEANUP_lsattr
-#undef CLEANUP_lsattr
-#undef FOR_lsattr
-#undef FLAG_R
-#undef FLAG_a
-#undef FLAG_d
-#undef FLAG_l
-#undef FLAG_v
-#endif
-
-// lsmod
-#undef OPTSTR_lsmod
-#define OPTSTR_lsmod 0
-#ifdef CLEANUP_lsmod
-#undef CLEANUP_lsmod
-#undef FOR_lsmod
-#endif
-
-// lsof lp*t
-#undef OPTSTR_lsof
-#define OPTSTR_lsof "lp*t"
-#ifdef CLEANUP_lsof
-#undef CLEANUP_lsof
-#undef FOR_lsof
-#undef FLAG_t
-#undef FLAG_p
-#undef FLAG_l
-#endif
-
-// lspci emkn@i:
-#undef OPTSTR_lspci
-#define OPTSTR_lspci "emkn@i:"
-#ifdef CLEANUP_lspci
-#undef CLEANUP_lspci
-#undef FOR_lspci
-#undef FLAG_i
-#undef FLAG_n
-#undef FLAG_k
-#undef FLAG_m
-#undef FLAG_e
-#endif
-
-// lsusb
-#undef OPTSTR_lsusb
-#define OPTSTR_lsusb 0
-#ifdef CLEANUP_lsusb
-#undef CLEANUP_lsusb
-#undef FOR_lsusb
-#endif
-
-// makedevs <1>1d:
-#undef OPTSTR_makedevs
-#define OPTSTR_makedevs "<1>1d:"
-#ifdef CLEANUP_makedevs
-#undef CLEANUP_makedevs
-#undef FOR_makedevs
-#undef FLAG_d
-#endif
-
-// man k:M:
-#undef OPTSTR_man
-#define OPTSTR_man "k:M:"
-#ifdef CLEANUP_man
-#undef CLEANUP_man
-#undef FOR_man
-#undef FLAG_M
-#undef FLAG_k
-#endif
-
-// mcookie v(verbose)V(version)
-#undef OPTSTR_mcookie
-#define OPTSTR_mcookie "v(verbose)V(version)"
-#ifdef CLEANUP_mcookie
-#undef CLEANUP_mcookie
-#undef FOR_mcookie
-#undef FLAG_V
-#undef FLAG_v
-#endif
-
-// md5sum bc(check)s(status)[!bc] bc(check)s(status)[!bc]
-#undef OPTSTR_md5sum
-#define OPTSTR_md5sum "bc(check)s(status)[!bc]"
-#ifdef CLEANUP_md5sum
-#undef CLEANUP_md5sum
-#undef FOR_md5sum
-#undef FLAG_s
-#undef FLAG_c
-#undef FLAG_b
-#endif
-
-// mdev s
-#undef OPTSTR_mdev
-#define OPTSTR_mdev "s"
-#ifdef CLEANUP_mdev
-#undef CLEANUP_mdev
-#undef FOR_mdev
-#undef FLAG_s
-#endif
-
-// microcom <1>1s:X <1>1s:X
-#undef OPTSTR_microcom
-#define OPTSTR_microcom "<1>1s:X"
-#ifdef CLEANUP_microcom
-#undef CLEANUP_microcom
-#undef FOR_microcom
-#undef FLAG_X
-#undef FLAG_s
-#endif
-
-// mix c:d:l#r#
-#undef OPTSTR_mix
-#define OPTSTR_mix "c:d:l#r#"
-#ifdef CLEANUP_mix
-#undef CLEANUP_mix
-#undef FOR_mix
-#undef FLAG_r
-#undef FLAG_l
-#undef FLAG_d
-#undef FLAG_c
-#endif
-
-// mkdir <1vp(parent)(parents)m: <1Z:vp(parent)(parents)m:
-#undef OPTSTR_mkdir
-#define OPTSTR_mkdir "<1vp(parent)(parents)m:"
-#ifdef CLEANUP_mkdir
-#undef CLEANUP_mkdir
-#undef FOR_mkdir
-#undef FLAG_m
-#undef FLAG_p
-#undef FLAG_v
-#undef FLAG_Z
-#endif
-
-// mke2fs <1>2g:Fnqm#N#i#b#
-#undef OPTSTR_mke2fs
-#define OPTSTR_mke2fs "<1>2g:Fnqm#N#i#b#"
-#ifdef CLEANUP_mke2fs
-#undef CLEANUP_mke2fs
-#undef FOR_mke2fs
-#undef FLAG_b
-#undef FLAG_i
-#undef FLAG_N
-#undef FLAG_m
-#undef FLAG_q
-#undef FLAG_n
-#undef FLAG_F
-#undef FLAG_g
-#endif
-
-// mkfifo <1Z:m:
-#undef OPTSTR_mkfifo
-#define OPTSTR_mkfifo "<1Z:m:"
-#ifdef CLEANUP_mkfifo
-#undef CLEANUP_mkfifo
-#undef FOR_mkfifo
-#undef FLAG_m
-#undef FLAG_Z
-#endif
-
-// mknod <2>4m(mode):Z:
-#undef OPTSTR_mknod
-#define OPTSTR_mknod "<2>4m(mode):Z:"
-#ifdef CLEANUP_mknod
-#undef CLEANUP_mknod
-#undef FOR_mknod
-#undef FLAG_Z
-#undef FLAG_m
-#endif
-
-// mkpasswd >2S:m:P#=0<0
-#undef OPTSTR_mkpasswd
-#define OPTSTR_mkpasswd ">2S:m:P#=0<0"
-#ifdef CLEANUP_mkpasswd
-#undef CLEANUP_mkpasswd
-#undef FOR_mkpasswd
-#undef FLAG_P
-#undef FLAG_m
-#undef FLAG_S
-#endif
-
-// mkswap <1>1L:
-#undef OPTSTR_mkswap
-#define OPTSTR_mkswap "<1>1L:"
-#ifdef CLEANUP_mkswap
-#undef CLEANUP_mkswap
-#undef FOR_mkswap
-#undef FLAG_L
-#endif
-
-// mktemp >1(tmpdir);:uqd(directory)p:t >1(tmpdir);:uqd(directory)p:t
-#undef OPTSTR_mktemp
-#define OPTSTR_mktemp ">1(tmpdir);:uqd(directory)p:t"
-#ifdef CLEANUP_mktemp
-#undef CLEANUP_mktemp
-#undef FOR_mktemp
-#undef FLAG_t
-#undef FLAG_p
-#undef FLAG_d
-#undef FLAG_q
-#undef FLAG_u
-#undef FLAG_tmpdir
-#endif
-
-// modinfo <1b:k:F:0
-#undef OPTSTR_modinfo
-#define OPTSTR_modinfo "<1b:k:F:0"
-#ifdef CLEANUP_modinfo
-#undef CLEANUP_modinfo
-#undef FOR_modinfo
-#undef FLAG_0
-#undef FLAG_F
-#undef FLAG_k
-#undef FLAG_b
-#endif
-
-// modprobe alrqvsDbd*
-#undef OPTSTR_modprobe
-#define OPTSTR_modprobe "alrqvsDbd*"
-#ifdef CLEANUP_modprobe
-#undef CLEANUP_modprobe
-#undef FOR_modprobe
-#undef FLAG_d
-#undef FLAG_b
-#undef FLAG_D
-#undef FLAG_s
-#undef FLAG_v
-#undef FLAG_q
-#undef FLAG_r
-#undef FLAG_l
-#undef FLAG_a
-#endif
-
-// more
-#undef OPTSTR_more
-#define OPTSTR_more 0
-#ifdef CLEANUP_more
-#undef CLEANUP_more
-#undef FOR_more
-#endif
-
-// mount ?O:afnrvwt:o*[-rw]
-#undef OPTSTR_mount
-#define OPTSTR_mount "?O:afnrvwt:o*[-rw]"
-#ifdef CLEANUP_mount
-#undef CLEANUP_mount
-#undef FOR_mount
-#undef FLAG_o
-#undef FLAG_t
-#undef FLAG_w
-#undef FLAG_v
-#undef FLAG_r
-#undef FLAG_n
-#undef FLAG_f
-#undef FLAG_a
-#undef FLAG_O
-#endif
-
-// mountpoint <1qdx[-dx]
-#undef OPTSTR_mountpoint
-#define OPTSTR_mountpoint "<1qdx[-dx]"
-#ifdef CLEANUP_mountpoint
-#undef CLEANUP_mountpoint
-#undef FOR_mountpoint
-#undef FLAG_x
-#undef FLAG_d
-#undef FLAG_q
-#endif
-
-// mv <2vnF(remove-destination)fi[-ni] <2vnF(remove-destination)fi[-ni]
-#undef OPTSTR_mv
-#define OPTSTR_mv "<2vnF(remove-destination)fi[-ni]"
-#ifdef CLEANUP_mv
-#undef CLEANUP_mv
-#undef FOR_mv
-#undef FLAG_i
-#undef FLAG_f
-#undef FLAG_F
-#undef FLAG_n
-#undef FLAG_v
-#endif
-
-// nbd_client <3>3ns
-#undef OPTSTR_nbd_client
-#define OPTSTR_nbd_client "<3>3ns"
-#ifdef CLEANUP_nbd_client
-#undef CLEANUP_nbd_client
-#undef FOR_nbd_client
-#undef FLAG_s
-#undef FLAG_n
-#endif
-
-// netcat ^tlLw#<1W#<1p#<1>65535q#<1s:f:46uU[!tlL][!Lw][!46U]
-#undef OPTSTR_netcat
-#define OPTSTR_netcat "^tlLw#<1W#<1p#<1>65535q#<1s:f:46uU[!tlL][!Lw][!46U]"
-#ifdef CLEANUP_netcat
-#undef CLEANUP_netcat
-#undef FOR_netcat
-#undef FLAG_U
-#undef FLAG_u
-#undef FLAG_6
-#undef FLAG_4
-#undef FLAG_f
-#undef FLAG_s
-#undef FLAG_q
-#undef FLAG_p
-#undef FLAG_W
-#undef FLAG_w
-#undef FLAG_L
-#undef FLAG_l
-#undef FLAG_t
-#endif
-
-// netstat pWrxwutneal
-#undef OPTSTR_netstat
-#define OPTSTR_netstat "pWrxwutneal"
-#ifdef CLEANUP_netstat
-#undef CLEANUP_netstat
-#undef FOR_netstat
-#undef FLAG_l
-#undef FLAG_a
-#undef FLAG_e
-#undef FLAG_n
-#undef FLAG_t
-#undef FLAG_u
-#undef FLAG_w
-#undef FLAG_x
-#undef FLAG_r
-#undef FLAG_W
-#undef FLAG_p
-#endif
-
-// nice ^<1n#
-#undef OPTSTR_nice
-#define OPTSTR_nice "^<1n#"
-#ifdef CLEANUP_nice
-#undef CLEANUP_nice
-#undef FOR_nice
-#undef FLAG_n
-#endif
-
-// nl v#=1l#w#<0=6Eb:n:s:
-#undef OPTSTR_nl
-#define OPTSTR_nl "v#=1l#w#<0=6Eb:n:s:"
-#ifdef CLEANUP_nl
-#undef CLEANUP_nl
-#undef FOR_nl
-#undef FLAG_s
-#undef FLAG_n
-#undef FLAG_b
-#undef FLAG_E
-#undef FLAG_w
-#undef FLAG_l
-#undef FLAG_v
-#endif
-
-// nohup <1^
-#undef OPTSTR_nohup
-#define OPTSTR_nohup "<1^"
-#ifdef CLEANUP_nohup
-#undef CLEANUP_nohup
-#undef FOR_nohup
-#endif
-
-// nproc (all)
-#undef OPTSTR_nproc
-#define OPTSTR_nproc "(all)"
-#ifdef CLEANUP_nproc
-#undef CLEANUP_nproc
-#undef FOR_nproc
-#undef FLAG_all
-#endif
-
-// nsenter <1F(no-fork)t#<1(target)i:(ipc);m:(mount);n:(net);p:(pid);u:(uts);U:(user);
-#undef OPTSTR_nsenter
-#define OPTSTR_nsenter "<1F(no-fork)t#<1(target)i:(ipc);m:(mount);n:(net);p:(pid);u:(uts);U:(user);"
-#ifdef CLEANUP_nsenter
-#undef CLEANUP_nsenter
-#undef FOR_nsenter
-#undef FLAG_U
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_n
-#undef FLAG_m
-#undef FLAG_i
-#undef FLAG_t
-#undef FLAG_F
-#endif
-
-// od j#vw#<1=16N#xsodcbA:t* j#vw#<1=16N#xsodcbA:t*
-#undef OPTSTR_od
-#define OPTSTR_od "j#vw#<1=16N#xsodcbA:t*"
-#ifdef CLEANUP_od
-#undef CLEANUP_od
-#undef FOR_od
-#undef FLAG_t
-#undef FLAG_A
-#undef FLAG_b
-#undef FLAG_c
-#undef FLAG_d
-#undef FLAG_o
-#undef FLAG_s
-#undef FLAG_x
-#undef FLAG_N
-#undef FLAG_w
-#undef FLAG_v
-#undef FLAG_j
-#endif
-
-// oneit ^<1nc:p3[!pn]
-#undef OPTSTR_oneit
-#define OPTSTR_oneit "^<1nc:p3[!pn]"
-#ifdef CLEANUP_oneit
-#undef CLEANUP_oneit
-#undef FOR_oneit
-#undef FLAG_3
-#undef FLAG_p
-#undef FLAG_c
-#undef FLAG_n
-#endif
-
-// openvt c#<1>63sw
-#undef OPTSTR_openvt
-#define OPTSTR_openvt "c#<1>63sw"
-#ifdef CLEANUP_openvt
-#undef CLEANUP_openvt
-#undef FOR_openvt
-#undef FLAG_w
-#undef FLAG_s
-#undef FLAG_c
-#endif
-
-// partprobe <1
-#undef OPTSTR_partprobe
-#define OPTSTR_partprobe "<1"
-#ifdef CLEANUP_partprobe
-#undef CLEANUP_partprobe
-#undef FOR_partprobe
-#endif
-
-// passwd >1a:dlu
-#undef OPTSTR_passwd
-#define OPTSTR_passwd ">1a:dlu"
-#ifdef CLEANUP_passwd
-#undef CLEANUP_passwd
-#undef FOR_passwd
-#undef FLAG_u
-#undef FLAG_l
-#undef FLAG_d
-#undef FLAG_a
-#endif
-
-// paste d:s d:s
-#undef OPTSTR_paste
-#define OPTSTR_paste "d:s"
-#ifdef CLEANUP_paste
-#undef CLEANUP_paste
-#undef FOR_paste
-#undef FLAG_s
-#undef FLAG_d
-#endif
-
-// patch (no-backup-if-mismatch)(dry-run)g#fulp#d:i:Rs(quiet) (no-backup-if-mismatch)(dry-run)xg#fulp#d:i:Rs(quiet)
-#undef OPTSTR_patch
-#define OPTSTR_patch "(no-backup-if-mismatch)(dry-run)g#fulp#d:i:Rs(quiet)"
-#ifdef CLEANUP_patch
-#undef CLEANUP_patch
-#undef FOR_patch
-#undef FLAG_s
-#undef FLAG_R
-#undef FLAG_i
-#undef FLAG_d
-#undef FLAG_p
-#undef FLAG_l
-#undef FLAG_u
-#undef FLAG_f
-#undef FLAG_g
-#undef FLAG_x
-#undef FLAG_dry_run
-#undef FLAG_no_backup_if_mismatch
-#endif
-
-// pgrep ?cld:u*U*t*s*P*g*G*fnovxL:[-no]
-#undef OPTSTR_pgrep
-#define OPTSTR_pgrep "?cld:u*U*t*s*P*g*G*fnovxL:[-no]"
-#ifdef CLEANUP_pgrep
-#undef CLEANUP_pgrep
-#undef FOR_pgrep
-#undef FLAG_L
-#undef FLAG_x
-#undef FLAG_v
-#undef FLAG_o
-#undef FLAG_n
-#undef FLAG_f
-#undef FLAG_G
-#undef FLAG_g
-#undef FLAG_P
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_U
-#undef FLAG_u
-#undef FLAG_d
-#undef FLAG_l
-#undef FLAG_c
-#endif
-
-// pidof <1so:x
-#undef OPTSTR_pidof
-#define OPTSTR_pidof "<1so:x"
-#ifdef CLEANUP_pidof
-#undef CLEANUP_pidof
-#undef FOR_pidof
-#undef FLAG_x
-#undef FLAG_o
-#undef FLAG_s
-#endif
-
-// ping <1>1m#t#<0>255=64c#<0=3s#<0>4088=56i%W#<0=3w#<0qf46I:[-46]
-#undef OPTSTR_ping
-#define OPTSTR_ping "<1>1m#t#<0>255=64c#<0=3s#<0>4088=56i%W#<0=3w#<0qf46I:[-46]"
-#ifdef CLEANUP_ping
-#undef CLEANUP_ping
-#undef FOR_ping
-#undef FLAG_I
-#undef FLAG_6
-#undef FLAG_4
-#undef FLAG_f
-#undef FLAG_q
-#undef FLAG_w
-#undef FLAG_W
-#undef FLAG_i
-#undef FLAG_s
-#undef FLAG_c
-#undef FLAG_t
-#undef FLAG_m
-#endif
-
-// pivot_root <2>2
-#undef OPTSTR_pivot_root
-#define OPTSTR_pivot_root "<2>2"
-#ifdef CLEANUP_pivot_root
-#undef CLEANUP_pivot_root
-#undef FOR_pivot_root
-#endif
-
-// pkill ?Vu*U*t*s*P*g*G*fnovxl:[-no]
-#undef OPTSTR_pkill
-#define OPTSTR_pkill "?Vu*U*t*s*P*g*G*fnovxl:[-no]"
-#ifdef CLEANUP_pkill
-#undef CLEANUP_pkill
-#undef FOR_pkill
-#undef FLAG_l
-#undef FLAG_x
-#undef FLAG_v
-#undef FLAG_o
-#undef FLAG_n
-#undef FLAG_f
-#undef FLAG_G
-#undef FLAG_g
-#undef FLAG_P
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_U
-#undef FLAG_u
-#undef FLAG_V
-#endif
-
-// pmap <1xq
-#undef OPTSTR_pmap
-#define OPTSTR_pmap "<1xq"
-#ifdef CLEANUP_pmap
-#undef CLEANUP_pmap
-#undef FOR_pmap
-#undef FLAG_q
-#undef FLAG_x
-#endif
-
-// printenv 0(null)
-#undef OPTSTR_printenv
-#define OPTSTR_printenv "0(null)"
-#ifdef CLEANUP_printenv
-#undef CLEANUP_printenv
-#undef FOR_printenv
-#undef FLAG_0
-#endif
-
-// printf <1?^
-#undef OPTSTR_printf
-#define OPTSTR_printf "<1?^"
-#ifdef CLEANUP_printf
-#undef CLEANUP_printf
-#undef FOR_printf
-#endif
-
-// ps k(sort)*P(ppid)*aAdeflMno*O*p(pid)*s*t*Tu*U*g*G*wZ[!ol][+Ae][!oO]
-#undef OPTSTR_ps
-#define OPTSTR_ps "k(sort)*P(ppid)*aAdeflMno*O*p(pid)*s*t*Tu*U*g*G*wZ[!ol][+Ae][!oO]"
-#ifdef CLEANUP_ps
-#undef CLEANUP_ps
-#undef FOR_ps
-#undef FLAG_Z
-#undef FLAG_w
-#undef FLAG_G
-#undef FLAG_g
-#undef FLAG_U
-#undef FLAG_u
-#undef FLAG_T
-#undef FLAG_t
-#undef FLAG_s
-#undef FLAG_p
-#undef FLAG_O
-#undef FLAG_o
-#undef FLAG_n
-#undef FLAG_M
-#undef FLAG_l
-#undef FLAG_f
-#undef FLAG_e
-#undef FLAG_d
-#undef FLAG_A
-#undef FLAG_a
-#undef FLAG_P
-#undef FLAG_k
-#endif
-
-// pwd >0LP[-LP] >0LP[-LP]
-#undef OPTSTR_pwd
-#define OPTSTR_pwd ">0LP[-LP]"
-#ifdef CLEANUP_pwd
-#undef CLEANUP_pwd
-#undef FOR_pwd
-#undef FLAG_P
-#undef FLAG_L
-#endif
-
-// pwdx <1a
-#undef OPTSTR_pwdx
-#define OPTSTR_pwdx "<1a"
-#ifdef CLEANUP_pwdx
-#undef CLEANUP_pwdx
-#undef FOR_pwdx
-#undef FLAG_a
-#endif
-
-// readahead
-#undef OPTSTR_readahead
-#define OPTSTR_readahead 0
-#ifdef CLEANUP_readahead
-#undef CLEANUP_readahead
-#undef FOR_readahead
-#endif
-
-// readlink <1nqmef(canonicalize)[-mef] <1nqmef(canonicalize)[-mef]
-#undef OPTSTR_readlink
-#define OPTSTR_readlink "<1nqmef(canonicalize)[-mef]"
-#ifdef CLEANUP_readlink
-#undef CLEANUP_readlink
-#undef FOR_readlink
-#undef FLAG_f
-#undef FLAG_e
-#undef FLAG_m
-#undef FLAG_q
-#undef FLAG_n
-#endif
-
-// realpath <1 <1
-#undef OPTSTR_realpath
-#define OPTSTR_realpath "<1"
-#ifdef CLEANUP_realpath
-#undef CLEANUP_realpath
-#undef FOR_realpath
-#endif
-
-// reboot fn
-#undef OPTSTR_reboot
-#define OPTSTR_reboot "fn"
-#ifdef CLEANUP_reboot
-#undef CLEANUP_reboot
-#undef FOR_reboot
-#undef FLAG_n
-#undef FLAG_f
-#endif
-
-// renice <1gpun#|
-#undef OPTSTR_renice
-#define OPTSTR_renice "<1gpun#|"
-#ifdef CLEANUP_renice
-#undef CLEANUP_renice
-#undef FOR_renice
-#undef FLAG_n
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_g
-#endif
-
-// reset
-#undef OPTSTR_reset
-#define OPTSTR_reset 0
-#ifdef CLEANUP_reset
-#undef CLEANUP_reset
-#undef FOR_reset
-#endif
-
-// restorecon <1DFnRrv
-#undef OPTSTR_restorecon
-#define OPTSTR_restorecon "<1DFnRrv"
-#ifdef CLEANUP_restorecon
-#undef CLEANUP_restorecon
-#undef FOR_restorecon
-#undef FLAG_v
-#undef FLAG_r
-#undef FLAG_R
-#undef FLAG_n
-#undef FLAG_F
-#undef FLAG_D
-#endif
-
-// rev
-#undef OPTSTR_rev
-#define OPTSTR_rev 0
-#ifdef CLEANUP_rev
-#undef CLEANUP_rev
-#undef FOR_rev
-#endif
-
-// rfkill <1>2
-#undef OPTSTR_rfkill
-#define OPTSTR_rfkill "<1>2"
-#ifdef CLEANUP_rfkill
-#undef CLEANUP_rfkill
-#undef FOR_rfkill
-#endif
-
-// rm fiRrv[-fi] fiRrv[-fi]
-#undef OPTSTR_rm
-#define OPTSTR_rm "fiRrv[-fi]"
-#ifdef CLEANUP_rm
-#undef CLEANUP_rm
-#undef FOR_rm
-#undef FLAG_v
-#undef FLAG_r
-#undef FLAG_R
-#undef FLAG_i
-#undef FLAG_f
-#endif
-
-// rmdir <1(ignore-fail-on-non-empty)p <1(ignore-fail-on-non-empty)p
-#undef OPTSTR_rmdir
-#define OPTSTR_rmdir "<1(ignore-fail-on-non-empty)p"
-#ifdef CLEANUP_rmdir
-#undef CLEANUP_rmdir
-#undef FOR_rmdir
-#undef FLAG_p
-#undef FLAG_ignore_fail_on_non_empty
-#endif
-
-// rmmod <1wf
-#undef OPTSTR_rmmod
-#define OPTSTR_rmmod "<1wf"
-#ifdef CLEANUP_rmmod
-#undef CLEANUP_rmmod
-#undef FOR_rmmod
-#undef FLAG_f
-#undef FLAG_w
-#endif
-
-// route ?neA:
-#undef OPTSTR_route
-#define OPTSTR_route "?neA:"
-#ifdef CLEANUP_route
-#undef CLEANUP_route
-#undef FOR_route
-#undef FLAG_A
-#undef FLAG_e
-#undef FLAG_n
-#endif
-
-// runcon <2
-#undef OPTSTR_runcon
-#define OPTSTR_runcon "<2"
-#ifdef CLEANUP_runcon
-#undef CLEANUP_runcon
-#undef FOR_runcon
-#endif
-
-// sed (help)(version)e*f*i:;nErz(null-data)[+Er] (help)(version)e*f*i:;nErz(null-data)[+Er]
-#undef OPTSTR_sed
-#define OPTSTR_sed "(help)(version)e*f*i:;nErz(null-data)[+Er]"
-#ifdef CLEANUP_sed
-#undef CLEANUP_sed
-#undef FOR_sed
-#undef FLAG_z
-#undef FLAG_r
-#undef FLAG_E
-#undef FLAG_n
-#undef FLAG_i
-#undef FLAG_f
-#undef FLAG_e
-#undef FLAG_version
-#undef FLAG_help
-#endif
-
-// sendevent <4>4
-#undef OPTSTR_sendevent
-#define OPTSTR_sendevent "<4>4"
-#ifdef CLEANUP_sendevent
-#undef CLEANUP_sendevent
-#undef FOR_sendevent
-#endif
-
-// seq <1>3?f:s:w[!fw] <1>3?f:s:w[!fw]
-#undef OPTSTR_seq
-#define OPTSTR_seq "<1>3?f:s:w[!fw]"
-#ifdef CLEANUP_seq
-#undef CLEANUP_seq
-#undef FOR_seq
-#undef FLAG_w
-#undef FLAG_s
-#undef FLAG_f
-#endif
-
-// setenforce <1>1
-#undef OPTSTR_setenforce
-#define OPTSTR_setenforce "<1>1"
-#ifdef CLEANUP_setenforce
-#undef CLEANUP_setenforce
-#undef FOR_setenforce
-#endif
-
-// setfattr hn:|v:x:|[!xv]
-#undef OPTSTR_setfattr
-#define OPTSTR_setfattr "hn:|v:x:|[!xv]"
-#ifdef CLEANUP_setfattr
-#undef CLEANUP_setfattr
-#undef FOR_setfattr
-#undef FLAG_x
-#undef FLAG_v
-#undef FLAG_n
-#undef FLAG_h
-#endif
-
-// setsid ^<1t ^<1t
-#undef OPTSTR_setsid
-#define OPTSTR_setsid "^<1t"
-#ifdef CLEANUP_setsid
-#undef CLEANUP_setsid
-#undef FOR_setsid
-#undef FLAG_t
-#endif
-
-// sh c:i
-#undef OPTSTR_sh
-#define OPTSTR_sh "c:i"
-#ifdef CLEANUP_sh
-#undef CLEANUP_sh
-#undef FOR_sh
-#undef FLAG_i
-#undef FLAG_c
-#endif
-
-// sha1sum bc(check)s(status)[!bc] bc(check)s(status)[!bc]
-#undef OPTSTR_sha1sum
-#define OPTSTR_sha1sum "bc(check)s(status)[!bc]"
-#ifdef CLEANUP_sha1sum
-#undef CLEANUP_sha1sum
-#undef FOR_sha1sum
-#undef FLAG_s
-#undef FLAG_c
-#undef FLAG_b
-#endif
-
-// shred <1zxus#<1n#<1o#<0f
-#undef OPTSTR_shred
-#define OPTSTR_shred "<1zxus#<1n#<1o#<0f"
-#ifdef CLEANUP_shred
-#undef CLEANUP_shred
-#undef FOR_shred
-#undef FLAG_f
-#undef FLAG_o
-#undef FLAG_n
-#undef FLAG_s
-#undef FLAG_u
-#undef FLAG_x
-#undef FLAG_z
-#endif
-
-// skeleton (walrus)(blubber):;(also):e@d*c#b:a
-#undef OPTSTR_skeleton
-#define OPTSTR_skeleton "(walrus)(blubber):;(also):e@d*c#b:a"
-#ifdef CLEANUP_skeleton
-#undef CLEANUP_skeleton
-#undef FOR_skeleton
-#undef FLAG_a
-#undef FLAG_b
-#undef FLAG_c
-#undef FLAG_d
-#undef FLAG_e
-#undef FLAG_also
-#undef FLAG_blubber
-#undef FLAG_walrus
-#endif
-
-// skeleton_alias b#dq
-#undef OPTSTR_skeleton_alias
-#define OPTSTR_skeleton_alias "b#dq"
-#ifdef CLEANUP_skeleton_alias
-#undef CLEANUP_skeleton_alias
-#undef FOR_skeleton_alias
-#undef FLAG_q
-#undef FLAG_d
-#undef FLAG_b
-#endif
-
-// sleep <1 <1
-#undef OPTSTR_sleep
-#define OPTSTR_sleep "<1"
-#ifdef CLEANUP_sleep
-#undef CLEANUP_sleep
-#undef FOR_sleep
-#endif
-
-// sntp >1M :m :Sp:t#<0=1>16asdDqr#<4>17=10[!as]
-#undef OPTSTR_sntp
-#define OPTSTR_sntp ">1M :m :Sp:t#<0=1>16asdDqr#<4>17=10[!as]"
-#ifdef CLEANUP_sntp
-#undef CLEANUP_sntp
-#undef FOR_sntp
-#undef FLAG_r
-#undef FLAG_q
-#undef FLAG_D
-#undef FLAG_d
-#undef FLAG_s
-#undef FLAG_a
-#undef FLAG_t
-#undef FLAG_p
-#undef FLAG_S
-#undef FLAG_m
-#undef FLAG_M
-#endif
-
-// sort gS:T:mo:k*t:xVbMcszdfirun gS:T:mo:k*t:xVbMcszdfirun
-#undef OPTSTR_sort
-#define OPTSTR_sort "gS:T:mo:k*t:xVbMcszdfirun"
-#ifdef CLEANUP_sort
-#undef CLEANUP_sort
-#undef FOR_sort
-#undef FLAG_n
-#undef FLAG_u
-#undef FLAG_r
-#undef FLAG_i
-#undef FLAG_f
-#undef FLAG_d
-#undef FLAG_z
-#undef FLAG_s
-#undef FLAG_c
-#undef FLAG_M
-#undef FLAG_b
-#undef FLAG_V
-#undef FLAG_x
-#undef FLAG_t
-#undef FLAG_k
-#undef FLAG_o
-#undef FLAG_m
-#undef FLAG_T
-#undef FLAG_S
-#undef FLAG_g
-#endif
-
-// split >2a#<1=2>9b#<1l#<1[!bl]
-#undef OPTSTR_split
-#define OPTSTR_split ">2a#<1=2>9b#<1l#<1[!bl]"
-#ifdef CLEANUP_split
-#undef CLEANUP_split
-#undef FOR_split
-#undef FLAG_l
-#undef FLAG_b
-#undef FLAG_a
-#endif
-
-// stat <1c:(format)fLt <1c:(format)fLt
-#undef OPTSTR_stat
-#define OPTSTR_stat "<1c:(format)fLt"
-#ifdef CLEANUP_stat
-#undef CLEANUP_stat
-#undef FOR_stat
-#undef FLAG_t
-#undef FLAG_L
-#undef FLAG_f
-#undef FLAG_c
-#endif
-
-// strings t:an#=4<1fo
-#undef OPTSTR_strings
-#define OPTSTR_strings "t:an#=4<1fo"
-#ifdef CLEANUP_strings
-#undef CLEANUP_strings
-#undef FOR_strings
-#undef FLAG_o
-#undef FLAG_f
-#undef FLAG_n
-#undef FLAG_a
-#undef FLAG_t
-#endif
-
-// stty ?aF:g[!ag]
-#undef OPTSTR_stty
-#define OPTSTR_stty "?aF:g[!ag]"
-#ifdef CLEANUP_stty
-#undef CLEANUP_stty
-#undef FOR_stty
-#undef FLAG_g
-#undef FLAG_F
-#undef FLAG_a
-#endif
-
-// su ^lmpu:g:c:s:[!lmp]
-#undef OPTSTR_su
-#define OPTSTR_su "^lmpu:g:c:s:[!lmp]"
-#ifdef CLEANUP_su
-#undef CLEANUP_su
-#undef FOR_su
-#undef FLAG_s
-#undef FLAG_c
-#undef FLAG_g
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_m
-#undef FLAG_l
-#endif
-
-// sulogin t#<0=0
-#undef OPTSTR_sulogin
-#define OPTSTR_sulogin "t#<0=0"
-#ifdef CLEANUP_sulogin
-#undef CLEANUP_sulogin
-#undef FOR_sulogin
-#undef FLAG_t
-#endif
-
-// swapoff <1>1
-#undef OPTSTR_swapoff
-#define OPTSTR_swapoff "<1>1"
-#ifdef CLEANUP_swapoff
-#undef CLEANUP_swapoff
-#undef FOR_swapoff
-#endif
-
-// swapon <1>1p#<0>32767d
-#undef OPTSTR_swapon
-#define OPTSTR_swapon "<1>1p#<0>32767d"
-#ifdef CLEANUP_swapon
-#undef CLEANUP_swapon
-#undef FOR_swapon
-#undef FLAG_d
-#undef FLAG_p
-#endif
-
-// switch_root <2c:h
-#undef OPTSTR_switch_root
-#define OPTSTR_switch_root "<2c:h"
-#ifdef CLEANUP_switch_root
-#undef CLEANUP_switch_root
-#undef FOR_switch_root
-#undef FLAG_h
-#undef FLAG_c
-#endif
-
-// sync
-#undef OPTSTR_sync
-#define OPTSTR_sync 0
-#ifdef CLEANUP_sync
-#undef CLEANUP_sync
-#undef FOR_sync
-#endif
-
-// sysctl ^neNqwpaA[!ap][!aq][!aw][+aA]
-#undef OPTSTR_sysctl
-#define OPTSTR_sysctl "^neNqwpaA[!ap][!aq][!aw][+aA]"
-#ifdef CLEANUP_sysctl
-#undef CLEANUP_sysctl
-#undef FOR_sysctl
-#undef FLAG_A
-#undef FLAG_a
-#undef FLAG_p
-#undef FLAG_w
-#undef FLAG_q
-#undef FLAG_N
-#undef FLAG_e
-#undef FLAG_n
-#endif
-
-// syslogd >0l#<1>8=8R:b#<0>99=1s#<0=200m#<0>71582787=20O:p:f:a:nSKLD
-#undef OPTSTR_syslogd
-#define OPTSTR_syslogd ">0l#<1>8=8R:b#<0>99=1s#<0=200m#<0>71582787=20O:p:f:a:nSKLD"
-#ifdef CLEANUP_syslogd
-#undef CLEANUP_syslogd
-#undef FOR_syslogd
-#undef FLAG_D
-#undef FLAG_L
-#undef FLAG_K
-#undef FLAG_S
-#undef FLAG_n
-#undef FLAG_a
-#undef FLAG_f
-#undef FLAG_p
-#undef FLAG_O
-#undef FLAG_m
-#undef FLAG_s
-#undef FLAG_b
-#undef FLAG_R
-#undef FLAG_l
-#endif
-
-// tac
-#undef OPTSTR_tac
-#define OPTSTR_tac 0
-#ifdef CLEANUP_tac
-#undef CLEANUP_tac
-#undef FOR_tac
-#endif
-
-// tail ?fc-n-[-cn] ?fc-n-[-cn]
-#undef OPTSTR_tail
-#define OPTSTR_tail "?fc-n-[-cn]"
-#ifdef CLEANUP_tail
-#undef CLEANUP_tail
-#undef FOR_tail
-#undef FLAG_n
-#undef FLAG_c
-#undef FLAG_f
-#endif
-
-// tar &(restrict)(full-time)(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(mode):(mtime):(group):(owner):(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):a[!txc][!jzJa] &(restrict)(full-time)(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(mode):(mtime):(group):(owner):(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):a[!txc][!jzJa]
-#undef OPTSTR_tar
-#define OPTSTR_tar "&(restrict)(full-time)(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(mode):(mtime):(group):(owner):(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):a[!txc][!jzJa]"
-#ifdef CLEANUP_tar
-#undef CLEANUP_tar
-#undef FOR_tar
-#undef FLAG_a
-#undef FLAG_f
-#undef FLAG_C
-#undef FLAG_T
-#undef FLAG_X
-#undef FLAG_m
-#undef FLAG_O
-#undef FLAG_S
-#undef FLAG_z
-#undef FLAG_j
-#undef FLAG_J
-#undef FLAG_v
-#undef FLAG_t
-#undef FLAG_x
-#undef FLAG_h
-#undef FLAG_c
-#undef FLAG_k
-#undef FLAG_p
-#undef FLAG_o
-#undef FLAG_to_command
-#undef FLAG_owner
-#undef FLAG_group
-#undef FLAG_mtime
-#undef FLAG_mode
-#undef FLAG_exclude
-#undef FLAG_overwrite
-#undef FLAG_no_same_permissions
-#undef FLAG_numeric_owner
-#undef FLAG_no_recursion
-#undef FLAG_full_time
-#undef FLAG_restrict
-#endif
-
-// taskset <1^pa
-#undef OPTSTR_taskset
-#define OPTSTR_taskset "<1^pa"
-#ifdef CLEANUP_taskset
-#undef CLEANUP_taskset
-#undef FOR_taskset
-#undef FLAG_a
-#undef FLAG_p
-#endif
-
-// tcpsvd ^<3c#=30<1C:b#=20<0u:l:hEv
-#undef OPTSTR_tcpsvd
-#define OPTSTR_tcpsvd "^<3c#=30<1C:b#=20<0u:l:hEv"
-#ifdef CLEANUP_tcpsvd
-#undef CLEANUP_tcpsvd
-#undef FOR_tcpsvd
-#undef FLAG_v
-#undef FLAG_E
-#undef FLAG_h
-#undef FLAG_l
-#undef FLAG_u
-#undef FLAG_b
-#undef FLAG_C
-#undef FLAG_c
-#endif
-
-// tee ia ia
-#undef OPTSTR_tee
-#define OPTSTR_tee "ia"
-#ifdef CLEANUP_tee
-#undef CLEANUP_tee
-#undef FOR_tee
-#undef FLAG_a
-#undef FLAG_i
-#endif
-
-// telnet <1>2
-#undef OPTSTR_telnet
-#define OPTSTR_telnet "<1>2"
-#ifdef CLEANUP_telnet
-#undef CLEANUP_telnet
-#undef FOR_telnet
-#endif
-
-// telnetd w#<0b:p#<0>65535=23f:l:FSKi[!wi]
-#undef OPTSTR_telnetd
-#define OPTSTR_telnetd "w#<0b:p#<0>65535=23f:l:FSKi[!wi]"
-#ifdef CLEANUP_telnetd
-#undef CLEANUP_telnetd
-#undef FOR_telnetd
-#undef FLAG_i
-#undef FLAG_K
-#undef FLAG_S
-#undef FLAG_F
-#undef FLAG_l
-#undef FLAG_f
-#undef FLAG_p
-#undef FLAG_b
-#undef FLAG_w
-#endif
-
-// test
-#undef OPTSTR_test
-#define OPTSTR_test 0
-#ifdef CLEANUP_test
-#undef CLEANUP_test
-#undef FOR_test
-#endif
-
-// tftp <1b#<8>65464r:l:g|p|[!gp]
-#undef OPTSTR_tftp
-#define OPTSTR_tftp "<1b#<8>65464r:l:g|p|[!gp]"
-#ifdef CLEANUP_tftp
-#undef CLEANUP_tftp
-#undef FOR_tftp
-#undef FLAG_p
-#undef FLAG_g
-#undef FLAG_l
-#undef FLAG_r
-#undef FLAG_b
-#endif
-
-// tftpd rcu:l
-#undef OPTSTR_tftpd
-#define OPTSTR_tftpd "rcu:l"
-#ifdef CLEANUP_tftpd
-#undef CLEANUP_tftpd
-#undef FOR_tftpd
-#undef FLAG_l
-#undef FLAG_u
-#undef FLAG_c
-#undef FLAG_r
-#endif
-
-// time <1^pv
-#undef OPTSTR_time
-#define OPTSTR_time "<1^pv"
-#ifdef CLEANUP_time
-#undef CLEANUP_time
-#undef FOR_time
-#undef FLAG_v
-#undef FLAG_p
-#endif
-
-// timeout <2^(foreground)(preserve-status)vk:s(signal): <2^(foreground)(preserve-status)vk:s(signal):
-#undef OPTSTR_timeout
-#define OPTSTR_timeout "<2^(foreground)(preserve-status)vk:s(signal):"
-#ifdef CLEANUP_timeout
-#undef CLEANUP_timeout
-#undef FOR_timeout
-#undef FLAG_s
-#undef FLAG_k
-#undef FLAG_v
-#undef FLAG_preserve_status
-#undef FLAG_foreground
-#endif
-
-// top >0O*Hk*o*p*u*s#<1d%<100=3000m#n#<1bq[!oO]
-#undef OPTSTR_top
-#define OPTSTR_top ">0O*Hk*o*p*u*s#<1d%<100=3000m#n#<1bq[!oO]"
-#ifdef CLEANUP_top
-#undef CLEANUP_top
-#undef FOR_top
-#undef FLAG_q
-#undef FLAG_b
-#undef FLAG_n
-#undef FLAG_m
-#undef FLAG_d
-#undef FLAG_s
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_o
-#undef FLAG_k
-#undef FLAG_H
-#undef FLAG_O
-#endif
-
-// touch <1acd:fmr:t:h[!dtr] <1acd:fmr:t:h[!dtr]
-#undef OPTSTR_touch
-#define OPTSTR_touch "<1acd:fmr:t:h[!dtr]"
-#ifdef CLEANUP_touch
-#undef CLEANUP_touch
-#undef FOR_touch
-#undef FLAG_h
-#undef FLAG_t
-#undef FLAG_r
-#undef FLAG_m
-#undef FLAG_f
-#undef FLAG_d
-#undef FLAG_c
-#undef FLAG_a
-#endif
-
-// toybox
-#undef OPTSTR_toybox
-#define OPTSTR_toybox 0
-#ifdef CLEANUP_toybox
-#undef CLEANUP_toybox
-#undef FOR_toybox
-#endif
-
-// tr ^>2<1Ccsd[+cC] ^>2<1Ccsd[+cC]
-#undef OPTSTR_tr
-#define OPTSTR_tr "^>2<1Ccsd[+cC]"
-#ifdef CLEANUP_tr
-#undef CLEANUP_tr
-#undef FOR_tr
-#undef FLAG_d
-#undef FLAG_s
-#undef FLAG_c
-#undef FLAG_C
-#endif
-
-// traceroute <1>2i:f#<1>255=1z#<0>86400=0g*w#<0>86400=5t#<0>255=0s:q#<1>255=3p#<1>65535=33434m#<1>255=30rvndlIUF64
-#undef OPTSTR_traceroute
-#define OPTSTR_traceroute "<1>2i:f#<1>255=1z#<0>86400=0g*w#<0>86400=5t#<0>255=0s:q#<1>255=3p#<1>65535=33434m#<1>255=30rvndlIUF64"
-#ifdef CLEANUP_traceroute
-#undef CLEANUP_traceroute
-#undef FOR_traceroute
-#undef FLAG_4
-#undef FLAG_6
-#undef FLAG_F
-#undef FLAG_U
-#undef FLAG_I
-#undef FLAG_l
-#undef FLAG_d
-#undef FLAG_n
-#undef FLAG_v
-#undef FLAG_r
-#undef FLAG_m
-#undef FLAG_p
-#undef FLAG_q
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_w
-#undef FLAG_g
-#undef FLAG_z
-#undef FLAG_f
-#undef FLAG_i
-#endif
-
-// true
-#undef OPTSTR_true
-#define OPTSTR_true 0
-#ifdef CLEANUP_true
-#undef CLEANUP_true
-#undef FOR_true
-#endif
-
-// truncate <1s:|c <1s:|c
-#undef OPTSTR_truncate
-#define OPTSTR_truncate "<1s:|c"
-#ifdef CLEANUP_truncate
-#undef CLEANUP_truncate
-#undef FOR_truncate
-#undef FLAG_c
-#undef FLAG_s
-#endif
-
-// tty s
-#undef OPTSTR_tty
-#define OPTSTR_tty "s"
-#ifdef CLEANUP_tty
-#undef CLEANUP_tty
-#undef FOR_tty
-#undef FLAG_s
-#endif
-
-// tunctl <1>1t|d|u:T[!td]
-#undef OPTSTR_tunctl
-#define OPTSTR_tunctl "<1>1t|d|u:T[!td]"
-#ifdef CLEANUP_tunctl
-#undef CLEANUP_tunctl
-#undef FOR_tunctl
-#undef FLAG_T
-#undef FLAG_u
-#undef FLAG_d
-#undef FLAG_t
-#endif
-
-// ulimit >1P#<1SHavutsrRqpnmlifedc[-SH][!apvutsrRqnmlifedc]
-#undef OPTSTR_ulimit
-#define OPTSTR_ulimit ">1P#<1SHavutsrRqpnmlifedc[-SH][!apvutsrRqnmlifedc]"
-#ifdef CLEANUP_ulimit
-#undef CLEANUP_ulimit
-#undef FOR_ulimit
-#undef FLAG_c
-#undef FLAG_d
-#undef FLAG_e
-#undef FLAG_f
-#undef FLAG_i
-#undef FLAG_l
-#undef FLAG_m
-#undef FLAG_n
-#undef FLAG_p
-#undef FLAG_q
-#undef FLAG_R
-#undef FLAG_r
-#undef FLAG_s
-#undef FLAG_t
-#undef FLAG_u
-#undef FLAG_v
-#undef FLAG_a
-#undef FLAG_H
-#undef FLAG_S
-#undef FLAG_P
-#endif
-
-// umount cndDflrat*v[!na]
-#undef OPTSTR_umount
-#define OPTSTR_umount "cndDflrat*v[!na]"
-#ifdef CLEANUP_umount
-#undef CLEANUP_umount
-#undef FOR_umount
-#undef FLAG_v
-#undef FLAG_t
-#undef FLAG_a
-#undef FLAG_r
-#undef FLAG_l
-#undef FLAG_f
-#undef FLAG_D
-#undef FLAG_d
-#undef FLAG_n
-#undef FLAG_c
-#endif
-
-// uname oamvrns[+os] oamvrns[+os]
-#undef OPTSTR_uname
-#define OPTSTR_uname "oamvrns[+os]"
-#ifdef CLEANUP_uname
-#undef CLEANUP_uname
-#undef FOR_uname
-#undef FLAG_s
-#undef FLAG_n
-#undef FLAG_r
-#undef FLAG_v
-#undef FLAG_m
-#undef FLAG_a
-#undef FLAG_o
-#endif
-
-// uniq f#s#w#zicdu f#s#w#zicdu
-#undef OPTSTR_uniq
-#define OPTSTR_uniq "f#s#w#zicdu"
-#ifdef CLEANUP_uniq
-#undef CLEANUP_uniq
-#undef FOR_uniq
-#undef FLAG_u
-#undef FLAG_d
-#undef FLAG_c
-#undef FLAG_i
-#undef FLAG_z
-#undef FLAG_w
-#undef FLAG_s
-#undef FLAG_f
-#endif
-
-// unix2dos
-#undef OPTSTR_unix2dos
-#define OPTSTR_unix2dos 0
-#ifdef CLEANUP_unix2dos
-#undef CLEANUP_unix2dos
-#undef FOR_unix2dos
-#endif
-
-// unlink <1>1
-#undef OPTSTR_unlink
-#define OPTSTR_unlink "<1>1"
-#ifdef CLEANUP_unlink
-#undef CLEANUP_unlink
-#undef FOR_unlink
-#endif
-
-// unshare <1^f(fork);r(map-root-user);i:(ipc);m:(mount);n:(net);p:(pid);u:(uts);U:(user);
-#undef OPTSTR_unshare
-#define OPTSTR_unshare "<1^f(fork);r(map-root-user);i:(ipc);m:(mount);n:(net);p:(pid);u:(uts);U:(user);"
-#ifdef CLEANUP_unshare
-#undef CLEANUP_unshare
-#undef FOR_unshare
-#undef FLAG_U
-#undef FLAG_u
-#undef FLAG_p
-#undef FLAG_n
-#undef FLAG_m
-#undef FLAG_i
-#undef FLAG_r
-#undef FLAG_f
-#endif
-
-// uptime >0ps
-#undef OPTSTR_uptime
-#define OPTSTR_uptime ">0ps"
-#ifdef CLEANUP_uptime
-#undef CLEANUP_uptime
-#undef FOR_uptime
-#undef FLAG_s
-#undef FLAG_p
-#endif
-
-// useradd <1>2u#<0G:s:g:h:SDH
-#undef OPTSTR_useradd
-#define OPTSTR_useradd "<1>2u#<0G:s:g:h:SDH"
-#ifdef CLEANUP_useradd
-#undef CLEANUP_useradd
-#undef FOR_useradd
-#undef FLAG_H
-#undef FLAG_D
-#undef FLAG_S
-#undef FLAG_h
-#undef FLAG_g
-#undef FLAG_s
-#undef FLAG_G
-#undef FLAG_u
-#endif
-
-// userdel <1>1r
-#undef OPTSTR_userdel
-#define OPTSTR_userdel "<1>1r"
-#ifdef CLEANUP_userdel
-#undef CLEANUP_userdel
-#undef FOR_userdel
-#undef FLAG_r
-#endif
-
-// usleep <1
-#undef OPTSTR_usleep
-#define OPTSTR_usleep "<1"
-#ifdef CLEANUP_usleep
-#undef CLEANUP_usleep
-#undef FOR_usleep
-#endif
-
-// uudecode >1o:
-#undef OPTSTR_uudecode
-#define OPTSTR_uudecode ">1o:"
-#ifdef CLEANUP_uudecode
-#undef CLEANUP_uudecode
-#undef FOR_uudecode
-#undef FLAG_o
-#endif
-
-// uuencode <1>2m
-#undef OPTSTR_uuencode
-#define OPTSTR_uuencode "<1>2m"
-#ifdef CLEANUP_uuencode
-#undef CLEANUP_uuencode
-#undef FOR_uuencode
-#undef FLAG_m
-#endif
-
-// uuidgen >0r(random)
-#undef OPTSTR_uuidgen
-#define OPTSTR_uuidgen ">0r(random)"
-#ifdef CLEANUP_uuidgen
-#undef CLEANUP_uuidgen
-#undef FOR_uuidgen
-#undef FLAG_r
-#endif
-
-// vconfig <2>4
-#undef OPTSTR_vconfig
-#define OPTSTR_vconfig "<2>4"
-#ifdef CLEANUP_vconfig
-#undef CLEANUP_vconfig
-#undef FOR_vconfig
-#endif
-
-// vi <1>1
-#undef OPTSTR_vi
-#define OPTSTR_vi "<1>1"
-#ifdef CLEANUP_vi
-#undef CLEANUP_vi
-#undef FOR_vi
-#endif
-
-// vmstat >2n
-#undef OPTSTR_vmstat
-#define OPTSTR_vmstat ">2n"
-#ifdef CLEANUP_vmstat
-#undef CLEANUP_vmstat
-#undef FOR_vmstat
-#undef FLAG_n
-#endif
-
-// w
-#undef OPTSTR_w
-#define OPTSTR_w 0
-#ifdef CLEANUP_w
-#undef CLEANUP_w
-#undef FOR_w
-#endif
-
-// watch ^<1n%<100=2000tebx
-#undef OPTSTR_watch
-#define OPTSTR_watch "^<1n%<100=2000tebx"
-#ifdef CLEANUP_watch
-#undef CLEANUP_watch
-#undef FOR_watch
-#undef FLAG_x
-#undef FLAG_b
-#undef FLAG_e
-#undef FLAG_t
-#undef FLAG_n
-#endif
-
-// wc mcwl mcwl
-#undef OPTSTR_wc
-#define OPTSTR_wc "mcwl"
-#ifdef CLEANUP_wc
-#undef CLEANUP_wc
-#undef FOR_wc
-#undef FLAG_l
-#undef FLAG_w
-#undef FLAG_c
-#undef FLAG_m
-#endif
-
-// wget (no-check-certificate)O:
-#undef OPTSTR_wget
-#define OPTSTR_wget "(no-check-certificate)O:"
-#ifdef CLEANUP_wget
-#undef CLEANUP_wget
-#undef FOR_wget
-#undef FLAG_O
-#undef FLAG_no_check_certificate
-#endif
-
-// which <1a <1a
-#undef OPTSTR_which
-#define OPTSTR_which "<1a"
-#ifdef CLEANUP_which
-#undef CLEANUP_which
-#undef FOR_which
-#undef FLAG_a
-#endif
-
-// who a
-#undef OPTSTR_who
-#define OPTSTR_who "a"
-#ifdef CLEANUP_who
-#undef CLEANUP_who
-#undef FOR_who
-#undef FLAG_a
-#endif
-
-// 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:P#optrn#<1(max-args)s#0[!0E]"
-#ifdef CLEANUP_xargs
-#undef CLEANUP_xargs
-#undef FOR_xargs
-#undef FLAG_0
-#undef FLAG_s
-#undef FLAG_n
-#undef FLAG_r
-#undef FLAG_t
-#undef FLAG_p
-#undef FLAG_o
-#undef FLAG_P
-#undef FLAG_E
-#endif
-
-// xxd >1c#l#o#g#<1=2iprs#[!rs] >1c#l#o#g#<1=2iprs#[!rs]
-#undef OPTSTR_xxd
-#define OPTSTR_xxd ">1c#l#o#g#<1=2iprs#[!rs]"
-#ifdef CLEANUP_xxd
-#undef CLEANUP_xxd
-#undef FOR_xxd
-#undef FLAG_s
-#undef FLAG_r
-#undef FLAG_p
-#undef FLAG_i
-#undef FLAG_g
-#undef FLAG_o
-#undef FLAG_l
-#undef FLAG_c
-#endif
-
-// xzcat
-#undef OPTSTR_xzcat
-#define OPTSTR_xzcat 0
-#ifdef CLEANUP_xzcat
-#undef CLEANUP_xzcat
-#undef FOR_xzcat
-#endif
-
-// yes
-#undef OPTSTR_yes
-#define OPTSTR_yes 0
-#ifdef CLEANUP_yes
-#undef CLEANUP_yes
-#undef FOR_yes
-#endif
-
-// zcat cdfk123456789[-123456789]
-#undef OPTSTR_zcat
-#define OPTSTR_zcat "cdfk123456789[-123456789]"
-#ifdef CLEANUP_zcat
-#undef CLEANUP_zcat
-#undef FOR_zcat
-#undef FLAG_9
-#undef FLAG_8
-#undef FLAG_7
-#undef FLAG_6
-#undef FLAG_5
-#undef FLAG_4
-#undef FLAG_3
-#undef FLAG_2
-#undef FLAG_1
-#undef FLAG_k
-#undef FLAG_f
-#undef FLAG_d
-#undef FLAG_c
-#endif
-
-#ifdef FOR_acpi
-#ifndef TT
-#define TT this.acpi
-#endif
-#define FLAG_V (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_b (FORCED_FLAG<<3)
-#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
-#endif
-#define FLAG_H (FORCED_FLAG<<0)
-#define FLAG_A (FORCED_FLAG<<1)
-#define FLAG_p (FORCED_FLAG<<2)
-#define FLAG_a (FORCED_FLAG<<3)
-#define FLAG_d (FORCED_FLAG<<4)
-#define FLAG_s (FORCED_FLAG<<5)
-#define FLAG_D (FORCED_FLAG<<6)
-#define FLAG_n (FORCED_FLAG<<7)
-#define FLAG_i (FORCED_FLAG<<8)
-#define FLAG_v (FORCED_FLAG<<9)
-#endif
-
-#ifdef FOR_arping
-#ifndef TT
-#define TT this.arping
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_q (FORCED_FLAG<<1)
-#define FLAG_b (FORCED_FLAG<<2)
-#define FLAG_D (FORCED_FLAG<<3)
-#define FLAG_U (FORCED_FLAG<<4)
-#define FLAG_A (FORCED_FLAG<<5)
-#define FLAG_c (FORCED_FLAG<<6)
-#define FLAG_w (FORCED_FLAG<<7)
-#define FLAG_I (FORCED_FLAG<<8)
-#define FLAG_s (FORCED_FLAG<<9)
-#endif
-
-#ifdef FOR_ascii
-#ifndef TT
-#define TT this.ascii
-#endif
-#endif
-
-#ifdef FOR_base64
-#ifndef TT
-#define TT this.base64
-#endif
-#define FLAG_w (FORCED_FLAG<<0)
-#define FLAG_i (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_basename
-#ifndef TT
-#define TT this.basename
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_a (1<<1)
-#endif
-
-#ifdef FOR_bc
-#ifndef TT
-#define TT this.bc
-#endif
-#define FLAG_w (1<<0)
-#define FLAG_s (1<<1)
-#define FLAG_q (1<<2)
-#define FLAG_l (1<<3)
-#define FLAG_i (1<<4)
-#endif
-
-#ifdef FOR_blkid
-#ifndef TT
-#define TT this.blkid
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_L (FORCED_FLAG<<1)
-#define FLAG_U (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_blockdev
-#ifndef TT
-#define TT this.blockdev
-#endif
-#define FLAG_rereadpt (FORCED_FLAG<<0)
-#define FLAG_flushbufs (FORCED_FLAG<<1)
-#define FLAG_setra (FORCED_FLAG<<2)
-#define FLAG_getra (FORCED_FLAG<<3)
-#define FLAG_getsize64 (FORCED_FLAG<<4)
-#define FLAG_getsize (FORCED_FLAG<<5)
-#define FLAG_getsz (FORCED_FLAG<<6)
-#define FLAG_setbsz (FORCED_FLAG<<7)
-#define FLAG_getbsz (FORCED_FLAG<<8)
-#define FLAG_getss (FORCED_FLAG<<9)
-#define FLAG_getro (FORCED_FLAG<<10)
-#define FLAG_setrw (FORCED_FLAG<<11)
-#define FLAG_setro (FORCED_FLAG<<12)
-#endif
-
-#ifdef FOR_bootchartd
-#ifndef TT
-#define TT this.bootchartd
-#endif
-#endif
-
-#ifdef FOR_brctl
-#ifndef TT
-#define TT this.brctl
-#endif
-#endif
-
-#ifdef FOR_bunzip2
-#ifndef TT
-#define TT this.bunzip2
-#endif
-#define FLAG_v (FORCED_FLAG<<0)
-#define FLAG_k (FORCED_FLAG<<1)
-#define FLAG_t (FORCED_FLAG<<2)
-#define FLAG_f (FORCED_FLAG<<3)
-#define FLAG_c (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_bzcat
-#ifndef TT
-#define TT this.bzcat
-#endif
-#endif
-
-#ifdef FOR_cal
-#ifndef TT
-#define TT this.cal
-#endif
-#endif
-
-#ifdef FOR_cat
-#ifndef TT
-#define TT this.cat
-#endif
-#define FLAG_e (1<<0)
-#define FLAG_t (1<<1)
-#define FLAG_v (1<<2)
-#define FLAG_u (1<<3)
-#endif
-
-#ifdef FOR_catv
-#ifndef TT
-#define TT this.catv
-#endif
-#define FLAG_e (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_v (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_cd
-#ifndef TT
-#define TT this.cd
-#endif
-#endif
-
-#ifdef FOR_chattr
-#ifndef TT
-#define TT this.chattr
-#endif
-#endif
-
-#ifdef FOR_chcon
-#ifndef TT
-#define TT this.chcon
-#endif
-#define FLAG_R (FORCED_FLAG<<0)
-#define FLAG_v (FORCED_FLAG<<1)
-#define FLAG_h (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_chgrp
-#ifndef TT
-#define TT this.chgrp
-#endif
-#define FLAG_v (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#define FLAG_R (FORCED_FLAG<<2)
-#define FLAG_H (FORCED_FLAG<<3)
-#define FLAG_L (FORCED_FLAG<<4)
-#define FLAG_P (FORCED_FLAG<<5)
-#define FLAG_h (FORCED_FLAG<<6)
-#endif
-
-#ifdef FOR_chmod
-#ifndef TT
-#define TT this.chmod
-#endif
-#define FLAG_f (1<<0)
-#define FLAG_R (1<<1)
-#define FLAG_v (1<<2)
-#endif
-
-#ifdef FOR_chroot
-#ifndef TT
-#define TT this.chroot
-#endif
-#endif
-
-#ifdef FOR_chrt
-#ifndef TT
-#define TT this.chrt
-#endif
-#define FLAG_o (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#define FLAG_r (FORCED_FLAG<<2)
-#define FLAG_b (FORCED_FLAG<<3)
-#define FLAG_R (FORCED_FLAG<<4)
-#define FLAG_i (FORCED_FLAG<<5)
-#define FLAG_p (FORCED_FLAG<<6)
-#define FLAG_m (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_chvt
-#ifndef TT
-#define TT this.chvt
-#endif
-#endif
-
-#ifdef FOR_cksum
-#ifndef TT
-#define TT this.cksum
-#endif
-#define FLAG_N (FORCED_FLAG<<0)
-#define FLAG_L (FORCED_FLAG<<1)
-#define FLAG_P (FORCED_FLAG<<2)
-#define FLAG_I (FORCED_FLAG<<3)
-#define FLAG_H (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_clear
-#ifndef TT
-#define TT this.clear
-#endif
-#endif
-
-#ifdef FOR_cmp
-#ifndef TT
-#define TT this.cmp
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_l (1<<1)
-#endif
-
-#ifdef FOR_comm
-#ifndef TT
-#define TT this.comm
-#endif
-#define FLAG_1 (1<<0)
-#define FLAG_2 (1<<1)
-#define FLAG_3 (1<<2)
-#endif
-
-#ifdef FOR_count
-#ifndef TT
-#define TT this.count
-#endif
-#endif
-
-#ifdef FOR_cp
-#ifndef TT
-#define TT this.cp
-#endif
-#define FLAG_i (1<<0)
-#define FLAG_f (1<<1)
-#define FLAG_F (1<<2)
-#define FLAG_n (1<<3)
-#define FLAG_v (1<<4)
-#define FLAG_l (1<<5)
-#define FLAG_s (1<<6)
-#define FLAG_a (1<<7)
-#define FLAG_d (1<<8)
-#define FLAG_r (1<<9)
-#define FLAG_p (1<<10)
-#define FLAG_P (1<<11)
-#define FLAG_L (1<<12)
-#define FLAG_H (1<<13)
-#define FLAG_R (1<<14)
-#define FLAG_D (1<<15)
-#define FLAG_preserve (1<<16)
-#endif
-
-#ifdef FOR_cpio
-#ifndef TT
-#define TT this.cpio
-#endif
-#define FLAG_o (FORCED_FLAG<<0)
-#define FLAG_v (FORCED_FLAG<<1)
-#define FLAG_F (FORCED_FLAG<<2)
-#define FLAG_t (FORCED_FLAG<<3)
-#define FLAG_i (FORCED_FLAG<<4)
-#define FLAG_p (FORCED_FLAG<<5)
-#define FLAG_H (FORCED_FLAG<<6)
-#define FLAG_u (FORCED_FLAG<<7)
-#define FLAG_d (FORCED_FLAG<<8)
-#define FLAG_m (FORCED_FLAG<<9)
-#define FLAG_trailer (FORCED_FLAG<<10)
-#define FLAG_no_preserve_owner (FORCED_FLAG<<11)
-#endif
-
-#ifdef FOR_crc32
-#ifndef TT
-#define TT this.crc32
-#endif
-#endif
-
-#ifdef FOR_crond
-#ifndef TT
-#define TT this.crond
-#endif
-#define FLAG_c (FORCED_FLAG<<0)
-#define FLAG_L (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_l (FORCED_FLAG<<3)
-#define FLAG_S (FORCED_FLAG<<4)
-#define FLAG_b (FORCED_FLAG<<5)
-#define FLAG_f (FORCED_FLAG<<6)
-#endif
-
-#ifdef FOR_crontab
-#ifndef TT
-#define TT this.crontab
-#endif
-#define FLAG_r (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#define FLAG_e (FORCED_FLAG<<2)
-#define FLAG_u (FORCED_FLAG<<3)
-#define FLAG_c (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_cut
-#ifndef TT
-#define TT this.cut
-#endif
-#define FLAG_n (1<<0)
-#define FLAG_D (1<<1)
-#define FLAG_s (1<<2)
-#define FLAG_d (1<<3)
-#define FLAG_O (1<<4)
-#define FLAG_C (1<<5)
-#define FLAG_F (1<<6)
-#define FLAG_f (1<<7)
-#define FLAG_c (1<<8)
-#define FLAG_b (1<<9)
-#endif
-
-#ifdef FOR_date
-#ifndef TT
-#define TT this.date
-#endif
-#define FLAG_u (1<<0)
-#define FLAG_r (1<<1)
-#define FLAG_D (1<<2)
-#define FLAG_d (1<<3)
-#endif
-
-#ifdef FOR_dd
-#ifndef TT
-#define TT this.dd
-#endif
-#endif
-
-#ifdef FOR_deallocvt
-#ifndef TT
-#define TT this.deallocvt
-#endif
-#endif
-
-#ifdef FOR_demo_many_options
-#ifndef TT
-#define TT this.demo_many_options
-#endif
-#define FLAG_a (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_d (FORCED_FLAG<<3)
-#define FLAG_e (FORCED_FLAG<<4)
-#define FLAG_f (FORCED_FLAG<<5)
-#define FLAG_g (FORCED_FLAG<<6)
-#define FLAG_h (FORCED_FLAG<<7)
-#define FLAG_i (FORCED_FLAG<<8)
-#define FLAG_j (FORCED_FLAG<<9)
-#define FLAG_k (FORCED_FLAG<<10)
-#define FLAG_l (FORCED_FLAG<<11)
-#define FLAG_m (FORCED_FLAG<<12)
-#define FLAG_n (FORCED_FLAG<<13)
-#define FLAG_o (FORCED_FLAG<<14)
-#define FLAG_p (FORCED_FLAG<<15)
-#define FLAG_q (FORCED_FLAG<<16)
-#define FLAG_r (FORCED_FLAG<<17)
-#define FLAG_s (FORCED_FLAG<<18)
-#define FLAG_t (FORCED_FLAG<<19)
-#define FLAG_u (FORCED_FLAG<<20)
-#define FLAG_v (FORCED_FLAG<<21)
-#define FLAG_w (FORCED_FLAG<<22)
-#define FLAG_x (FORCED_FLAG<<23)
-#define FLAG_y (FORCED_FLAG<<24)
-#define FLAG_z (FORCED_FLAG<<25)
-#define FLAG_A (FORCED_FLAG<<26)
-#define FLAG_B (FORCED_FLAG<<27)
-#define FLAG_C (FORCED_FLAG<<28)
-#define FLAG_D (FORCED_FLAG<<29)
-#define FLAG_E (FORCED_FLAG<<30)
-#define FLAG_F (FORCED_FLAG<<31)
-#define FLAG_G (FORCED_FLAGLL<<32)
-#define FLAG_H (FORCED_FLAGLL<<33)
-#define FLAG_I (FORCED_FLAGLL<<34)
-#define FLAG_J (FORCED_FLAGLL<<35)
-#define FLAG_K (FORCED_FLAGLL<<36)
-#define FLAG_L (FORCED_FLAGLL<<37)
-#define FLAG_M (FORCED_FLAGLL<<38)
-#define FLAG_N (FORCED_FLAGLL<<39)
-#define FLAG_O (FORCED_FLAGLL<<40)
-#define FLAG_P (FORCED_FLAGLL<<41)
-#define FLAG_Q (FORCED_FLAGLL<<42)
-#define FLAG_R (FORCED_FLAGLL<<43)
-#define FLAG_S (FORCED_FLAGLL<<44)
-#define FLAG_T (FORCED_FLAGLL<<45)
-#define FLAG_U (FORCED_FLAGLL<<46)
-#define FLAG_V (FORCED_FLAGLL<<47)
-#define FLAG_W (FORCED_FLAGLL<<48)
-#define FLAG_X (FORCED_FLAGLL<<49)
-#define FLAG_Y (FORCED_FLAGLL<<50)
-#define FLAG_Z (FORCED_FLAGLL<<51)
-#endif
-
-#ifdef FOR_demo_number
-#ifndef TT
-#define TT this.demo_number
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_h (FORCED_FLAG<<3)
-#define FLAG_D (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_demo_scankey
-#ifndef TT
-#define TT this.demo_scankey
-#endif
-#endif
-
-#ifdef FOR_demo_utf8towc
-#ifndef TT
-#define TT this.demo_utf8towc
-#endif
-#endif
-
-#ifdef FOR_devmem
-#ifndef TT
-#define TT this.devmem
-#endif
-#endif
-
-#ifdef FOR_df
-#ifndef TT
-#define TT this.df
-#endif
-#define FLAG_a (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_i (FORCED_FLAG<<2)
-#define FLAG_h (FORCED_FLAG<<3)
-#define FLAG_k (FORCED_FLAG<<4)
-#define FLAG_P (FORCED_FLAG<<5)
-#define FLAG_H (FORCED_FLAG<<6)
-#endif
-
-#ifdef FOR_dhcp
-#ifndef TT
-#define TT this.dhcp
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_q (FORCED_FLAG<<3)
-#define FLAG_v (FORCED_FLAG<<4)
-#define FLAG_o (FORCED_FLAG<<5)
-#define FLAG_a (FORCED_FLAG<<6)
-#define FLAG_C (FORCED_FLAG<<7)
-#define FLAG_R (FORCED_FLAG<<8)
-#define FLAG_B (FORCED_FLAG<<9)
-#define FLAG_S (FORCED_FLAG<<10)
-#define FLAG_i (FORCED_FLAG<<11)
-#define FLAG_p (FORCED_FLAG<<12)
-#define FLAG_s (FORCED_FLAG<<13)
-#define FLAG_t (FORCED_FLAG<<14)
-#define FLAG_T (FORCED_FLAG<<15)
-#define FLAG_A (FORCED_FLAG<<16)
-#define FLAG_O (FORCED_FLAG<<17)
-#define FLAG_r (FORCED_FLAG<<18)
-#define FLAG_x (FORCED_FLAG<<19)
-#define FLAG_F (FORCED_FLAG<<20)
-#define FLAG_H (FORCED_FLAG<<21)
-#define FLAG_V (FORCED_FLAG<<22)
-#endif
-
-#ifdef FOR_dhcp6
-#ifndef TT
-#define TT this.dhcp6
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_q (FORCED_FLAG<<3)
-#define FLAG_v (FORCED_FLAG<<4)
-#define FLAG_R (FORCED_FLAG<<5)
-#define FLAG_S (FORCED_FLAG<<6)
-#define FLAG_i (FORCED_FLAG<<7)
-#define FLAG_p (FORCED_FLAG<<8)
-#define FLAG_s (FORCED_FLAG<<9)
-#define FLAG_t (FORCED_FLAG<<10)
-#define FLAG_T (FORCED_FLAG<<11)
-#define FLAG_A (FORCED_FLAG<<12)
-#define FLAG_r (FORCED_FLAG<<13)
-#endif
-
-#ifdef FOR_dhcpd
-#ifndef TT
-#define TT this.dhcpd
-#endif
-#define FLAG_6 (FORCED_FLAG<<0)
-#define FLAG_4 (FORCED_FLAG<<1)
-#define FLAG_S (FORCED_FLAG<<2)
-#define FLAG_i (FORCED_FLAG<<3)
-#define FLAG_f (FORCED_FLAG<<4)
-#define FLAG_P (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_diff
-#ifndef TT
-#define TT this.diff
-#endif
-#define FLAG_U (1<<0)
-#define FLAG_r (1<<1)
-#define FLAG_N (1<<2)
-#define FLAG_S (1<<3)
-#define FLAG_L (1<<4)
-#define FLAG_a (1<<5)
-#define FLAG_q (1<<6)
-#define FLAG_s (1<<7)
-#define FLAG_T (1<<8)
-#define FLAG_i (1<<9)
-#define FLAG_w (1<<10)
-#define FLAG_t (1<<11)
-#define FLAG_u (1<<12)
-#define FLAG_b (1<<13)
-#define FLAG_d (1<<14)
-#define FLAG_B (1<<15)
-#define FLAG_strip_trailing_cr (1<<16)
-#define FLAG_color (1<<17)
-#endif
-
-#ifdef FOR_dirname
-#ifndef TT
-#define TT this.dirname
-#endif
-#endif
-
-#ifdef FOR_dmesg
-#ifndef TT
-#define TT this.dmesg
-#endif
-#define FLAG_c (FORCED_FLAG<<0)
-#define FLAG_n (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#define FLAG_r (FORCED_FLAG<<3)
-#define FLAG_t (FORCED_FLAG<<4)
-#define FLAG_T (FORCED_FLAG<<5)
-#define FLAG_S (FORCED_FLAG<<6)
-#define FLAG_C (FORCED_FLAG<<7)
-#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
-#endif
-#endif
-
-#ifdef FOR_du
-#ifndef TT
-#define TT this.du
-#endif
-#define FLAG_x (1<<0)
-#define FLAG_s (1<<1)
-#define FLAG_L (1<<2)
-#define FLAG_K (1<<3)
-#define FLAG_k (1<<4)
-#define FLAG_H (1<<5)
-#define FLAG_a (1<<6)
-#define FLAG_c (1<<7)
-#define FLAG_l (1<<8)
-#define FLAG_m (1<<9)
-#define FLAG_h (1<<10)
-#define FLAG_d (1<<11)
-#endif
-
-#ifdef FOR_dumpleases
-#ifndef TT
-#define TT this.dumpleases
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_r (FORCED_FLAG<<1)
-#define FLAG_a (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_echo
-#ifndef TT
-#define TT this.echo
-#endif
-#define FLAG_n (1<<0)
-#define FLAG_e (1<<1)
-#define FLAG_E (1<<2)
-#endif
-
-#ifdef FOR_eject
-#ifndef TT
-#define TT this.eject
-#endif
-#define FLAG_T (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_env
-#ifndef TT
-#define TT this.env
-#endif
-#define FLAG_u (1<<0)
-#define FLAG_i (1<<1)
-#define FLAG_0 (1<<2)
-#endif
-
-#ifdef FOR_exit
-#ifndef TT
-#define TT this.exit
-#endif
-#endif
-
-#ifdef FOR_expand
-#ifndef TT
-#define TT this.expand
-#endif
-#define FLAG_t (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_expr
-#ifndef TT
-#define TT this.expr
-#endif
-#endif
-
-#ifdef FOR_factor
-#ifndef TT
-#define TT this.factor
-#endif
-#endif
-
-#ifdef FOR_fallocate
-#ifndef TT
-#define TT this.fallocate
-#endif
-#define FLAG_o (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_false
-#ifndef TT
-#define TT this.false
-#endif
-#endif
-
-#ifdef FOR_fdisk
-#ifndef TT
-#define TT this.fdisk
-#endif
-#define FLAG_l (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_b (FORCED_FLAG<<2)
-#define FLAG_S (FORCED_FLAG<<3)
-#define FLAG_H (FORCED_FLAG<<4)
-#define FLAG_C (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_file
-#ifndef TT
-#define TT this.file
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_L (FORCED_FLAG<<1)
-#define FLAG_h (FORCED_FLAG<<2)
-#define FLAG_b (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_find
-#ifndef TT
-#define TT this.find
-#endif
-#define FLAG_L (1<<0)
-#define FLAG_H (1<<1)
-#endif
-
-#ifdef FOR_flock
-#ifndef TT
-#define TT this.flock
-#endif
-#define FLAG_x (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_fmt
-#ifndef TT
-#define TT this.fmt
-#endif
-#define FLAG_w (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_fold
-#ifndef TT
-#define TT this.fold
-#endif
-#define FLAG_w (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#define FLAG_b (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_free
-#ifndef TT
-#define TT this.free
-#endif
-#define FLAG_b (FORCED_FLAG<<0)
-#define FLAG_k (FORCED_FLAG<<1)
-#define FLAG_m (FORCED_FLAG<<2)
-#define FLAG_g (FORCED_FLAG<<3)
-#define FLAG_t (FORCED_FLAG<<4)
-#define FLAG_h (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_freeramdisk
-#ifndef TT
-#define TT this.freeramdisk
-#endif
-#endif
-
-#ifdef FOR_fsck
-#ifndef TT
-#define TT this.fsck
-#endif
-#define FLAG_C (FORCED_FLAG<<0)
-#define FLAG_s (FORCED_FLAG<<1)
-#define FLAG_V (FORCED_FLAG<<2)
-#define FLAG_T (FORCED_FLAG<<3)
-#define FLAG_R (FORCED_FLAG<<4)
-#define FLAG_P (FORCED_FLAG<<5)
-#define FLAG_N (FORCED_FLAG<<6)
-#define FLAG_A (FORCED_FLAG<<7)
-#define FLAG_t (FORCED_FLAG<<8)
-#endif
-
-#ifdef FOR_fsfreeze
-#ifndef TT
-#define TT this.fsfreeze
-#endif
-#define FLAG_u (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_fstype
-#ifndef TT
-#define TT this.fstype
-#endif
-#endif
-
-#ifdef FOR_fsync
-#ifndef TT
-#define TT this.fsync
-#endif
-#define FLAG_d (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_ftpget
-#ifndef TT
-#define TT this.ftpget
-#endif
-#define FLAG_D (FORCED_FLAG<<0)
-#define FLAG_d (FORCED_FLAG<<1)
-#define FLAG_M (FORCED_FLAG<<2)
-#define FLAG_m (FORCED_FLAG<<3)
-#define FLAG_L (FORCED_FLAG<<4)
-#define FLAG_l (FORCED_FLAG<<5)
-#define FLAG_s (FORCED_FLAG<<6)
-#define FLAG_g (FORCED_FLAG<<7)
-#define FLAG_v (FORCED_FLAG<<8)
-#define FLAG_u (FORCED_FLAG<<9)
-#define FLAG_p (FORCED_FLAG<<10)
-#define FLAG_c (FORCED_FLAG<<11)
-#define FLAG_P (FORCED_FLAG<<12)
-#endif
-
-#ifdef FOR_getconf
-#ifndef TT
-#define TT this.getconf
-#endif
-#define FLAG_l (1<<0)
-#define FLAG_a (1<<1)
-#endif
-
-#ifdef FOR_getenforce
-#ifndef TT
-#define TT this.getenforce
-#endif
-#endif
-
-#ifdef FOR_getfattr
-#ifndef TT
-#define TT this.getfattr
-#endif
-#define FLAG_n (FORCED_FLAG<<0)
-#define FLAG_h (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_only_values (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_getty
-#ifndef TT
-#define TT this.getty
-#endif
-#define FLAG_h (FORCED_FLAG<<0)
-#define FLAG_L (FORCED_FLAG<<1)
-#define FLAG_m (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#define FLAG_w (FORCED_FLAG<<4)
-#define FLAG_i (FORCED_FLAG<<5)
-#define FLAG_f (FORCED_FLAG<<6)
-#define FLAG_l (FORCED_FLAG<<7)
-#define FLAG_I (FORCED_FLAG<<8)
-#define FLAG_H (FORCED_FLAG<<9)
-#define FLAG_t (FORCED_FLAG<<10)
-#endif
-
-#ifdef FOR_grep
-#ifndef TT
-#define TT this.grep
-#endif
-#define FLAG_x (1<<0)
-#define FLAG_m (1<<1)
-#define FLAG_A (1<<2)
-#define FLAG_B (1<<3)
-#define FLAG_C (1<<4)
-#define FLAG_f (1<<5)
-#define FLAG_e (1<<6)
-#define FLAG_q (1<<7)
-#define FLAG_l (1<<8)
-#define FLAG_c (1<<9)
-#define FLAG_w (1<<10)
-#define FLAG_v (1<<11)
-#define FLAG_s (1<<12)
-#define FLAG_R (1<<13)
-#define FLAG_r (1<<14)
-#define FLAG_o (1<<15)
-#define FLAG_n (1<<16)
-#define FLAG_i (1<<17)
-#define FLAG_h (1<<18)
-#define FLAG_b (1<<19)
-#define FLAG_a (1<<20)
-#define FLAG_I (1<<21)
-#define FLAG_H (1<<22)
-#define FLAG_F (1<<23)
-#define FLAG_E (1<<24)
-#define FLAG_z (1<<25)
-#define FLAG_Z (1<<26)
-#define FLAG_M (1<<27)
-#define FLAG_S (1<<28)
-#define FLAG_exclude_dir (1<<29)
-#define FLAG_color (1<<30)
-#define FLAG_line_buffered (1<<31)
-#endif
-
-#ifdef FOR_groupadd
-#ifndef TT
-#define TT this.groupadd
-#endif
-#define FLAG_S (FORCED_FLAG<<0)
-#define FLAG_g (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_groupdel
-#ifndef TT
-#define TT this.groupdel
-#endif
-#endif
-
-#ifdef FOR_groups
-#ifndef TT
-#define TT this.groups
-#endif
-#endif
-
-#ifdef FOR_gunzip
-#ifndef TT
-#define TT this.gunzip
-#endif
-#define FLAG_9 (FORCED_FLAG<<0)
-#define FLAG_8 (FORCED_FLAG<<1)
-#define FLAG_7 (FORCED_FLAG<<2)
-#define FLAG_6 (FORCED_FLAG<<3)
-#define FLAG_5 (FORCED_FLAG<<4)
-#define FLAG_4 (FORCED_FLAG<<5)
-#define FLAG_3 (FORCED_FLAG<<6)
-#define FLAG_2 (FORCED_FLAG<<7)
-#define FLAG_1 (FORCED_FLAG<<8)
-#define FLAG_k (FORCED_FLAG<<9)
-#define FLAG_f (FORCED_FLAG<<10)
-#define FLAG_d (FORCED_FLAG<<11)
-#define FLAG_c (FORCED_FLAG<<12)
-#endif
-
-#ifdef FOR_gzip
-#ifndef TT
-#define TT this.gzip
-#endif
-#define FLAG_9 (FORCED_FLAG<<0)
-#define FLAG_8 (FORCED_FLAG<<1)
-#define FLAG_7 (FORCED_FLAG<<2)
-#define FLAG_6 (FORCED_FLAG<<3)
-#define FLAG_5 (FORCED_FLAG<<4)
-#define FLAG_4 (FORCED_FLAG<<5)
-#define FLAG_3 (FORCED_FLAG<<6)
-#define FLAG_2 (FORCED_FLAG<<7)
-#define FLAG_1 (FORCED_FLAG<<8)
-#define FLAG_k (FORCED_FLAG<<9)
-#define FLAG_f (FORCED_FLAG<<10)
-#define FLAG_d (FORCED_FLAG<<11)
-#define FLAG_c (FORCED_FLAG<<12)
-#define FLAG_n (FORCED_FLAG<<13)
-#endif
-
-#ifdef FOR_head
-#ifndef TT
-#define TT this.head
-#endif
-#define FLAG_v (1<<0)
-#define FLAG_q (1<<1)
-#define FLAG_c (1<<2)
-#define FLAG_n (1<<3)
-#endif
-
-#ifdef FOR_hello
-#ifndef TT
-#define TT this.hello
-#endif
-#endif
-
-#ifdef FOR_help
-#ifndef TT
-#define TT this.help
-#endif
-#define FLAG_h (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_hexedit
-#ifndef TT
-#define TT this.hexedit
-#endif
-#define FLAG_r (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_host
-#ifndef TT
-#define TT this.host
-#endif
-#define FLAG_t (FORCED_FLAG<<0)
-#define FLAG_v (FORCED_FLAG<<1)
-#define FLAG_a (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_hostid
-#ifndef TT
-#define TT this.hostid
-#endif
-#endif
-
-#ifdef FOR_hostname
-#ifndef TT
-#define TT this.hostname
-#endif
-#define FLAG_F (1<<0)
-#define FLAG_f (1<<1)
-#define FLAG_s (1<<2)
-#define FLAG_d (1<<3)
-#define FLAG_b (1<<4)
-#endif
-
-#ifdef FOR_hwclock
-#ifndef TT
-#define TT this.hwclock
-#endif
-#define FLAG_w (FORCED_FLAG<<0)
-#define FLAG_r (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#define FLAG_t (FORCED_FLAG<<3)
-#define FLAG_l (FORCED_FLAG<<4)
-#define FLAG_u (FORCED_FLAG<<5)
-#define FLAG_f (FORCED_FLAG<<6)
-#define FLAG_fast (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_i2cdetect
-#ifndef TT
-#define TT this.i2cdetect
-#endif
-#define FLAG_y (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#define FLAG_F (FORCED_FLAG<<2)
-#define FLAG_a (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_i2cdump
-#ifndef TT
-#define TT this.i2cdump
-#endif
-#define FLAG_y (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_i2cget
-#ifndef TT
-#define TT this.i2cget
-#endif
-#define FLAG_y (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_i2cset
-#ifndef TT
-#define TT this.i2cset
-#endif
-#define FLAG_y (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_iconv
-#ifndef TT
-#define TT this.iconv
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#define FLAG_c (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_id
-#ifndef TT
-#define TT this.id
-#endif
-#define FLAG_u (1<<0)
-#define FLAG_r (1<<1)
-#define FLAG_g (1<<2)
-#define FLAG_G (1<<3)
-#define FLAG_n (1<<4)
-#define FLAG_Z (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_ifconfig
-#ifndef TT
-#define TT this.ifconfig
-#endif
-#define FLAG_S (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_init
-#ifndef TT
-#define TT this.init
-#endif
-#endif
-
-#ifdef FOR_inotifyd
-#ifndef TT
-#define TT this.inotifyd
-#endif
-#endif
-
-#ifdef FOR_insmod
-#ifndef TT
-#define TT this.insmod
-#endif
-#endif
-
-#ifdef FOR_install
-#ifndef TT
-#define TT this.install
-#endif
-#define FLAG_g (FORCED_FLAG<<0)
-#define FLAG_o (FORCED_FLAG<<1)
-#define FLAG_m (FORCED_FLAG<<2)
-#define FLAG_v (FORCED_FLAG<<3)
-#define FLAG_s (FORCED_FLAG<<4)
-#define FLAG_p (FORCED_FLAG<<5)
-#define FLAG_D (FORCED_FLAG<<6)
-#define FLAG_d (FORCED_FLAG<<7)
-#define FLAG_c (FORCED_FLAG<<8)
-#endif
-
-#ifdef FOR_ionice
-#ifndef TT
-#define TT this.ionice
-#endif
-#define FLAG_p (FORCED_FLAG<<0)
-#define FLAG_n (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_t (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_iorenice
-#ifndef TT
-#define TT this.iorenice
-#endif
-#endif
-
-#ifdef FOR_iotop
-#ifndef TT
-#define TT this.iotop
-#endif
-#define FLAG_q (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_m (FORCED_FLAG<<3)
-#define FLAG_d (FORCED_FLAG<<4)
-#define FLAG_s (FORCED_FLAG<<5)
-#define FLAG_u (FORCED_FLAG<<6)
-#define FLAG_p (FORCED_FLAG<<7)
-#define FLAG_o (FORCED_FLAG<<8)
-#define FLAG_k (FORCED_FLAG<<9)
-#define FLAG_H (FORCED_FLAG<<10)
-#define FLAG_O (FORCED_FLAG<<11)
-#define FLAG_K (FORCED_FLAG<<12)
-#define FLAG_a (FORCED_FLAG<<13)
-#define FLAG_A (FORCED_FLAG<<14)
-#endif
-
-#ifdef FOR_ip
-#ifndef TT
-#define TT this.ip
-#endif
-#endif
-
-#ifdef FOR_ipcrm
-#ifndef TT
-#define TT this.ipcrm
-#endif
-#define FLAG_Q (FORCED_FLAG<<0)
-#define FLAG_q (FORCED_FLAG<<1)
-#define FLAG_S (FORCED_FLAG<<2)
-#define FLAG_s (FORCED_FLAG<<3)
-#define FLAG_M (FORCED_FLAG<<4)
-#define FLAG_m (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_ipcs
-#ifndef TT
-#define TT this.ipcs
-#endif
-#define FLAG_i (FORCED_FLAG<<0)
-#define FLAG_m (FORCED_FLAG<<1)
-#define FLAG_q (FORCED_FLAG<<2)
-#define FLAG_s (FORCED_FLAG<<3)
-#define FLAG_l (FORCED_FLAG<<4)
-#define FLAG_u (FORCED_FLAG<<5)
-#define FLAG_t (FORCED_FLAG<<6)
-#define FLAG_p (FORCED_FLAG<<7)
-#define FLAG_c (FORCED_FLAG<<8)
-#define FLAG_a (FORCED_FLAG<<9)
-#endif
-
-#ifdef FOR_kill
-#ifndef TT
-#define TT this.kill
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_killall
-#ifndef TT
-#define TT this.killall
-#endif
-#define FLAG_w (FORCED_FLAG<<0)
-#define FLAG_v (FORCED_FLAG<<1)
-#define FLAG_q (FORCED_FLAG<<2)
-#define FLAG_l (FORCED_FLAG<<3)
-#define FLAG_i (FORCED_FLAG<<4)
-#define FLAG_s (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_killall5
-#ifndef TT
-#define TT this.killall5
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#define FLAG_o (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_klogd
-#ifndef TT
-#define TT this.klogd
-#endif
-#define FLAG_n (FORCED_FLAG<<0)
-#define FLAG_c (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_last
-#ifndef TT
-#define TT this.last
-#endif
-#define FLAG_W (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_link
-#ifndef TT
-#define TT this.link
-#endif
-#endif
-
-#ifdef FOR_ln
-#ifndef TT
-#define TT this.ln
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_f (1<<1)
-#define FLAG_n (1<<2)
-#define FLAG_v (1<<3)
-#define FLAG_T (1<<4)
-#define FLAG_t (1<<5)
-#endif
-
-#ifdef FOR_load_policy
-#ifndef TT
-#define TT this.load_policy
-#endif
-#endif
-
-#ifdef FOR_log
-#ifndef TT
-#define TT this.log
-#endif
-#define FLAG_t (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_logger
-#ifndef TT
-#define TT this.logger
-#endif
-#define FLAG_p (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_login
-#ifndef TT
-#define TT this.login
-#endif
-#define FLAG_h (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#define FLAG_f (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_logname
-#ifndef TT
-#define TT this.logname
-#endif
-#endif
-
-#ifdef FOR_logwrapper
-#ifndef TT
-#define TT this.logwrapper
-#endif
-#endif
-
-#ifdef FOR_losetup
-#ifndef TT
-#define TT this.losetup
-#endif
-#define FLAG_D (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_d (FORCED_FLAG<<3)
-#define FLAG_f (FORCED_FLAG<<4)
-#define FLAG_j (FORCED_FLAG<<5)
-#define FLAG_o (FORCED_FLAG<<6)
-#define FLAG_r (FORCED_FLAG<<7)
-#define FLAG_s (FORCED_FLAG<<8)
-#define FLAG_S (FORCED_FLAG<<9)
-#endif
-
-#ifdef FOR_ls
-#ifndef TT
-#define TT this.ls
-#endif
-#define FLAG_1 (1<<0)
-#define FLAG_x (1<<1)
-#define FLAG_u (1<<2)
-#define FLAG_t (1<<3)
-#define FLAG_s (1<<4)
-#define FLAG_r (1<<5)
-#define FLAG_q (1<<6)
-#define FLAG_p (1<<7)
-#define FLAG_n (1<<8)
-#define FLAG_m (1<<9)
-#define FLAG_l (1<<10)
-#define FLAG_k (1<<11)
-#define FLAG_i (1<<12)
-#define FLAG_h (1<<13)
-#define FLAG_f (1<<14)
-#define FLAG_d (1<<15)
-#define FLAG_c (1<<16)
-#define FLAG_b (1<<17)
-#define FLAG_a (1<<18)
-#define FLAG_S (1<<19)
-#define FLAG_R (1<<20)
-#define FLAG_L (1<<21)
-#define FLAG_H (1<<22)
-#define FLAG_F (1<<23)
-#define FLAG_C (1<<24)
-#define FLAG_A (1<<25)
-#define FLAG_o (1<<26)
-#define FLAG_g (1<<27)
-#define FLAG_Z (1<<28)
-#define FLAG_show_control_chars (1<<29)
-#define FLAG_full_time (1<<30)
-#define FLAG_color (1<<31)
-#endif
-
-#ifdef FOR_lsattr
-#ifndef TT
-#define TT this.lsattr
-#endif
-#define FLAG_R (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_l (FORCED_FLAG<<3)
-#define FLAG_v (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_lsmod
-#ifndef TT
-#define TT this.lsmod
-#endif
-#endif
-
-#ifdef FOR_lsof
-#ifndef TT
-#define TT this.lsof
-#endif
-#define FLAG_t (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#define FLAG_l (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_lspci
-#ifndef TT
-#define TT this.lspci
-#endif
-#define FLAG_i (FORCED_FLAG<<0)
-#define FLAG_n (FORCED_FLAG<<1)
-#define FLAG_k (FORCED_FLAG<<2)
-#define FLAG_m (FORCED_FLAG<<3)
-#define FLAG_e (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_lsusb
-#ifndef TT
-#define TT this.lsusb
-#endif
-#endif
-
-#ifdef FOR_makedevs
-#ifndef TT
-#define TT this.makedevs
-#endif
-#define FLAG_d (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_man
-#ifndef TT
-#define TT this.man
-#endif
-#define FLAG_M (FORCED_FLAG<<0)
-#define FLAG_k (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_mcookie
-#ifndef TT
-#define TT this.mcookie
-#endif
-#define FLAG_V (FORCED_FLAG<<0)
-#define FLAG_v (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_md5sum
-#ifndef TT
-#define TT this.md5sum
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_c (1<<1)
-#define FLAG_b (1<<2)
-#endif
-
-#ifdef FOR_mdev
-#ifndef TT
-#define TT this.mdev
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_microcom
-#ifndef TT
-#define TT this.microcom
-#endif
-#define FLAG_X (1<<0)
-#define FLAG_s (1<<1)
-#endif
-
-#ifdef FOR_mix
-#ifndef TT
-#define TT this.mix
-#endif
-#define FLAG_r (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_c (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_mkdir
-#ifndef TT
-#define TT this.mkdir
-#endif
-#define FLAG_m (1<<0)
-#define FLAG_p (1<<1)
-#define FLAG_v (1<<2)
-#define FLAG_Z (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_mke2fs
-#ifndef TT
-#define TT this.mke2fs
-#endif
-#define FLAG_b (FORCED_FLAG<<0)
-#define FLAG_i (FORCED_FLAG<<1)
-#define FLAG_N (FORCED_FLAG<<2)
-#define FLAG_m (FORCED_FLAG<<3)
-#define FLAG_q (FORCED_FLAG<<4)
-#define FLAG_n (FORCED_FLAG<<5)
-#define FLAG_F (FORCED_FLAG<<6)
-#define FLAG_g (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_mkfifo
-#ifndef TT
-#define TT this.mkfifo
-#endif
-#define FLAG_m (FORCED_FLAG<<0)
-#define FLAG_Z (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_mknod
-#ifndef TT
-#define TT this.mknod
-#endif
-#define FLAG_Z (FORCED_FLAG<<0)
-#define FLAG_m (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_mkpasswd
-#ifndef TT
-#define TT this.mkpasswd
-#endif
-#define FLAG_P (FORCED_FLAG<<0)
-#define FLAG_m (FORCED_FLAG<<1)
-#define FLAG_S (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_mkswap
-#ifndef TT
-#define TT this.mkswap
-#endif
-#define FLAG_L (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_mktemp
-#ifndef TT
-#define TT this.mktemp
-#endif
-#define FLAG_t (1<<0)
-#define FLAG_p (1<<1)
-#define FLAG_d (1<<2)
-#define FLAG_q (1<<3)
-#define FLAG_u (1<<4)
-#define FLAG_tmpdir (1<<5)
-#endif
-
-#ifdef FOR_modinfo
-#ifndef TT
-#define TT this.modinfo
-#endif
-#define FLAG_0 (FORCED_FLAG<<0)
-#define FLAG_F (FORCED_FLAG<<1)
-#define FLAG_k (FORCED_FLAG<<2)
-#define FLAG_b (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_modprobe
-#ifndef TT
-#define TT this.modprobe
-#endif
-#define FLAG_d (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_D (FORCED_FLAG<<2)
-#define FLAG_s (FORCED_FLAG<<3)
-#define FLAG_v (FORCED_FLAG<<4)
-#define FLAG_q (FORCED_FLAG<<5)
-#define FLAG_r (FORCED_FLAG<<6)
-#define FLAG_l (FORCED_FLAG<<7)
-#define FLAG_a (FORCED_FLAG<<8)
-#endif
-
-#ifdef FOR_more
-#ifndef TT
-#define TT this.more
-#endif
-#endif
-
-#ifdef FOR_mount
-#ifndef TT
-#define TT this.mount
-#endif
-#define FLAG_o (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_w (FORCED_FLAG<<2)
-#define FLAG_v (FORCED_FLAG<<3)
-#define FLAG_r (FORCED_FLAG<<4)
-#define FLAG_n (FORCED_FLAG<<5)
-#define FLAG_f (FORCED_FLAG<<6)
-#define FLAG_a (FORCED_FLAG<<7)
-#define FLAG_O (FORCED_FLAG<<8)
-#endif
-
-#ifdef FOR_mountpoint
-#ifndef TT
-#define TT this.mountpoint
-#endif
-#define FLAG_x (FORCED_FLAG<<0)
-#define FLAG_d (FORCED_FLAG<<1)
-#define FLAG_q (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_mv
-#ifndef TT
-#define TT this.mv
-#endif
-#define FLAG_i (1<<0)
-#define FLAG_f (1<<1)
-#define FLAG_F (1<<2)
-#define FLAG_n (1<<3)
-#define FLAG_v (1<<4)
-#endif
-
-#ifdef FOR_nbd_client
-#ifndef TT
-#define TT this.nbd_client
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_n (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_netcat
-#ifndef TT
-#define TT this.netcat
-#endif
-#define FLAG_U (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_6 (FORCED_FLAG<<2)
-#define FLAG_4 (FORCED_FLAG<<3)
-#define FLAG_f (FORCED_FLAG<<4)
-#define FLAG_s (FORCED_FLAG<<5)
-#define FLAG_q (FORCED_FLAG<<6)
-#define FLAG_p (FORCED_FLAG<<7)
-#define FLAG_W (FORCED_FLAG<<8)
-#define FLAG_w (FORCED_FLAG<<9)
-#define FLAG_L (FORCED_FLAG<<10)
-#define FLAG_l (FORCED_FLAG<<11)
-#define FLAG_t (FORCED_FLAG<<12)
-#endif
-
-#ifdef FOR_netstat
-#ifndef TT
-#define TT this.netstat
-#endif
-#define FLAG_l (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
-#define FLAG_e (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#define FLAG_t (FORCED_FLAG<<4)
-#define FLAG_u (FORCED_FLAG<<5)
-#define FLAG_w (FORCED_FLAG<<6)
-#define FLAG_x (FORCED_FLAG<<7)
-#define FLAG_r (FORCED_FLAG<<8)
-#define FLAG_W (FORCED_FLAG<<9)
-#define FLAG_p (FORCED_FLAG<<10)
-#endif
-
-#ifdef FOR_nice
-#ifndef TT
-#define TT this.nice
-#endif
-#define FLAG_n (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_nl
-#ifndef TT
-#define TT this.nl
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_n (FORCED_FLAG<<1)
-#define FLAG_b (FORCED_FLAG<<2)
-#define FLAG_E (FORCED_FLAG<<3)
-#define FLAG_w (FORCED_FLAG<<4)
-#define FLAG_l (FORCED_FLAG<<5)
-#define FLAG_v (FORCED_FLAG<<6)
-#endif
-
-#ifdef FOR_nohup
-#ifndef TT
-#define TT this.nohup
-#endif
-#endif
-
-#ifdef FOR_nproc
-#ifndef TT
-#define TT this.nproc
-#endif
-#define FLAG_all (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_nsenter
-#ifndef TT
-#define TT this.nsenter
-#endif
-#define FLAG_U (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_p (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#define FLAG_m (FORCED_FLAG<<4)
-#define FLAG_i (FORCED_FLAG<<5)
-#define FLAG_t (FORCED_FLAG<<6)
-#define FLAG_F (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_od
-#ifndef TT
-#define TT this.od
-#endif
-#define FLAG_t (1<<0)
-#define FLAG_A (1<<1)
-#define FLAG_b (1<<2)
-#define FLAG_c (1<<3)
-#define FLAG_d (1<<4)
-#define FLAG_o (1<<5)
-#define FLAG_s (1<<6)
-#define FLAG_x (1<<7)
-#define FLAG_N (1<<8)
-#define FLAG_w (1<<9)
-#define FLAG_v (1<<10)
-#define FLAG_j (1<<11)
-#endif
-
-#ifdef FOR_oneit
-#ifndef TT
-#define TT this.oneit
-#endif
-#define FLAG_3 (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_openvt
-#ifndef TT
-#define TT this.openvt
-#endif
-#define FLAG_w (FORCED_FLAG<<0)
-#define FLAG_s (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_partprobe
-#ifndef TT
-#define TT this.partprobe
-#endif
-#endif
-
-#ifdef FOR_passwd
-#ifndef TT
-#define TT this.passwd
-#endif
-#define FLAG_u (FORCED_FLAG<<0)
-#define FLAG_l (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_a (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_paste
-#ifndef TT
-#define TT this.paste
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_d (1<<1)
-#endif
-
-#ifdef FOR_patch
-#ifndef TT
-#define TT this.patch
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_R (1<<1)
-#define FLAG_i (1<<2)
-#define FLAG_d (1<<3)
-#define FLAG_p (1<<4)
-#define FLAG_l (1<<5)
-#define FLAG_u (1<<6)
-#define FLAG_f (1<<7)
-#define FLAG_g (1<<8)
-#define FLAG_x (FORCED_FLAG<<9)
-#define FLAG_dry_run (1<<10)
-#define FLAG_no_backup_if_mismatch (1<<11)
-#endif
-
-#ifdef FOR_pgrep
-#ifndef TT
-#define TT this.pgrep
-#endif
-#define FLAG_L (FORCED_FLAG<<0)
-#define FLAG_x (FORCED_FLAG<<1)
-#define FLAG_v (FORCED_FLAG<<2)
-#define FLAG_o (FORCED_FLAG<<3)
-#define FLAG_n (FORCED_FLAG<<4)
-#define FLAG_f (FORCED_FLAG<<5)
-#define FLAG_G (FORCED_FLAG<<6)
-#define FLAG_g (FORCED_FLAG<<7)
-#define FLAG_P (FORCED_FLAG<<8)
-#define FLAG_s (FORCED_FLAG<<9)
-#define FLAG_t (FORCED_FLAG<<10)
-#define FLAG_U (FORCED_FLAG<<11)
-#define FLAG_u (FORCED_FLAG<<12)
-#define FLAG_d (FORCED_FLAG<<13)
-#define FLAG_l (FORCED_FLAG<<14)
-#define FLAG_c (FORCED_FLAG<<15)
-#endif
-
-#ifdef FOR_pidof
-#ifndef TT
-#define TT this.pidof
-#endif
-#define FLAG_x (FORCED_FLAG<<0)
-#define FLAG_o (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_ping
-#ifndef TT
-#define TT this.ping
-#endif
-#define FLAG_I (FORCED_FLAG<<0)
-#define FLAG_6 (FORCED_FLAG<<1)
-#define FLAG_4 (FORCED_FLAG<<2)
-#define FLAG_f (FORCED_FLAG<<3)
-#define FLAG_q (FORCED_FLAG<<4)
-#define FLAG_w (FORCED_FLAG<<5)
-#define FLAG_W (FORCED_FLAG<<6)
-#define FLAG_i (FORCED_FLAG<<7)
-#define FLAG_s (FORCED_FLAG<<8)
-#define FLAG_c (FORCED_FLAG<<9)
-#define FLAG_t (FORCED_FLAG<<10)
-#define FLAG_m (FORCED_FLAG<<11)
-#endif
-
-#ifdef FOR_pivot_root
-#ifndef TT
-#define TT this.pivot_root
-#endif
-#endif
-
-#ifdef FOR_pkill
-#ifndef TT
-#define TT this.pkill
-#endif
-#define FLAG_l (FORCED_FLAG<<0)
-#define FLAG_x (FORCED_FLAG<<1)
-#define FLAG_v (FORCED_FLAG<<2)
-#define FLAG_o (FORCED_FLAG<<3)
-#define FLAG_n (FORCED_FLAG<<4)
-#define FLAG_f (FORCED_FLAG<<5)
-#define FLAG_G (FORCED_FLAG<<6)
-#define FLAG_g (FORCED_FLAG<<7)
-#define FLAG_P (FORCED_FLAG<<8)
-#define FLAG_s (FORCED_FLAG<<9)
-#define FLAG_t (FORCED_FLAG<<10)
-#define FLAG_U (FORCED_FLAG<<11)
-#define FLAG_u (FORCED_FLAG<<12)
-#define FLAG_V (FORCED_FLAG<<13)
-#endif
-
-#ifdef FOR_pmap
-#ifndef TT
-#define TT this.pmap
-#endif
-#define FLAG_q (FORCED_FLAG<<0)
-#define FLAG_x (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_printenv
-#ifndef TT
-#define TT this.printenv
-#endif
-#define FLAG_0 (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_printf
-#ifndef TT
-#define TT this.printf
-#endif
-#endif
-
-#ifdef FOR_ps
-#ifndef TT
-#define TT this.ps
-#endif
-#define FLAG_Z (FORCED_FLAG<<0)
-#define FLAG_w (FORCED_FLAG<<1)
-#define FLAG_G (FORCED_FLAG<<2)
-#define FLAG_g (FORCED_FLAG<<3)
-#define FLAG_U (FORCED_FLAG<<4)
-#define FLAG_u (FORCED_FLAG<<5)
-#define FLAG_T (FORCED_FLAG<<6)
-#define FLAG_t (FORCED_FLAG<<7)
-#define FLAG_s (FORCED_FLAG<<8)
-#define FLAG_p (FORCED_FLAG<<9)
-#define FLAG_O (FORCED_FLAG<<10)
-#define FLAG_o (FORCED_FLAG<<11)
-#define FLAG_n (FORCED_FLAG<<12)
-#define FLAG_M (FORCED_FLAG<<13)
-#define FLAG_l (FORCED_FLAG<<14)
-#define FLAG_f (FORCED_FLAG<<15)
-#define FLAG_e (FORCED_FLAG<<16)
-#define FLAG_d (FORCED_FLAG<<17)
-#define FLAG_A (FORCED_FLAG<<18)
-#define FLAG_a (FORCED_FLAG<<19)
-#define FLAG_P (FORCED_FLAG<<20)
-#define FLAG_k (FORCED_FLAG<<21)
-#endif
-
-#ifdef FOR_pwd
-#ifndef TT
-#define TT this.pwd
-#endif
-#define FLAG_P (1<<0)
-#define FLAG_L (1<<1)
-#endif
-
-#ifdef FOR_pwdx
-#ifndef TT
-#define TT this.pwdx
-#endif
-#define FLAG_a (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_readahead
-#ifndef TT
-#define TT this.readahead
-#endif
-#endif
-
-#ifdef FOR_readlink
-#ifndef TT
-#define TT this.readlink
-#endif
-#define FLAG_f (1<<0)
-#define FLAG_e (1<<1)
-#define FLAG_m (1<<2)
-#define FLAG_q (1<<3)
-#define FLAG_n (1<<4)
-#endif
-
-#ifdef FOR_realpath
-#ifndef TT
-#define TT this.realpath
-#endif
-#endif
-
-#ifdef FOR_reboot
-#ifndef TT
-#define TT this.reboot
-#endif
-#define FLAG_n (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_renice
-#ifndef TT
-#define TT this.renice
-#endif
-#define FLAG_n (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_p (FORCED_FLAG<<2)
-#define FLAG_g (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_reset
-#ifndef TT
-#define TT this.reset
-#endif
-#endif
-
-#ifdef FOR_restorecon
-#ifndef TT
-#define TT this.restorecon
-#endif
-#define FLAG_v (FORCED_FLAG<<0)
-#define FLAG_r (FORCED_FLAG<<1)
-#define FLAG_R (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#define FLAG_F (FORCED_FLAG<<4)
-#define FLAG_D (FORCED_FLAG<<5)
-#endif
-
-#ifdef FOR_rev
-#ifndef TT
-#define TT this.rev
-#endif
-#endif
-
-#ifdef FOR_rfkill
-#ifndef TT
-#define TT this.rfkill
-#endif
-#endif
-
-#ifdef FOR_rm
-#ifndef TT
-#define TT this.rm
-#endif
-#define FLAG_v (1<<0)
-#define FLAG_r (1<<1)
-#define FLAG_R (1<<2)
-#define FLAG_i (1<<3)
-#define FLAG_f (1<<4)
-#endif
-
-#ifdef FOR_rmdir
-#ifndef TT
-#define TT this.rmdir
-#endif
-#define FLAG_p (1<<0)
-#define FLAG_ignore_fail_on_non_empty (1<<1)
-#endif
-
-#ifdef FOR_rmmod
-#ifndef TT
-#define TT this.rmmod
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_w (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_route
-#ifndef TT
-#define TT this.route
-#endif
-#define FLAG_A (FORCED_FLAG<<0)
-#define FLAG_e (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_runcon
-#ifndef TT
-#define TT this.runcon
-#endif
-#endif
-
-#ifdef FOR_sed
-#ifndef TT
-#define TT this.sed
-#endif
-#define FLAG_z (1<<0)
-#define FLAG_r (1<<1)
-#define FLAG_E (1<<2)
-#define FLAG_n (1<<3)
-#define FLAG_i (1<<4)
-#define FLAG_f (1<<5)
-#define FLAG_e (1<<6)
-#define FLAG_version (1<<7)
-#define FLAG_help (1<<8)
-#endif
-
-#ifdef FOR_sendevent
-#ifndef TT
-#define TT this.sendevent
-#endif
-#endif
-
-#ifdef FOR_seq
-#ifndef TT
-#define TT this.seq
-#endif
-#define FLAG_w (1<<0)
-#define FLAG_s (1<<1)
-#define FLAG_f (1<<2)
-#endif
-
-#ifdef FOR_setenforce
-#ifndef TT
-#define TT this.setenforce
-#endif
-#endif
-
-#ifdef FOR_setfattr
-#ifndef TT
-#define TT this.setfattr
-#endif
-#define FLAG_x (FORCED_FLAG<<0)
-#define FLAG_v (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_h (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_setsid
-#ifndef TT
-#define TT this.setsid
-#endif
-#define FLAG_t (1<<0)
-#endif
-
-#ifdef FOR_sh
-#ifndef TT
-#define TT this.sh
-#endif
-#define FLAG_i (FORCED_FLAG<<0)
-#define FLAG_c (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_sha1sum
-#ifndef TT
-#define TT this.sha1sum
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_c (1<<1)
-#define FLAG_b (1<<2)
-#endif
-
-#ifdef FOR_shred
-#ifndef TT
-#define TT this.shred
-#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_o (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_s (FORCED_FLAG<<3)
-#define FLAG_u (FORCED_FLAG<<4)
-#define FLAG_x (FORCED_FLAG<<5)
-#define FLAG_z (FORCED_FLAG<<6)
-#endif
-
-#ifdef FOR_skeleton
-#ifndef TT
-#define TT this.skeleton
-#endif
-#define FLAG_a (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_d (FORCED_FLAG<<3)
-#define FLAG_e (FORCED_FLAG<<4)
-#define FLAG_also (FORCED_FLAG<<5)
-#define FLAG_blubber (FORCED_FLAG<<6)
-#define FLAG_walrus (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_skeleton_alias
-#ifndef TT
-#define TT this.skeleton_alias
-#endif
-#define FLAG_q (FORCED_FLAG<<0)
-#define FLAG_d (FORCED_FLAG<<1)
-#define FLAG_b (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_sleep
-#ifndef TT
-#define TT this.sleep
-#endif
-#endif
-
-#ifdef FOR_sntp
-#ifndef TT
-#define TT this.sntp
-#endif
-#define FLAG_r (FORCED_FLAG<<0)
-#define FLAG_q (FORCED_FLAG<<1)
-#define FLAG_D (FORCED_FLAG<<2)
-#define FLAG_d (FORCED_FLAG<<3)
-#define FLAG_s (FORCED_FLAG<<4)
-#define FLAG_a (FORCED_FLAG<<5)
-#define FLAG_t (FORCED_FLAG<<6)
-#define FLAG_p (FORCED_FLAG<<7)
-#define FLAG_S (FORCED_FLAG<<8)
-#define FLAG_m (FORCED_FLAG<<9)
-#define FLAG_M (FORCED_FLAG<<10)
-#endif
-
-#ifdef FOR_sort
-#ifndef TT
-#define TT this.sort
-#endif
-#define FLAG_n (1<<0)
-#define FLAG_u (1<<1)
-#define FLAG_r (1<<2)
-#define FLAG_i (1<<3)
-#define FLAG_f (1<<4)
-#define FLAG_d (1<<5)
-#define FLAG_z (1<<6)
-#define FLAG_s (1<<7)
-#define FLAG_c (1<<8)
-#define FLAG_M (1<<9)
-#define FLAG_b (1<<10)
-#define FLAG_V (1<<11)
-#define FLAG_x (1<<12)
-#define FLAG_t (1<<13)
-#define FLAG_k (1<<14)
-#define FLAG_o (1<<15)
-#define FLAG_m (1<<16)
-#define FLAG_T (1<<17)
-#define FLAG_S (1<<18)
-#define FLAG_g (1<<19)
-#endif
-
-#ifdef FOR_split
-#ifndef TT
-#define TT this.split
-#endif
-#define FLAG_l (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_a (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_stat
-#ifndef TT
-#define TT this.stat
-#endif
-#define FLAG_t (1<<0)
-#define FLAG_L (1<<1)
-#define FLAG_f (1<<2)
-#define FLAG_c (1<<3)
-#endif
-
-#ifdef FOR_strings
-#ifndef TT
-#define TT this.strings
-#endif
-#define FLAG_o (FORCED_FLAG<<0)
-#define FLAG_f (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_a (FORCED_FLAG<<3)
-#define FLAG_t (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_stty
-#ifndef TT
-#define TT this.stty
-#endif
-#define FLAG_g (FORCED_FLAG<<0)
-#define FLAG_F (FORCED_FLAG<<1)
-#define FLAG_a (FORCED_FLAG<<2)
-#endif
-
-#ifdef FOR_su
-#ifndef TT
-#define TT this.su
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_c (FORCED_FLAG<<1)
-#define FLAG_g (FORCED_FLAG<<2)
-#define FLAG_u (FORCED_FLAG<<3)
-#define FLAG_p (FORCED_FLAG<<4)
-#define FLAG_m (FORCED_FLAG<<5)
-#define FLAG_l (FORCED_FLAG<<6)
-#endif
-
-#ifdef FOR_sulogin
-#ifndef TT
-#define TT this.sulogin
-#endif
-#define FLAG_t (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_swapoff
-#ifndef TT
-#define TT this.swapoff
-#endif
-#endif
-
-#ifdef FOR_swapon
-#ifndef TT
-#define TT this.swapon
-#endif
-#define FLAG_d (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_switch_root
-#ifndef TT
-#define TT this.switch_root
-#endif
-#define FLAG_h (FORCED_FLAG<<0)
-#define FLAG_c (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_sync
-#ifndef TT
-#define TT this.sync
-#endif
-#endif
-
-#ifdef FOR_sysctl
-#ifndef TT
-#define TT this.sysctl
-#endif
-#define FLAG_A (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
-#define FLAG_p (FORCED_FLAG<<2)
-#define FLAG_w (FORCED_FLAG<<3)
-#define FLAG_q (FORCED_FLAG<<4)
-#define FLAG_N (FORCED_FLAG<<5)
-#define FLAG_e (FORCED_FLAG<<6)
-#define FLAG_n (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_syslogd
-#ifndef TT
-#define TT this.syslogd
-#endif
-#define FLAG_D (FORCED_FLAG<<0)
-#define FLAG_L (FORCED_FLAG<<1)
-#define FLAG_K (FORCED_FLAG<<2)
-#define FLAG_S (FORCED_FLAG<<3)
-#define FLAG_n (FORCED_FLAG<<4)
-#define FLAG_a (FORCED_FLAG<<5)
-#define FLAG_f (FORCED_FLAG<<6)
-#define FLAG_p (FORCED_FLAG<<7)
-#define FLAG_O (FORCED_FLAG<<8)
-#define FLAG_m (FORCED_FLAG<<9)
-#define FLAG_s (FORCED_FLAG<<10)
-#define FLAG_b (FORCED_FLAG<<11)
-#define FLAG_R (FORCED_FLAG<<12)
-#define FLAG_l (FORCED_FLAG<<13)
-#endif
-
-#ifdef FOR_tac
-#ifndef TT
-#define TT this.tac
-#endif
-#endif
-
-#ifdef FOR_tail
-#ifndef TT
-#define TT this.tail
-#endif
-#define FLAG_n (1<<0)
-#define FLAG_c (1<<1)
-#define FLAG_f (1<<2)
-#endif
-
-#ifdef FOR_tar
-#ifndef TT
-#define TT this.tar
-#endif
-#define FLAG_a (1<<0)
-#define FLAG_f (1<<1)
-#define FLAG_C (1<<2)
-#define FLAG_T (1<<3)
-#define FLAG_X (1<<4)
-#define FLAG_m (1<<5)
-#define FLAG_O (1<<6)
-#define FLAG_S (1<<7)
-#define FLAG_z (1<<8)
-#define FLAG_j (1<<9)
-#define FLAG_J (1<<10)
-#define FLAG_v (1<<11)
-#define FLAG_t (1<<12)
-#define FLAG_x (1<<13)
-#define FLAG_h (1<<14)
-#define FLAG_c (1<<15)
-#define FLAG_k (1<<16)
-#define FLAG_p (1<<17)
-#define FLAG_o (1<<18)
-#define FLAG_to_command (1<<19)
-#define FLAG_owner (1<<20)
-#define FLAG_group (1<<21)
-#define FLAG_mtime (1<<22)
-#define FLAG_mode (1<<23)
-#define FLAG_exclude (1<<24)
-#define FLAG_overwrite (1<<25)
-#define FLAG_no_same_permissions (1<<26)
-#define FLAG_numeric_owner (1<<27)
-#define FLAG_no_recursion (1<<28)
-#define FLAG_full_time (1<<29)
-#define FLAG_restrict (1<<30)
-#endif
-
-#ifdef FOR_taskset
-#ifndef TT
-#define TT this.taskset
-#endif
-#define FLAG_a (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_tcpsvd
-#ifndef TT
-#define TT this.tcpsvd
-#endif
-#define FLAG_v (FORCED_FLAG<<0)
-#define FLAG_E (FORCED_FLAG<<1)
-#define FLAG_h (FORCED_FLAG<<2)
-#define FLAG_l (FORCED_FLAG<<3)
-#define FLAG_u (FORCED_FLAG<<4)
-#define FLAG_b (FORCED_FLAG<<5)
-#define FLAG_C (FORCED_FLAG<<6)
-#define FLAG_c (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_tee
-#ifndef TT
-#define TT this.tee
-#endif
-#define FLAG_a (1<<0)
-#define FLAG_i (1<<1)
-#endif
-
-#ifdef FOR_telnet
-#ifndef TT
-#define TT this.telnet
-#endif
-#endif
-
-#ifdef FOR_telnetd
-#ifndef TT
-#define TT this.telnetd
-#endif
-#define FLAG_i (FORCED_FLAG<<0)
-#define FLAG_K (FORCED_FLAG<<1)
-#define FLAG_S (FORCED_FLAG<<2)
-#define FLAG_F (FORCED_FLAG<<3)
-#define FLAG_l (FORCED_FLAG<<4)
-#define FLAG_f (FORCED_FLAG<<5)
-#define FLAG_p (FORCED_FLAG<<6)
-#define FLAG_b (FORCED_FLAG<<7)
-#define FLAG_w (FORCED_FLAG<<8)
-#endif
-
-#ifdef FOR_test
-#ifndef TT
-#define TT this.test
-#endif
-#endif
-
-#ifdef FOR_tftp
-#ifndef TT
-#define TT this.tftp
-#endif
-#define FLAG_p (FORCED_FLAG<<0)
-#define FLAG_g (FORCED_FLAG<<1)
-#define FLAG_l (FORCED_FLAG<<2)
-#define FLAG_r (FORCED_FLAG<<3)
-#define FLAG_b (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_tftpd
-#ifndef TT
-#define TT this.tftpd
-#endif
-#define FLAG_l (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_c (FORCED_FLAG<<2)
-#define FLAG_r (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_time
-#ifndef TT
-#define TT this.time
-#endif
-#define FLAG_v (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_timeout
-#ifndef TT
-#define TT this.timeout
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_k (1<<1)
-#define FLAG_v (1<<2)
-#define FLAG_preserve_status (1<<3)
-#define FLAG_foreground (1<<4)
-#endif
-
-#ifdef FOR_top
-#ifndef TT
-#define TT this.top
-#endif
-#define FLAG_q (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_n (FORCED_FLAG<<2)
-#define FLAG_m (FORCED_FLAG<<3)
-#define FLAG_d (FORCED_FLAG<<4)
-#define FLAG_s (FORCED_FLAG<<5)
-#define FLAG_u (FORCED_FLAG<<6)
-#define FLAG_p (FORCED_FLAG<<7)
-#define FLAG_o (FORCED_FLAG<<8)
-#define FLAG_k (FORCED_FLAG<<9)
-#define FLAG_H (FORCED_FLAG<<10)
-#define FLAG_O (FORCED_FLAG<<11)
-#endif
-
-#ifdef FOR_touch
-#ifndef TT
-#define TT this.touch
-#endif
-#define FLAG_h (1<<0)
-#define FLAG_t (1<<1)
-#define FLAG_r (1<<2)
-#define FLAG_m (1<<3)
-#define FLAG_f (1<<4)
-#define FLAG_d (1<<5)
-#define FLAG_c (1<<6)
-#define FLAG_a (1<<7)
-#endif
-
-#ifdef FOR_toybox
-#ifndef TT
-#define TT this.toybox
-#endif
-#endif
-
-#ifdef FOR_tr
-#ifndef TT
-#define TT this.tr
-#endif
-#define FLAG_d (1<<0)
-#define FLAG_s (1<<1)
-#define FLAG_c (1<<2)
-#define FLAG_C (1<<3)
-#endif
-
-#ifdef FOR_traceroute
-#ifndef TT
-#define TT this.traceroute
-#endif
-#define FLAG_4 (FORCED_FLAG<<0)
-#define FLAG_6 (FORCED_FLAG<<1)
-#define FLAG_F (FORCED_FLAG<<2)
-#define FLAG_U (FORCED_FLAG<<3)
-#define FLAG_I (FORCED_FLAG<<4)
-#define FLAG_l (FORCED_FLAG<<5)
-#define FLAG_d (FORCED_FLAG<<6)
-#define FLAG_n (FORCED_FLAG<<7)
-#define FLAG_v (FORCED_FLAG<<8)
-#define FLAG_r (FORCED_FLAG<<9)
-#define FLAG_m (FORCED_FLAG<<10)
-#define FLAG_p (FORCED_FLAG<<11)
-#define FLAG_q (FORCED_FLAG<<12)
-#define FLAG_s (FORCED_FLAG<<13)
-#define FLAG_t (FORCED_FLAG<<14)
-#define FLAG_w (FORCED_FLAG<<15)
-#define FLAG_g (FORCED_FLAG<<16)
-#define FLAG_z (FORCED_FLAG<<17)
-#define FLAG_f (FORCED_FLAG<<18)
-#define FLAG_i (FORCED_FLAG<<19)
-#endif
-
-#ifdef FOR_true
-#ifndef TT
-#define TT this.true
-#endif
-#endif
-
-#ifdef FOR_truncate
-#ifndef TT
-#define TT this.truncate
-#endif
-#define FLAG_c (1<<0)
-#define FLAG_s (1<<1)
-#endif
-
-#ifdef FOR_tty
-#ifndef TT
-#define TT this.tty
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_tunctl
-#ifndef TT
-#define TT this.tunctl
-#endif
-#define FLAG_T (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_d (FORCED_FLAG<<2)
-#define FLAG_t (FORCED_FLAG<<3)
-#endif
-
-#ifdef FOR_ulimit
-#ifndef TT
-#define TT this.ulimit
-#endif
-#define FLAG_c (FORCED_FLAG<<0)
-#define FLAG_d (FORCED_FLAG<<1)
-#define FLAG_e (FORCED_FLAG<<2)
-#define FLAG_f (FORCED_FLAG<<3)
-#define FLAG_i (FORCED_FLAG<<4)
-#define FLAG_l (FORCED_FLAG<<5)
-#define FLAG_m (FORCED_FLAG<<6)
-#define FLAG_n (FORCED_FLAG<<7)
-#define FLAG_p (FORCED_FLAG<<8)
-#define FLAG_q (FORCED_FLAG<<9)
-#define FLAG_R (FORCED_FLAG<<10)
-#define FLAG_r (FORCED_FLAG<<11)
-#define FLAG_s (FORCED_FLAG<<12)
-#define FLAG_t (FORCED_FLAG<<13)
-#define FLAG_u (FORCED_FLAG<<14)
-#define FLAG_v (FORCED_FLAG<<15)
-#define FLAG_a (FORCED_FLAG<<16)
-#define FLAG_H (FORCED_FLAG<<17)
-#define FLAG_S (FORCED_FLAG<<18)
-#define FLAG_P (FORCED_FLAG<<19)
-#endif
-
-#ifdef FOR_umount
-#ifndef TT
-#define TT this.umount
-#endif
-#define FLAG_v (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_a (FORCED_FLAG<<2)
-#define FLAG_r (FORCED_FLAG<<3)
-#define FLAG_l (FORCED_FLAG<<4)
-#define FLAG_f (FORCED_FLAG<<5)
-#define FLAG_D (FORCED_FLAG<<6)
-#define FLAG_d (FORCED_FLAG<<7)
-#define FLAG_n (FORCED_FLAG<<8)
-#define FLAG_c (FORCED_FLAG<<9)
-#endif
-
-#ifdef FOR_uname
-#ifndef TT
-#define TT this.uname
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_n (1<<1)
-#define FLAG_r (1<<2)
-#define FLAG_v (1<<3)
-#define FLAG_m (1<<4)
-#define FLAG_a (1<<5)
-#define FLAG_o (1<<6)
-#endif
-
-#ifdef FOR_uniq
-#ifndef TT
-#define TT this.uniq
-#endif
-#define FLAG_u (1<<0)
-#define FLAG_d (1<<1)
-#define FLAG_c (1<<2)
-#define FLAG_i (1<<3)
-#define FLAG_z (1<<4)
-#define FLAG_w (1<<5)
-#define FLAG_s (1<<6)
-#define FLAG_f (1<<7)
-#endif
-
-#ifdef FOR_unix2dos
-#ifndef TT
-#define TT this.unix2dos
-#endif
-#endif
-
-#ifdef FOR_unlink
-#ifndef TT
-#define TT this.unlink
-#endif
-#endif
-
-#ifdef FOR_unshare
-#ifndef TT
-#define TT this.unshare
-#endif
-#define FLAG_U (FORCED_FLAG<<0)
-#define FLAG_u (FORCED_FLAG<<1)
-#define FLAG_p (FORCED_FLAG<<2)
-#define FLAG_n (FORCED_FLAG<<3)
-#define FLAG_m (FORCED_FLAG<<4)
-#define FLAG_i (FORCED_FLAG<<5)
-#define FLAG_r (FORCED_FLAG<<6)
-#define FLAG_f (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_uptime
-#ifndef TT
-#define TT this.uptime
-#endif
-#define FLAG_s (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_useradd
-#ifndef TT
-#define TT this.useradd
-#endif
-#define FLAG_H (FORCED_FLAG<<0)
-#define FLAG_D (FORCED_FLAG<<1)
-#define FLAG_S (FORCED_FLAG<<2)
-#define FLAG_h (FORCED_FLAG<<3)
-#define FLAG_g (FORCED_FLAG<<4)
-#define FLAG_s (FORCED_FLAG<<5)
-#define FLAG_G (FORCED_FLAG<<6)
-#define FLAG_u (FORCED_FLAG<<7)
-#endif
-
-#ifdef FOR_userdel
-#ifndef TT
-#define TT this.userdel
-#endif
-#define FLAG_r (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_usleep
-#ifndef TT
-#define TT this.usleep
-#endif
-#endif
-
-#ifdef FOR_uudecode
-#ifndef TT
-#define TT this.uudecode
-#endif
-#define FLAG_o (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_uuencode
-#ifndef TT
-#define TT this.uuencode
-#endif
-#define FLAG_m (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_uuidgen
-#ifndef TT
-#define TT this.uuidgen
-#endif
-#define FLAG_r (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_vconfig
-#ifndef TT
-#define TT this.vconfig
-#endif
-#endif
-
-#ifdef FOR_vi
-#ifndef TT
-#define TT this.vi
-#endif
-#endif
-
-#ifdef FOR_vmstat
-#ifndef TT
-#define TT this.vmstat
-#endif
-#define FLAG_n (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_w
-#ifndef TT
-#define TT this.w
-#endif
-#endif
-
-#ifdef FOR_watch
-#ifndef TT
-#define TT this.watch
-#endif
-#define FLAG_x (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_e (FORCED_FLAG<<2)
-#define FLAG_t (FORCED_FLAG<<3)
-#define FLAG_n (FORCED_FLAG<<4)
-#endif
-
-#ifdef FOR_wc
-#ifndef TT
-#define TT this.wc
-#endif
-#define FLAG_l (1<<0)
-#define FLAG_w (1<<1)
-#define FLAG_c (1<<2)
-#define FLAG_m (1<<3)
-#endif
-
-#ifdef FOR_wget
-#ifndef TT
-#define TT this.wget
-#endif
-#define FLAG_O (FORCED_FLAG<<0)
-#define FLAG_no_check_certificate (FORCED_FLAG<<1)
-#endif
-
-#ifdef FOR_which
-#ifndef TT
-#define TT this.which
-#endif
-#define FLAG_a (1<<0)
-#endif
-
-#ifdef FOR_who
-#ifndef TT
-#define TT this.who
-#endif
-#define FLAG_a (FORCED_FLAG<<0)
-#endif
-
-#ifdef FOR_xargs
-#ifndef TT
-#define TT this.xargs
-#endif
-#define FLAG_0 (1<<0)
-#define FLAG_s (1<<1)
-#define FLAG_n (1<<2)
-#define FLAG_r (1<<3)
-#define FLAG_t (1<<4)
-#define FLAG_p (1<<5)
-#define FLAG_o (1<<6)
-#define FLAG_P (1<<7)
-#define FLAG_E (1<<8)
-#endif
-
-#ifdef FOR_xxd
-#ifndef TT
-#define TT this.xxd
-#endif
-#define FLAG_s (1<<0)
-#define FLAG_r (1<<1)
-#define FLAG_p (1<<2)
-#define FLAG_i (1<<3)
-#define FLAG_g (1<<4)
-#define FLAG_o (1<<5)
-#define FLAG_l (1<<6)
-#define FLAG_c (1<<7)
-#endif
-
-#ifdef FOR_xzcat
-#ifndef TT
-#define TT this.xzcat
-#endif
-#endif
-
-#ifdef FOR_yes
-#ifndef TT
-#define TT this.yes
-#endif
-#endif
-
-#ifdef FOR_zcat
-#ifndef TT
-#define TT this.zcat
-#endif
-#define FLAG_9 (FORCED_FLAG<<0)
-#define FLAG_8 (FORCED_FLAG<<1)
-#define FLAG_7 (FORCED_FLAG<<2)
-#define FLAG_6 (FORCED_FLAG<<3)
-#define FLAG_5 (FORCED_FLAG<<4)
-#define FLAG_4 (FORCED_FLAG<<5)
-#define FLAG_3 (FORCED_FLAG<<6)
-#define FLAG_2 (FORCED_FLAG<<7)
-#define FLAG_1 (FORCED_FLAG<<8)
-#define FLAG_k (FORCED_FLAG<<9)
-#define FLAG_f (FORCED_FLAG<<10)
-#define FLAG_d (FORCED_FLAG<<11)
-#define FLAG_c (FORCED_FLAG<<12)
-#endif
-
diff --git a/android/mac/generated/help.h b/android/mac/generated/help.h
deleted file mode 100644
index 10516a4b..00000000
--- a/android/mac/generated/help.h
+++ /dev/null
@@ -1,612 +0,0 @@
-#define HELP_toybox_musl_nommu_is_broken "When using musl-libc on a nommu system, you'll need to say \"y\" here.\n\nAlthough uclibc lets you detect support for things like fork() and\ndaemon() at compile time, musl intentionally includes broken versions\nthat always return -ENOSYS on nommu systems, and goes out of its way\nto prevent any cross-compile compatible compile-time probes for a\nnommu system. (It doesn't even #define __MUSL__ in features.h.)\n\nMusl does this despite the fact that a nommu system can't even run\nstandard ELF binaries, and requires specially packaged executables.\nSo our only choice is to manually provide a musl nommu bug workaround\nyou can manually select to enable (larger, slower) nommu support with\nmusl."
-
-#define HELP_toybox_uid_usr "When commands like useradd/groupadd allocate user IDs, start here."
-
-#define HELP_toybox_uid_sys "When commands like useradd/groupadd allocate system IDs, start here."
-
-#define HELP_toybox_pedantic_args "Check arguments for commands that have no arguments."
-
-#define HELP_toybox_debug "Enable extra checks for debugging purposes. All of them catch\nthings that can only go wrong at development time, not runtime."
-
-#define HELP_toybox_norecurse "When one toybox command calls another, usually it just calls the new\ncommand's main() function rather than searching the $PATH and calling\nexec on another file (which is much slower).\n\nThis disables that optimization, so toybox will run external commands\n even when it has a built-in version of that command. This requires\n toybox symlinks to be installed in the $PATH, or re-invoking the\n \"toybox\" multiplexer command by name."
-
-#define HELP_toybox_free "When a program exits, the operating system will clean up after it\n(free memory, close files, etc). To save size, toybox usually relies\non this behavior. If you're running toybox under a debugger or\nwithout a real OS (ala newlib+libgloss), enable this to make toybox\nclean up after itself."
-
-#define HELP_toybox_i18n "Support for UTF-8 character sets, and some locale support."
-
-#define HELP_toybox_help_dashdash "Support --help argument in all commands, even ones with a NULL\noptstring. (Use TOYFLAG_NOHELP to disable.) Produces the same output\nas \"help command\". --version shows toybox version."
-
-#define HELP_toybox_help "Include help text for each command."
-
-#define HELP_toybox_float "Include floating point support infrastructure and commands that\nrequire it."
-
-#define HELP_toybox_libz "Use libz for gz support."
-
-#define HELP_toybox_libcrypto "Use faster hash functions out of external -lcrypto library."
-
-#define HELP_toybox_smack "Include SMACK options in commands like ls for systems like Tizen."
-
-#define HELP_toybox_selinux "Include SELinux options in commands such as ls, and add\nSELinux-specific commands such as chcon to the Android menu."
-
-#define HELP_toybox_lsm_none "Don't try to achieve \"watertight\" by plugging the holes in a\ncollander, instead use conventional unix security (and possibly\nLinux Containers) for a simple straightforward system."
-
-#define HELP_toybox_suid "Support for the Set User ID bit, to install toybox suid root and drop\npermissions for commands which do not require root access. To use\nthis change ownership of the file to the root user and set the suid\nbit in the file permissions:\n\nchown root:root toybox; chmod +s toybox\n\nprompt \"Security Blanket\"\ndefault TOYBOX_LSM_NONE\nhelp\nSelect a Linux Security Module to complicate your system\nuntil you can't find holes in it."
-
-#define HELP_toybox "usage: toybox [--long | --help | --version | [command] [arguments...]]\n\nWith no arguments, shows available commands. First argument is\nname of a command to run, followed by any arguments to that command.\n\n--long Show path to each command\n\nTo install command symlinks with paths, try:\n for i in $(/bin/toybox --long); do ln -s /bin/toybox $i; done\nor all in one directory:\n for i in $(./toybox); do ln -s toybox $i; done; PATH=$PWD:$PATH\n\nMost toybox commands also understand the following arguments:\n\n--help Show command help (only)\n--version Show toybox version (only)\n\nThe filename \"-\" means stdin/stdout, and \"--\" stops argument parsing.\n\nNumerical arguments accept a single letter suffix for\nkilo, mega, giga, tera, peta, and exabytes, plus an additional\n\"d\" to indicate decimal 1000's instead of 1024.\n\nDurations can be decimal fractions and accept minute (\"m\"), hour (\"h\"),\nor day (\"d\") suffixes (so 0.1m = 6s)."
-
-#define HELP_setenforce "usage: setenforce [enforcing|permissive|1|0]\n\nSets whether SELinux is enforcing (1) or permissive (0)."
-
-#define HELP_sendevent "usage: sendevent DEVICE TYPE CODE VALUE\n\nSends a Linux input event."
-
-#define HELP_runcon "usage: runcon CONTEXT COMMAND [ARGS...]\n\nRun a command in a specified security context."
-
-#define HELP_restorecon "usage: restorecon [-D] [-F] [-R] [-n] [-v] FILE...\n\nRestores the default security contexts for the given files.\n\n-D Apply to /data/data too\n-F Force reset\n-R Recurse into directories\n-n Don't make any changes; useful with -v to see what would change\n-v Verbose"
-
-#define HELP_log "usage: log [-p PRI] [-t TAG] MESSAGE...\n\nLogs message to logcat.\n\n-p Use the given priority instead of INFO:\n d: DEBUG e: ERROR f: FATAL i: INFO v: VERBOSE w: WARN s: SILENT\n-t Use the given tag instead of \"log\""
-
-#define HELP_load_policy "usage: load_policy FILE\n\nLoad the specified SELinux policy file."
-
-#define HELP_getenforce "usage: getenforce\n\nShows whether SELinux is disabled, enforcing, or permissive."
-
-#define HELP_skeleton_alias "usage: skeleton_alias [-dq] [-b NUMBER]\n\nExample of a second command with different arguments in the same source\nfile as the first. This allows shared infrastructure not added to lib/."
-
-#define HELP_skeleton "usage: skeleton [-a] [-b STRING] [-c NUMBER] [-d LIST] [-e COUNT] [...]\n\nTemplate for new commands. You don't need this.\n\nWhen creating a new command, copy this file and delete the parts you\ndon't need. Be sure to replace all instances of \"skeleton\" (upper and lower\ncase) with your new command name.\n\nFor simple commands, \"hello.c\" is probably a better starting point."
-
-#define HELP_logwrapper "usage: logwrapper ...\n\nAppend command line to $WRAPLOG, then call second instance\nof command in $PATH."
-
-#define HELP_hostid "usage: hostid\n\nPrint the numeric identifier for the current host."
-
-#define HELP_hello "usage: hello\n\nA hello world program.\n\nMostly used as a simple template for adding new commands.\nOccasionally nice to smoketest kernel booting via \"init=/usr/bin/hello\"."
-
-#define HELP_demo_utf8towc "usage: demo_utf8towc\n\nPrint differences between toybox's utf8 conversion routines vs libc du jour."
-
-#define HELP_demo_scankey "usage: demo_scankey\n\nMove a letter around the screen. Hit ESC to exit."
-
-#define HELP_demo_number "usage: demo_number [-hsbi] NUMBER...\n\n-b Use \"B\" for single byte units (HR_B)\n-d Decimal units\n-h Human readable\n-s Space between number and units (HR_SPACE)"
-
-#define HELP_demo_many_options "usage: demo_many_options -[a-zA-Z]\n\nPrint the optflags value of the command arguments, in hex."
-
-#define HELP_umount "usage: umount [-a [-t TYPE[,TYPE...]]] [-vrfD] [DIR...]\n\nUnmount the listed filesystems.\n\n-a Unmount all mounts in /proc/mounts instead of command line list\n-D Don't free loopback device(s)\n-f Force unmount\n-l Lazy unmount (detach from filesystem now, close when last user does)\n-n Don't use /proc/mounts\n-r Remount read only if unmounting fails\n-t Restrict \"all\" to mounts of TYPE (or use \"noTYPE\" to skip)\n-v Verbose"
-
-#define HELP_sync "usage: sync\n\nWrite pending cached data to disk (synchronize), blocking until done."
-
-#define HELP_su "usage: su [-lp] [-u UID] [-g GID,...] [-s SHELL] [-c CMD] [USER [COMMAND...]]\n\nSwitch user, prompting for password of new user when not run as root.\n\nWith one argument, switch to USER and run user's shell from /etc/passwd.\nWith no arguments, USER is root. If COMMAND line provided after USER,\nexec() it as new USER (bypasing shell). If -u or -g specified, first\nargument (if any) isn't USER (it's COMMAND).\n\nfirst argument is USER name to switch to (which must exist).\nNon-root users are prompted for new user's password.\n\n-s Shell to use (default is user's shell from /etc/passwd)\n-c Command line to pass to -s shell (ala sh -c \"CMD\")\n-l Reset environment as if new login.\n-u Switch to UID instead of USER\n-g Switch to GID (only root allowed, can be comma separated list)\n-p Preserve environment (except for $PATH and $IFS)"
-
-#define HELP_seq "usage: seq [-w|-f fmt_str] [-s sep_str] [first] [increment] last\n\nCount from first to last, by increment. Omitted arguments default\nto 1. Two arguments are used as first and last. Arguments can be\nnegative or floating point.\n\n-f Use fmt_str as a printf-style floating point format string\n-s Use sep_str as separator, default is a newline character\n-w Pad to equal width with leading zeroes"
-
-#define HELP_pidof "usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...\n\nPrint the PIDs of all processes with the given names.\n\n-s Single shot, only return one pid\n-o Omit PID(s)\n-x Match shell scripts too"
-
-#define HELP_passwd_sad "Password changes are checked to make sure they're at least 6 chars long,\ndon't include the entire username (but not a subset of it), or the entire\nprevious password (but changing password1, password2, password3 is fine).\nThis heuristic accepts \"aaaaaa\" and \"123456\"."
-
-#define HELP_passwd "usage: passwd [-a ALGO] [-dlu] [USER]\n\nUpdate user's authentication tokens. Defaults to current user.\n\n-a ALGO Encryption method (des, md5, sha256, sha512) default: des\n-d Set password to ''\n-l Lock (disable) account\n-u Unlock (enable) account"
-
-#define HELP_mount "usage: mount [-afFrsvw] [-t TYPE] [-o OPTION,] [[DEVICE] DIR]\n\nMount new filesystem(s) on directories. With no arguments, display existing\nmounts.\n\n-a Mount all entries in /etc/fstab (with -t, only entries of that TYPE)\n-O Only mount -a entries that have this option\n-f Fake it (don't actually mount)\n-r Read only (same as -o ro)\n-w Read/write (default, same as -o rw)\n-t Specify filesystem type\n-v Verbose\n\nOPTIONS is a comma separated list of options, which can also be supplied\nas --longopts.\n\nAutodetects loopback mounts (a file on a directory) and bind mounts (file\non file, directory on directory), so you don't need to say --bind or --loop.\nYou can also \"mount -a /path\" to mount everything in /etc/fstab under /path,\neven if it's noauto. DEVICE starting with UUID= is identified by blkid -U."
-
-#define HELP_mktemp "usage: mktemp [-dqu] [-p DIR] [TEMPLATE]\n\nSafely create a new file \"DIR/TEMPLATE\" and print its name.\n\n-d Create directory instead of file (--directory)\n-p Put new file in DIR (--tmpdir)\n-q Quiet, no error messages\n-t Prefer $TMPDIR > DIR > /tmp (default DIR > $TMPDIR > /tmp)\n-u Don't create anything, just print what would be created\n\nEach X in TEMPLATE is replaced with a random printable character. The\ndefault TEMPLATE is tmp.XXXXXXXXXX."
-
-#define HELP_mknod_z "usage: mknod [-Z CONTEXT] ...\n\n-Z Set security context to created file"
-
-#define HELP_mknod "usage: mknod [-m MODE] NAME TYPE [MAJOR MINOR]\n\nCreate a special file NAME with a given type. TYPE is b for block device,\nc or u for character device, p for named pipe (which ignores MAJOR/MINOR).\n\n-m Mode (file permissions) of new device, in octal or u+x format"
-
-#define HELP_sha512sum "See sha1sum"
-
-#define HELP_sha384sum "See sha1sum"
-
-#define HELP_sha256sum "See sha1sum"
-
-#define HELP_sha224sum "See sha1sum"
-
-#define HELP_sha1sum "usage: sha?sum [-bcs] [FILE]...\n\nCalculate sha hash for each input file, reading from stdin if none. Output\none hash (40 hex digits for sha1, 56 for sha224, 64 for sha256, 96 for sha384,\nand 128 for sha512) for each input file, followed by filename.\n\n-b Brief (hash only, no filename)\n-c Check each line of each FILE is the same hash+filename we'd output\n-s No output, exit status 0 if all hashes match, 1 otherwise"
-
-#define HELP_md5sum "usage: md5sum [-bcs] [FILE]...\n\nCalculate md5 hash for each input file, reading from stdin if none.\nOutput one hash (32 hex digits) for each input file, followed by filename.\n\n-b Brief (hash only, no filename)\n-c Check each line of each FILE is the same hash+filename we'd output\n-s No output, exit status 0 if all hashes match, 1 otherwise"
-
-#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"
-
-#define HELP_gunzip "usage: gunzip [-cfk] [FILE...]\n\nDecompress files. With no files, decompresses stdin to stdout.\nOn success, the input files are removed and replaced by new\nfiles without the .gz suffix.\n\n-c Output to stdout (act as zcat)\n-f Force: allow read from tty\n-k Keep input files (default is to remove)"
-
-#define HELP_gzip "usage: gzip [-19cdfk] [FILE...]\n\nCompress files. With no files, compresses stdin to stdout.\nOn success, the input files are removed and replaced by new\nfiles with the .gz suffix.\n\n-c Output to stdout\n-d Decompress (act as gunzip)\n-f Force: allow overwrite of output file\n-k Keep input files (default is to remove)\n-# Compression level 1-9 (1:fastest, 6:default, 9:best)"
-
-#define HELP_dmesg "usage: dmesg [-Cc] [-r|-t|-T] [-n LEVEL] [-s SIZE] [-w]\n\nPrint or control the kernel ring buffer.\n\n-C Clear ring buffer without printing\n-c Clear ring buffer after printing\n-n Set kernel logging LEVEL (1-9)\n-r Raw output (with <level markers>)\n-S Use syslog(2) rather than /dev/kmsg\n-s Show the last SIZE many bytes\n-T Human readable timestamps\n-t Don't print timestamps\n-w Keep waiting for more output (aka --follow)"
-
-#define HELP_tunctl "usage: tunctl [-dtT] [-u USER] NAME\n\nCreate and delete tun/tap virtual ethernet devices.\n\n-T Use tap (ethernet frames) instead of tun (ip packets)\n-d Delete tun/tap device\n-t Create tun/tap device\n-u Set owner (user who can read/write device without root access)"
-
-#define HELP_sntp "usage: sntp [-saSdDq] [-r SHIFT] [-mM[ADDRESS]] [-p PORT] [SERVER]\n\nSimple Network Time Protocol client. Query SERVER and display time.\n\n-p Use PORT (default 123)\n-s Set system clock suddenly\n-a Adjust system clock gradually\n-S Serve time instead of querying (bind to SERVER address if specified)\n-m Wait for updates from multicast ADDRESS (RFC 4330 default 224.0.1.1)\n-M Multicast server on ADDRESS (deault 224.0.0.1)\n-t TTL (multicast only, default 1)\n-d Daemonize (run in background re-querying )\n-D Daemonize but stay in foreground: re-query time every 1000 seconds\n-r Retry shift (every 1<<SHIFT seconds)\n-q Quiet (don't display time)"
-
-#define HELP_rfkill "usage: rfkill COMMAND [DEVICE]\n\nEnable/disable wireless devices.\n\nCommands:\nlist [DEVICE] List current state\nblock DEVICE Disable device\nunblock DEVICE Enable device\n\nDEVICE is an index number, or one of:\nall, wlan(wifi), bluetooth, uwb(ultrawideband), wimax, wwan, gps, fm."
-
-#define HELP_ping "usage: ping [OPTIONS] HOST\n\nCheck network connectivity by sending packets to a host and reporting\nits response.\n\nSend ICMP ECHO_REQUEST packets to ipv4 or ipv6 addresses and prints each\necho it receives back, with round trip time. Returns true if host alive.\n\nOptions:\n-4, -6 Force IPv4 or IPv6\n-c CNT Send CNT many packets (default 3, 0 = infinite)\n-f Flood (print . and \\b to show drops, default -c 15 -i 0.2)\n-i TIME Interval between packets (default 1, need root for < .2)\n-I IFACE/IP Source interface or address\n-m MARK Tag outgoing packets using SO_MARK\n-q Quiet (stops after one returns true if host is alive)\n-s SIZE Data SIZE in bytes (default 56)\n-t TTL Set Time To Live (number of hops)\n-W SEC Seconds to wait for response after last -c packet (default 3)\n-w SEC Exit after this many seconds"
-
-#define HELP_netstat "usage: netstat [-pWrxwutneal]\n\nDisplay networking information. Default is netstat -tuwx\n\n-r Routing table\n-a All sockets (not just connected)\n-l Listening server sockets\n-t TCP sockets\n-u UDP sockets\n-w Raw sockets\n-x Unix sockets\n-e Extended info\n-n Don't resolve names\n-W Wide display\n-p Show PID/program name of sockets"
-
-#define HELP_netcat_listen "usage: netcat [-t] [-lL COMMAND...]\n\n-l Listen for one incoming connection\n-L Listen for multiple incoming connections (server mode)\n-t Allocate tty (must come before -l or -L)\n\nThe command line after -l or -L is executed (as a child process) to handle\neach incoming connection. If blank -l waits for a connection and forwards\nit to stdin/stdout. If no -p specified, -l prints port it bound to and\nbackgrounds itself (returning immediately).\n\nFor a quick-and-dirty server, try something like:\nnetcat -s 127.0.0.1 -p 1234 -tL /bin/bash -l"
-
-#define HELP_netcat "usage: netcat [-46U] [-u] [-wpq #] [-s addr] {IPADDR PORTNUM|-f FILENAME}\n\nForward stdin/stdout to a file or network connection.\n\n-4 Force IPv4\n-6 Force IPv6\n-f Use FILENAME (ala /dev/ttyS0) instead of network\n-p Local port number\n-q Quit SECONDS after EOF on stdin, even if stdout hasn't closed yet\n-s Local source address\n-u Use UDP\n-U Use a UNIX domain socket\n-w SECONDS timeout to establish connection\n-W SECONDS timeout for more data on an idle connection\n\nUse \"stty 115200 -F /dev/ttyS0 && stty raw -echo -ctlecho\" with\nnetcat -f to connect to a serial port."
-
-#define HELP_microcom "usage: microcom [-s SPEED] [-X] DEVICE\n\nSimple serial console.\n\n-s Set baud rate to SPEED\n-X Ignore ^@ (send break) and ^] (exit)"
-
-#define HELP_ifconfig "usage: ifconfig [-aS] [INTERFACE [ACTION...]]\n\nDisplay or configure network interface.\n\nWith no arguments, display active interfaces. First argument is interface\nto operate on, one argument by itself displays that interface.\n\n-a All interfaces displayed, not just active ones\n-S Short view, one line per interface\n\nStandard ACTIONs to perform on an INTERFACE:\n\nADDR[/MASK] - set IPv4 address (1.2.3.4/5) and activate interface\nadd|del ADDR[/LEN] - add/remove IPv6 address (1111::8888/128)\nup|down - activate or deactivate interface\n\nAdvanced ACTIONs (default values usually suffice):\n\ndefault - remove IPv4 address\nnetmask ADDR - set IPv4 netmask via 255.255.255.0 instead of /24\ntxqueuelen LEN - number of buffered packets before output blocks\nmtu LEN - size of outgoing packets (Maximum Transmission Unit)\nbroadcast ADDR - Set broadcast address\npointopoint ADDR - PPP and PPPOE use this instead of \"route add default gw\"\nhw TYPE ADDR - set hardware (mac) address (type = ether|infiniband)\n\nFlags you can set on an interface (or -remove by prefixing with -):\n\narp - don't use Address Resolution Protocol to map LAN routes\npromisc - don't discard packets that aren't to this LAN hardware address\nmulticast - force interface into multicast mode if the driver doesn't\nallmulti - promisc for multicast packets"
-
-#define HELP_ftpput "An ftpget that defaults to -s instead of -g"
-
-#define HELP_ftpget "usage: ftpget [-cvgslLmMdD] [-P PORT] [-p PASSWORD] [-u USER] HOST [LOCAL] REMOTE\n\nTalk to ftp server. By default get REMOTE file via passive anonymous\ntransfer, optionally saving under a LOCAL name. Can also send, list, etc.\n\n-c Continue partial transfer\n-p Use PORT instead of \"21\"\n-P Use PASSWORD instead of \"ftpget@\"\n-u Use USER instead of \"anonymous\"\n-v Verbose\n\nWays to interact with FTP server:\n-d Delete file\n-D Remove directory\n-g Get file (default)\n-l List directory\n-L List (filenames only)\n-m Move file on server from LOCAL to REMOTE\n-M mkdir\n-s Send file"
-
-#define HELP_yes "usage: yes [args...]\n\nRepeatedly output line until killed. If no args, output 'y'."
-
-#define HELP_xxd "usage: xxd [-c n] [-g n] [-i] [-l n] [-o n] [-p] [-r] [-s n] [file]\n\nHexdump a file to stdout. If no file is listed, copy from stdin.\nFilename \"-\" is a synonym for stdin.\n\n-c n Show n bytes per line (default 16)\n-g n Group bytes by adding a ' ' every n bytes (default 2)\n-i Include file output format (comma-separated hex byte literals)\n-l n Limit of n bytes before stopping (default is no limit)\n-o n Add n to display offset\n-p Plain hexdump (30 bytes/line, no grouping)\n-r Reverse operation: turn a hexdump into a binary file\n-s n Skip to offset n"
-
-#define HELP_which "usage: which [-a] filename ...\n\nSearch $PATH for executable files matching filename(s).\n\n-a Show all matches"
-
-#define HELP_watch "usage: watch [-teb] [-n SEC] PROG ARGS\n\nRun PROG every -n seconds, showing output. Hit q to quit.\n\n-n Loop period in seconds (default 2)\n-t Don't print header\n-e Exit on error\n-b Beep on command error\n-x Exec command directly (vs \"sh -c\")"
-
-#define HELP_w "usage: w\n\nShow who is logged on and since how long they logged in."
-
-#define HELP_vmstat "usage: vmstat [-n] [DELAY [COUNT]]\n\nPrint virtual memory statistics, repeating each DELAY seconds, COUNT times.\n(With no DELAY, prints one line. With no COUNT, repeats until killed.)\n\nShow processes running and blocked, kilobytes swapped, free, buffered, and\ncached, kilobytes swapped in and out per second, file disk blocks input and\noutput per second, interrupts and context switches per second, percent\nof CPU time spent running user code, system code, idle, and awaiting I/O.\nFirst line is since system started, later lines are since last line.\n\n-n Display the header only once"
-
-#define HELP_vconfig "usage: vconfig COMMAND [OPTIONS]\n\nCreate and remove virtual ethernet devices\n\nadd [interface-name] [vlan_id]\nrem [vlan-name]\nset_flag [interface-name] [flag-num] [0 | 1]\nset_egress_map [vlan-name] [skb_priority] [vlan_qos]\nset_ingress_map [vlan-name] [skb_priority] [vlan_qos]\nset_name_type [name-type]"
-
-#define HELP_uuidgen "usage: uuidgen\n\nCreate and print a new RFC4122 random UUID."
-
-#define HELP_usleep "usage: usleep MICROSECONDS\n\nPause for MICROSECONDS microseconds."
-
-#define HELP_uptime "usage: uptime [-ps]\n\nTell the current time, how long the system has been running, the number\nof users, and the system load averages for the past 1, 5 and 15 minutes.\n\n-p Pretty (human readable) uptime\n-s Since when has the system been up?"
-
-#define HELP_truncate "usage: truncate [-c] -s SIZE file...\n\nSet length of file(s), extending sparsely if necessary.\n\n-c Don't create file if it doesn't exist\n-s New size (with optional prefix and suffix)\n\nSIZE prefix: + add, - subtract, < shrink to, > expand to,\n / multiple rounding down, % multiple rounding up\nSIZE suffix: k=1024, m=1024^2, g=1024^3, t=1024^4, p=1024^5, e=1024^6"
-
-#define HELP_timeout "usage: timeout [-k DURATION] [-s SIGNAL] DURATION COMMAND...\n\nRun command line as a child process, sending child a signal if the\ncommand doesn't exit soon enough.\n\nDURATION can be a decimal fraction. An optional suffix can be \"m\"\n(minutes), \"h\" (hours), \"d\" (days), or \"s\" (seconds, the default).\n\n-s Send specified signal (default TERM)\n-k Send KILL signal if child still running this long after first signal\n-v Verbose\n--foreground Don't create new process group\n--preserve-status Exit with the child's exit status"
-
-#define HELP_taskset "usage: taskset [-ap] [mask] [PID | cmd [args...]]\n\nLaunch a new task which may only run on certain processors, or change\nthe processor affinity of an existing PID.\n\nMask is a hex string where each bit represents a processor the process\nis allowed to run on. PID without a mask displays existing affinity.\n\n-p Set/get the affinity of given PID instead of a new command\n-a Set/get the affinity of all threads of the PID"
-
-#define HELP_nproc "usage: nproc [--all]\n\nPrint number of processors.\n\n--all Show all processors, not just ones this task can run on"
-
-#define HELP_tac "usage: tac [FILE...]\n\nOutput lines in reverse order."
-
-#define HELP_sysctl "usage: sysctl [-aAeNnqw] [-p [FILE] | KEY[=VALUE]...]\n\nRead/write system control data (under /proc/sys).\n\n-a,A Show all values\n-e Don't warn about unknown keys\n-N Don't print key values\n-n Don't print key names\n-p Read values from FILE (default /etc/sysctl.conf)\n-q Don't show value after write\n-w Only write values (object to reading)"
-
-#define HELP_switch_root "usage: switch_root [-c /dev/console] NEW_ROOT NEW_INIT...\n\nUse from PID 1 under initramfs to free initramfs, chroot to NEW_ROOT,\nand exec NEW_INIT.\n\n-c Redirect console to device in NEW_ROOT\n-h Hang instead of exiting on failure (avoids kernel panic)"
-
-#define HELP_swapon "usage: swapon [-d] [-p priority] filename\n\nEnable swapping on a given device/file.\n\n-d Discard freed SSD pages\n-p Priority (highest priority areas allocated first)"
-
-#define HELP_swapoff "usage: swapoff swapregion\n\nDisable swapping on a given swapregion."
-
-#define HELP_stat "usage: stat [-tfL] [-c FORMAT] FILE...\n\nDisplay status of files or filesystems.\n\n-c Output specified FORMAT string instead of default\n-f Display filesystem status instead of file status\n-L Follow symlinks\n-t terse (-c \"%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o\")\n (with -f = -c \"%n %i %l %t %s %S %b %f %a %c %d\")\n\nThe valid format escape sequences for files:\n%a Access bits (octal) |%A Access bits (flags)|%b Size/512\n%B Bytes per %b (512) |%C Security context |%d Device ID (dec)\n%D Device ID (hex) |%f All mode bits (hex)|%F File type\n%g Group ID |%G Group name |%h Hard links\n%i Inode |%m Mount point |%n Filename\n%N Long filename |%o I/O block size |%s Size (bytes)\n%t Devtype major (hex) |%T Devtype minor (hex)|%u User ID\n%U User name |%x Access time |%X Access unix time\n%y Modification time |%Y Mod unix time |%z Creation time\n%Z Creation unix time\n\nThe valid format escape sequences for filesystems:\n%a Available blocks |%b Total blocks |%c Total inodes\n%d Free inodes |%f Free blocks |%i File system ID\n%l Max filename length |%n File name |%s Fragment size\n%S Best transfer size |%t FS type (hex) |%T FS type (driver name)"
-
-#define HELP_shred "usage: shred [-fuz] [-n COUNT] [-s SIZE] FILE...\n\nSecurely delete a file by overwriting its contents with random data.\n\n-f Force (chmod if necessary)\n-n COUNT Random overwrite iterations (default 1)\n-o OFFSET Start at OFFSET\n-s SIZE Use SIZE instead of detecting file size\n-u Unlink (actually delete file when done)\n-x Use exact size (default without -s rounds up to next 4k)\n-z Zero at end\n\nNote: data journaling filesystems render this command useless, you must\noverwrite all free space (fill up disk) to erase old data on those."
-
-#define HELP_setsid "usage: setsid [-t] command [args...]\n\nRun process in a new session.\n\n-t Grab tty (become foreground process, receiving keyboard signals)"
-
-#define HELP_setfattr "usage: setfattr [-h] [-x|-n NAME] [-v VALUE] FILE...\n\nWrite POSIX extended attributes.\n\n-h Do not dereference symlink\n-n Set given attribute\n-x Remove given attribute\n-v Set value for attribute -n (default is empty)"
-
-#define HELP_rmmod "usage: rmmod [-wf] [MODULE]\n\nUnload the module named MODULE from the Linux kernel.\n-f Force unload of a module\n-w Wait until the module is no longer used"
-
-#define HELP_rev "usage: rev [FILE...]\n\nOutput each line reversed, when no files are given stdin is used."
-
-#define HELP_reset "usage: reset\n\nReset the terminal."
-
-#define HELP_reboot "usage: reboot/halt/poweroff [-fn]\n\nRestart, halt or powerdown the system.\n\n-f Don't signal init\n-n Don't sync before stopping the system"
-
-#define HELP_realpath "usage: realpath FILE...\n\nDisplay the canonical absolute pathname"
-
-#define HELP_readlink "usage: readlink FILE...\n\nWith no options, show what symlink points to, return error if not symlink.\n\nOptions for producing canonical paths (all symlinks/./.. resolved):\n\n-e Canonical path to existing entry (fail if missing)\n-f Full path (fail if directory missing)\n-m Ignore missing entries, show where it would be\n-n No trailing newline\n-q Quiet (no output, just error code)"
-
-#define HELP_readahead "usage: readahead FILE...\n\nPreload files into disk cache."
-
-#define HELP_pwdx "usage: pwdx PID...\n\nPrint working directory of processes listed on command line."
-
-#define HELP_printenv "usage: printenv [-0] [env_var...]\n\nPrint environment variables.\n\n-0 Use \\0 as delimiter instead of \\n"
-
-#define HELP_pmap "usage: pmap [-xq] [pids...]\n\nReport the memory map of a process or processes.\n\n-x Show the extended format\n-q Do not display some header/footer lines"
-
-#define HELP_pivot_root "usage: pivot_root OLD NEW\n\nSwap OLD and NEW filesystems (as if by simultaneous mount --move), and\nmove all processes with chdir or chroot under OLD into NEW (including\nkernel threads) so OLD may be unmounted.\n\nThe directory NEW must exist under OLD. This doesn't work on initramfs,\nwhich can't be moved (about the same way PID 1 can't be killed; see\nswitch_root instead)."
-
-#define HELP_partprobe "usage: partprobe DEVICE...\n\nTell the kernel about partition table changes\n\nAsk the kernel to re-read the partition table on the specified devices."
-
-#define HELP_oneit "usage: oneit [-p] [-c /dev/tty0] command [...]\n\nSimple init program that runs a single supplied command line with a\ncontrolling tty (so CTRL-C can kill it).\n\n-c Which console device to use (/dev/console doesn't do CTRL-C, etc)\n-p Power off instead of rebooting when command exits\n-r Restart child when it exits\n-3 Write 32 bit PID of each exiting reparented process to fd 3 of child\n (Blocking writes, child must read to avoid eventual deadlock.)\n\nSpawns a single child process (because PID 1 has signals blocked)\nin its own session, reaps zombies until the child exits, then\nreboots the system (or powers off with -p, or restarts the child with -r).\n\nResponds to SIGUSR1 by halting the system, SIGUSR2 by powering off,\nand SIGTERM or SIGINT reboot."
-
-#define HELP_nsenter "usage: nsenter [-t pid] [-F] [-i] [-m] [-n] [-p] [-u] [-U] COMMAND...\n\nRun COMMAND in an existing (set of) namespace(s).\n\n-t PID to take namespaces from (--target)\n-F don't fork, even if -p is used (--no-fork)\n\nThe namespaces to switch are:\n\n-i SysV IPC: message queues, semaphores, shared memory (--ipc)\n-m Mount/unmount tree (--mount)\n-n Network address, sockets, routing, iptables (--net)\n-p Process IDs and init, will fork unless -F is used (--pid)\n-u Host and domain names (--uts)\n-U UIDs, GIDs, capabilities (--user)\n\nIf -t isn't specified, each namespace argument must provide a path\nto a namespace file, ala \"-i=/proc/$PID/ns/ipc\""
-
-#define HELP_unshare "usage: unshare [-imnpuUr] COMMAND...\n\nCreate new container namespace(s) for this process and its children, so\nsome attribute is not shared with the parent process.\n\n-f Fork command in the background (--fork)\n-i SysV IPC (message queues, semaphores, shared memory) (--ipc)\n-m Mount/unmount tree (--mount)\n-n Network address, sockets, routing, iptables (--net)\n-p Process IDs and init (--pid)\n-r Become root (map current euid/egid to 0/0, implies -U) (--map-root-user)\n-u Host and domain names (--uts)\n-U UIDs, GIDs, capabilities (--user)\n\nA namespace allows a set of processes to have a different view of the\nsystem than other sets of processes."
-
-#define HELP_nbd_client "usage: nbd-client [-ns] HOST PORT DEVICE\n\n-n Do not fork into background\n-s nbd swap support (lock server into memory)"
-
-#define HELP_mountpoint "usage: mountpoint [-qd] DIR\n mountpoint [-qx] DEVICE\n\nCheck whether the directory or device is a mountpoint.\n\n-q Be quiet, return zero if directory is a mountpoint\n-d Print major/minor device number of the directory\n-x Print major/minor device number of the block device"
-
-#define HELP_modinfo "usage: modinfo [-0] [-b basedir] [-k kernel] [-F field] [module|file...]\n\nDisplay module fields for modules specified by name or .ko path.\n\n-F Only show the given field\n-0 Separate fields with NUL rather than newline\n-b Use <basedir> as root for /lib/modules/\n-k Look in given directory under /lib/modules/"
-
-#define HELP_mkswap "usage: mkswap [-L LABEL] DEVICE\n\nSet up a Linux swap area on a device or file."
-
-#define HELP_mkpasswd "usage: mkpasswd [-P FD] [-m TYPE] [-S SALT] [PASSWORD] [SALT]\n\nCrypt PASSWORD using crypt(3)\n\n-P FD Read password from file descriptor FD\n-m TYPE Encryption method (des, md5, sha256, or sha512; default is des)\n-S SALT"
-
-#define HELP_mix "usage: mix [-d DEV] [-c CHANNEL] [-l VOL] [-r RIGHT]\n\nList OSS sound channels (module snd-mixer-oss), or set volume(s).\n\n-c CHANNEL Set/show volume of CHANNEL (default first channel found)\n-d DEV Device node (default /dev/mixer)\n-l VOL Volume level\n-r RIGHT Volume of right stereo channel (with -r, -l sets left volume)"
-
-#define HELP_mcookie "usage: mcookie [-vV]\n\nGenerate a 128-bit strong random number.\n\n-v show entropy source (verbose)\n-V show version"
-
-#define HELP_makedevs "usage: makedevs [-d device_table] rootdir\n\nCreate a range of special files as specified in a device table.\n\n-d File containing device table (default reads from stdin)\n\nEach line of the device table has the fields:\n<name> <type> <mode> <uid> <gid> <major> <minor> <start> <increment> <count>\nWhere name is the file name, and type is one of the following:\n\nb Block device\nc Character device\nd Directory\nf Regular file\np Named pipe (fifo)\n\nOther fields specify permissions, user and group id owning the file,\nand additional fields for device special files. Use '-' for blank entries,\nunspecified fields are treated as '-'."
-
-#define HELP_lsusb "usage: lsusb\n\nList USB hosts/devices."
-
-#define HELP_lspci_text "usage: lspci [-n] [-i FILE ]\n\n-n Numeric output (repeat for readable and numeric)\n-i PCI ID database (default /usr/share/misc/pci.ids)"
-
-#define HELP_lspci "usage: lspci [-ekm]\n\nList PCI devices.\n\n-e Print all 6 digits in class\n-k Print kernel driver\n-m Machine parseable format"
-
-#define HELP_lsmod "usage: lsmod\n\nDisplay the currently loaded modules, their sizes and their dependencies."
-
-#define HELP_chattr "usage: chattr [-R] [-+=AacDdijsStTu] [-v version] [File...]\n\nChange file attributes on a Linux second extended file system.\n\n-R Recurse\n-v Set the file's version/generation number\n\nOperators:\n '-' Remove attributes\n '+' Add attributes\n '=' Set attributes\n\nAttributes:\n A Don't track atime\n a Append mode only\n c Enable compress\n D Write dir contents synchronously\n d Don't backup with dump\n i Cannot be modified (immutable)\n j Write all data to journal first\n s Zero disk storage when deleted\n S Write file contents synchronously\n t Disable tail-merging of partial blocks with other files\n u Allow file to be undeleted"
-
-#define HELP_lsattr "usage: lsattr [-Radlv] [Files...]\n\nList file attributes on a Linux second extended file system.\n(AacDdijsStu defined in chattr --help)\n\n-R Recursively list attributes of directories and their contents\n-a List all files in directories, including files that start with '.'\n-d List directories like other files, rather than listing their contents\n-l List long flag names\n-v List the file's version/generation number"
-
-#define HELP_losetup "usage: losetup [-cdrs] [-o OFFSET] [-S SIZE] {-d DEVICE...|-j FILE|-af|{DEVICE FILE}}\n\nAssociate a loopback device with a file, or show current file (if any)\nassociated with a loop device.\n\nInstead of a device:\n-a Iterate through all loopback devices\n-f Find first unused loop device (may create one)\n-j FILE Iterate through all loopback devices associated with FILE\n\nexisting:\n-c Check capacity (file size changed)\n-d DEV Detach loopback device\n-D Detach all loopback devices\n\nnew:\n-s Show device name (alias --show)\n-o OFF Start association at offset OFF into FILE\n-r Read only\n-S SIZE Limit SIZE of loopback association (alias --sizelimit)"
-
-#define HELP_login "usage: login [-p] [-h host] [-f USERNAME] [USERNAME]\n\nLog in as a user, prompting for username and password if necessary.\n\n-p Preserve environment\n-h The name of the remote host for this login\n-f login as USERNAME without authentication"
-
-#define HELP_iorenice "usage: iorenice PID [CLASS] [PRIORITY]\n\nDisplay or change I/O priority of existing process. CLASS can be\n\"rt\" for realtime, \"be\" for best effort, \"idle\" for only when idle, or\n\"none\" to leave it alone. PRIORITY can be 0-7 (0 is highest, default 4)."
-
-#define HELP_ionice "usage: ionice [-t] [-c CLASS] [-n LEVEL] [COMMAND...|-p PID]\n\nChange the I/O scheduling priority of a process. With no arguments\n(or just -p), display process' existing I/O class/priority.\n\n-c CLASS = 1-3: 1(realtime), 2(best-effort, default), 3(when-idle)\n-n LEVEL = 0-7: (0 is highest priority, default = 5)\n-p Affect existing PID instead of spawning new child\n-t Ignore failure to set I/O priority\n\nSystem default iopriority is generally -c 2 -n 4."
-
-#define HELP_insmod "usage: insmod MODULE [MODULE_OPTIONS]\n\nLoad the module named MODULE passing options if given."
-
-#define HELP_inotifyd "usage: inotifyd PROG FILE[:MASK] ...\n\nWhen a filesystem event matching MASK occurs to a FILE, run PROG as:\n\n PROG EVENTS FILE [DIRFILE]\n\nIf PROG is \"-\" events are sent to stdout.\n\nThis file is:\n a accessed c modified e metadata change w closed (writable)\n r opened D deleted M moved 0 closed (unwritable)\n u unmounted o overflow x unwatchable\n\nA file in this directory is:\n m moved in y moved out n created d deleted\n\nWhen x event happens for all FILEs, inotifyd exits (after waiting for PROG)."
-
-#define HELP_i2cset "usage: i2cset [-fy] BUS CHIP ADDR VALUE... MODE\n\nWrite an i2c register. MODE is b for byte, w for 16-bit word, i for I2C block.\n\n-f Force access to busy devices\n-y Answer \"yes\" to confirmation prompts (for script use)"
-
-#define HELP_i2cget "usage: i2cget [-fy] BUS CHIP ADDR\n\nRead an i2c register.\n\n-f Force access to busy devices\n-y Answer \"yes\" to confirmation prompts (for script use)"
-
-#define HELP_i2cdump "usage: i2cdump [-fy] BUS CHIP\n\nDump i2c registers.\n\n-f Force access to busy devices\n-y Answer \"yes\" to confirmation prompts (for script use)"
-
-#define HELP_i2cdetect "usage: i2cdetect [-ary] BUS [FIRST LAST]\nusage: i2cdetect -F BUS\nusage: i2cdetect -l\n\nDetect i2c devices.\n\n-a All addresses (0x00-0x7f rather than 0x03-0x77)\n-F Show functionality\n-l List all buses\n-r Probe with SMBus Read Byte\n-y Answer \"yes\" to confirmation prompts (for script use)"
-
-#define HELP_hwclock "usage: hwclock [-rswtluf]\n\nGet/set the hardware clock.\n\n-f FILE Use specified device file instead of /dev/rtc (--rtc)\n-l Hardware clock uses localtime (--localtime)\n-r Show hardware clock time (--show)\n-s Set system time from hardware clock (--hctosys)\n-t Set the system time based on the current timezone (--systz)\n-u Hardware clock uses UTC (--utc)\n-w Set hardware clock from system time (--systohc)"
-
-#define HELP_hexedit "usage: hexedit FILENAME\n\nHexadecimal file editor. All changes are written to disk immediately.\n\n-r Read only (display but don't edit)\n\nKeys:\nArrows Move left/right/up/down by one line/column\nPg Up/Pg Dn Move up/down by one page\n0-9, a-f Change current half-byte to hexadecimal value\nu Undo\nq/^c/^d/<esc> Quit"
-
-#define HELP_help_extras "usage: help [-ah]\n\n-a All commands\n-h HTML output"
-
-#define HELP_help "usage: help [command]\n\nShow usage information for toybox commands.\nRun \"toybox\" with no arguments for a list of available commands."
-
-#define HELP_fsync "usage: fsync [-d] [FILE...]\n\nSynchronize a file's in-core state with storage device.\n\n-d Avoid syncing metadata"
-
-#define HELP_fsfreeze "usage: fsfreeze {-f | -u} MOUNTPOINT\n\nFreeze or unfreeze a filesystem.\n\n-f Freeze\n-u Unfreeze"
-
-#define HELP_freeramdisk "usage: freeramdisk [RAM device]\n\nFree all memory allocated to specified ramdisk"
-
-#define HELP_free "usage: free [-bkmgt]\n\nDisplay the total, free and used amount of physical memory and swap space.\n\n-bkmgt Output units (default is bytes)\n-h Human readable (K=1024)"
-
-#define HELP_fmt "usage: fmt [-w WIDTH] [FILE...]\n\nReformat input to wordwrap at a given line length, preserving existing\nindentation level, writing to stdout.\n\n-w WIDTH Maximum characters per line (default 75)"
-
-#define HELP_flock "usage: flock [-sxun] fd\n\nManage advisory file locks.\n\n-s Shared lock\n-x Exclusive lock (default)\n-u Unlock\n-n Non-blocking: fail rather than wait for the lock"
-
-#define HELP_fallocate "usage: fallocate [-l size] [-o offset] file\n\nTell the filesystem to allocate space for a file."
-
-#define HELP_factor "usage: factor NUMBER...\n\nFactor integers."
-
-#define HELP_eject "usage: eject [-stT] [DEVICE]\n\nEject DEVICE or default /dev/cdrom\n\n-s SCSI device\n-t Close tray\n-T Open/close tray (toggle)"
-
-#define HELP_unix2dos "usage: unix2dos [FILE...]\n\nConvert newline format from unix \"\\n\" to dos \"\\r\\n\".\nIf no files listed copy from stdin, \"-\" is a synonym for stdin."
-
-#define HELP_dos2unix "usage: dos2unix [FILE...]\n\nConvert newline format from dos \"\\r\\n\" to unix \"\\n\".\nIf no files listed copy from stdin, \"-\" is a synonym for stdin."
-
-#define HELP_devmem "usage: devmem ADDR [WIDTH [DATA]]\n\nRead/write physical address via /dev/mem.\n\nWIDTH is 1, 2, 4, or 8 bytes (default 4)."
-
-#define HELP_count "usage: count\n\nCopy stdin to stdout, displaying simple progress indicator to stderr."
-
-#define HELP_clear "Clear the screen."
-
-#define HELP_chvt "usage: chvt N\n\nChange to virtual terminal number N. (This only works in text mode.)\n\nVirtual terminals are the Linux VGA text mode displays, ordinarily\nswitched between via alt-F1, alt-F2, etc. Use ctrl-alt-F1 to switch\nfrom X to a virtual terminal, and alt-F6 (or F7, or F8) to get back."
-
-#define HELP_chrt "usage: chrt [-Rmofrbi] {-p PID [PRIORITY] | [PRIORITY COMMAND...]}\n\nGet/set a process' real-time scheduling policy and priority.\n\n-p Set/query given pid (instead of running COMMAND)\n-R Set SCHED_RESET_ON_FORK\n-m Show min/max priorities available\n\nSet policy (default -r):\n\n -o SCHED_OTHER -f SCHED_FIFO -r SCHED_RR\n -b SCHED_BATCH -i SCHED_IDLE"
-
-#define HELP_chroot "usage: chroot NEWROOT [COMMAND [ARG...]]\n\nRun command within a new root directory. If no command, run /bin/sh."
-
-#define HELP_chcon "usage: chcon [-hRv] CONTEXT FILE...\n\nChange the SELinux security context of listed file[s].\n\n-h Change symlinks instead of what they point to\n-R Recurse into subdirectories\n-v Verbose"
-
-#define HELP_bzcat "usage: bzcat [FILE...]\n\nDecompress listed files to stdout. Use stdin if no files listed."
-
-#define HELP_bunzip2 "usage: bunzip2 [-cftkv] [FILE...]\n\nDecompress listed files (file.bz becomes file) deleting archive file(s).\nRead from stdin if no files listed.\n\n-c Force output to stdout\n-f Force decompression (if FILE doesn't end in .bz, replace original)\n-k Keep input files (-c and -t imply this)\n-t Test integrity\n-v Verbose"
-
-#define HELP_blockdev "usage: blockdev --OPTION... BLOCKDEV...\n\nCall ioctl(s) on each listed block device\n\n--setro Set read only\n--setrw Set read write\n--getro Get read only\n--getss Get sector size\n--getbsz Get block size\n--setbsz BYTES Set block size\n--getsz Get device size in 512-byte sectors\n--getsize Get device size in sectors (deprecated)\n--getsize64 Get device size in bytes\n--getra Get readahead in 512-byte sectors\n--setra SECTORS Set readahead\n--flushbufs Flush buffers\n--rereadpt Reread partition table"
-
-#define HELP_fstype "usage: fstype DEV...\n\nPrint type of filesystem on a block device or image."
-
-#define HELP_blkid "usage: blkid [-s TAG] [-UL] DEV...\n\nPrint type, label and UUID of filesystem on a block device or image.\n\n-U Show UUID only (or device with that UUID)\n-L Show LABEL only (or device with that LABEL)\n-s TAG Only show matching tags (default all)"
-
-#define HELP_base64 "usage: base64 [-di] [-w COLUMNS] [FILE...]\n\nEncode or decode in base64.\n\n-d Decode\n-i Ignore non-alphabetic characters\n-w Wrap output at COLUMNS (default 76 or 0 for no wrap)"
-
-#define HELP_ascii "usage: ascii\n\nDisplay ascii character set."
-
-#define HELP_acpi "usage: acpi [-abctV]\n\nShow status of power sources and thermal devices.\n\n-a Show power adapters\n-b Show batteries\n-c Show cooling device state\n-t Show temperatures\n-V Show everything"
-
-#define HELP_xzcat "usage: xzcat [filename...]\n\nDecompress listed files to stdout. Use stdin if no files listed."
-
-#define HELP_wget "usage: wget -O filename URL\n-O filename: specify output filename\nURL: uniform resource location, FTP/HTTP only, not HTTPS\n\nexamples:\n wget -O index.html http://www.example.com\n wget -O sample.jpg ftp://ftp.example.com:21/sample.jpg"
-
-#define HELP_vi "usage: vi FILE\nVisual text editor. Predates the existence of standardized cursor keys,\nso the controls are weird and historical."
-
-#define HELP_userdel "usage: userdel [-r] USER\nusage: deluser [-r] USER\n\nDelete USER from the SYSTEM\n\n-r remove home directory"
-
-#define HELP_useradd "usage: useradd [-SDH] [-h DIR] [-s SHELL] [-G GRP] [-g NAME] [-u UID] USER [GROUP]\n\nCreate new user, or add USER to GROUP\n\n-D Don't assign a password\n-g NAME Real name\n-G GRP Add user to existing group\n-h DIR Home directory\n-H Don't create home directory\n-s SHELL Login shell\n-S Create a system user\n-u UID User id"
-
-#define HELP_traceroute "usage: traceroute [-46FUIldnvr] [-f 1ST_TTL] [-m MAXTTL] [-p PORT] [-q PROBES]\n[-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-g GATEWAY] [-i IFACE] [-z PAUSE_MSEC] HOST [BYTES]\n\ntraceroute6 [-dnrv] [-m MAXTTL] [-p PORT] [-q PROBES][-s SRC_IP] [-t TOS] [-w WAIT_SEC]\n [-i IFACE] HOST [BYTES]\n\nTrace the route to HOST\n\n-4,-6 Force IP or IPv6 name resolution\n-F Set the don't fragment bit (supports IPV4 only)\n-U Use UDP datagrams instead of ICMP ECHO (supports IPV4 only)\n-I Use ICMP ECHO instead of UDP datagrams (supports IPV4 only)\n-l Display the TTL value of the returned packet (supports IPV4 only)\n-d Set SO_DEBUG options to socket\n-n Print numeric addresses\n-v verbose\n-r Bypass routing tables, send directly to HOST\n-m Max time-to-live (max number of hops)(RANGE 1 to 255)\n-p Base UDP port number used in probes(default 33434)(RANGE 1 to 65535)\n-q Number of probes per TTL (default 3)(RANGE 1 to 255)\n-s IP address to use as the source address\n-t Type-of-service in probe packets (default 0)(RANGE 0 to 255)\n-w Time in seconds to wait for a response (default 3)(RANGE 0 to 86400)\n-g Loose source route gateway (8 max) (supports IPV4 only)\n-z Pause Time in ms (default 0)(RANGE 0 to 86400) (supports IPV4 only)\n-f Start from the 1ST_TTL hop (instead from 1)(RANGE 1 to 255) (supports IPV4 only)\n-i Specify a network interface to operate with"
-
-#define HELP_tr "usage: tr [-cds] SET1 [SET2]\n\nTranslate, squeeze, or delete characters from stdin, writing to stdout\n\n-c/-C Take complement of SET1\n-d Delete input characters coded SET1\n-s Squeeze multiple output characters of SET2 into one character"
-
-#define HELP_tftpd "usage: tftpd [-cr] [-u USER] [DIR]\n\nTransfer file from/to tftp server.\n\n-r read only\n-c Allow file creation via upload\n-u run as USER\n-l Log to syslog (inetd mode requires this)"
-
-#define HELP_tftp "usage: tftp [OPTIONS] HOST [PORT]\n\nTransfer file from/to tftp server.\n\n-l FILE Local FILE\n-r FILE Remote FILE\n-g Get file\n-p Put file\n-b SIZE Transfer blocks of SIZE octets(8 <= SIZE <= 65464)"
-
-#define HELP_telnetd "Handle incoming telnet connections\n\n-l LOGIN Exec LOGIN on connect\n-f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue\n-K Close connection as soon as login exits\n-p PORT Port to listen on\n-b ADDR[:PORT] Address to bind to\n-F Run in foreground\n-i Inetd mode\n-w SEC Inetd 'wait' mode, linger time SEC\n-S Log to syslog (implied by -i or without -F and -w)"
-
-#define HELP_telnet "usage: telnet HOST [PORT]\n\nConnect to telnet server"
-
-#define HELP_tcpsvd "usage: tcpsvd [-hEv] [-c N] [-C N[:MSG]] [-b N] [-u User] [-l Name] IP Port Prog\nusage: udpsvd [-hEv] [-c N] [-u User] [-l Name] IP Port Prog\n\nCreate TCP/UDP socket, bind to IP:PORT and listen for incoming connection.\nRun PROG for each connection.\n\nIP IP to listen on, 0 = all\nPORT Port to listen on\nPROG ARGS Program to run\n-l NAME Local hostname (else looks up local hostname in DNS)\n-u USER[:GRP] Change to user/group after bind\n-c N Handle up to N (> 0) connections simultaneously\n-b N (TCP Only) Allow a backlog of approximately N TCP SYNs\n-C N[:MSG] (TCP Only) Allow only up to N (> 0) connections from the same IP\n New connections from this IP address are closed\n immediately. MSG is written to the peer before close\n-h Look up peer's hostname\n-E Don't set up environment variables\n-v Verbose"
-
-#define HELP_syslogd "usage: syslogd [-a socket] [-O logfile] [-f config file] [-m interval]\n [-p socket] [-s SIZE] [-b N] [-R HOST] [-l N] [-nSLKD]\n\nSystem logging utility\n\n-a Extra unix socket for listen\n-O FILE Default log file <DEFAULT: /var/log/messages>\n-f FILE Config file <DEFAULT: /etc/syslog.conf>\n-p Alternative unix domain socket <DEFAULT : /dev/log>\n-n Avoid auto-backgrounding\n-S Smaller output\n-m MARK interval <DEFAULT: 20 minutes> (RANGE: 0 to 71582787)\n-R HOST Log to IP or hostname on PORT (default PORT=514/UDP)\"\n-L Log locally and via network (default is network only if -R)\"\n-s SIZE Max size (KB) before rotation (default:200KB, 0=off)\n-b N rotated logs to keep (default:1, max=99, 0=purge)\n-K Log to kernel printk buffer (use dmesg to read it)\n-l N Log only messages more urgent than prio(default:8 max:8 min:1)\n-D Drop duplicates"
-
-#define HELP_sulogin "usage: sulogin [-t time] [tty]\n\nSingle User Login.\n-t Default Time for Single User Login"
-
-#define HELP_stty "usage: stty [-ag] [-F device] SETTING...\n\nGet/set terminal configuration.\n\n-F Open device instead of stdin\n-a Show all current settings (default differences from \"sane\")\n-g Show all current settings usable as input to stty\n\nSpecial characters (syntax ^c or undef): intr quit erase kill eof eol eol2\nswtch start stop susp rprnt werase lnext discard\n\nControl/input/output/local settings as shown by -a, '-' prefix to disable\n\nCombo settings: cooked/raw, evenp/oddp/parity, nl, ek, sane\n\nN set input and output speed (ispeed N or ospeed N for just one)\ncols N set number of columns\nrows N set number of rows\nline N set line discipline\nmin N set minimum chars per read\ntime N set read timeout\nspeed show speed only\nsize show size only"
-
-#define HELP_exit "usage: exit [status]\n\nExit shell. If no return value supplied on command line, use value\nof most recent command, or 0 if none."
-
-#define HELP_cd "usage: cd [-PL] [path]\n\nChange current directory. With no arguments, go $HOME.\n\n-P Physical path: resolve symlinks in path\n-L Local path: .. trims directories off $PWD (default)"
-
-#define HELP_sh "usage: sh [-c command] [script]\n\nCommand shell. Runs a shell script, or reads input interactively\nand responds to it.\n\n-c command line to execute\n-i interactive mode (default when STDIN is a tty)"
-
-#define HELP_route "usage: route [-ne] [-A [46]] [add|del TARGET [OPTIONS]]\n\nDisplay, add or delete network routes in the \"Forwarding Information Base\".\n\n-n Show numerical addresses (no DNS lookups)\n-e display netstat fields\n\nRouting means sending packets out a network interface to an address.\nThe kernel can tell where to send packets one hop away by examining each\ninterface's address and netmask, so the most common use of this command\nis to identify a \"gateway\" that forwards other traffic.\n\nAssigning an address to an interface automatically creates an appropriate\nnetwork route (\"ifconfig eth0 10.0.2.15/8\" does \"route add 10.0.0.0/8 eth0\"\nfor you), although some devices (such as loopback) won't show it in the\ntable. For machines more than one hop away, you need to specify a gateway\n(ala \"route add default gw 10.0.2.2\").\n\nThe address \"default\" is a wildcard address (0.0.0.0/0) matching all\npackets without a more specific route.\n\nAvailable OPTIONS include:\nreject - blocking route (force match failure)\ndev NAME - force packets out this interface (ala \"eth0\")\nnetmask - old way of saying things like ADDR/24\ngw ADDR - forward packets to gateway ADDR"
-
-#define HELP_deallocvt "usage: deallocvt [N]\n\nDeallocate unused virtual terminal /dev/ttyN, or all unused consoles."
-
-#define HELP_openvt "usage: openvt [-c N] [-sw] [command [command_options]]\n\nstart a program on a new virtual terminal (VT)\n\n-c N Use VT N\n-s Switch to new VT\n-w Wait for command to exit\n\nif -sw used together, switch back to originating VT when command completes"
-
-#define HELP_more "usage: more [FILE...]\n\nView FILE(s) (or stdin) one screenfull at a time."
-
-#define HELP_modprobe "usage: modprobe [-alrqvsDb] [-d DIR] MODULE [symbol=value][...]\n\nmodprobe utility - inserts modules and dependencies.\n\n-a Load multiple MODULEs\n-d Load modules from DIR, option may be used multiple times\n-l List (MODULE is a pattern)\n-r Remove MODULE (stacks) or do autoclean\n-q Quiet\n-v Verbose\n-s Log to syslog\n-D Show dependencies\n-b Apply blacklist to module names too"
-
-#define HELP_mke2fs_extended "usage: mke2fs [-E stride=###] [-O option[,option]]\n\n-E stride= Set RAID stripe size (in blocks)\n-O [opts] Specify fewer ext2 option flags (for old kernels)\n All of these are on by default (as appropriate)\n none Clear default options (all but journaling)\n dir_index Use htree indexes for large directories\n filetype Store file type info in directory entry\n has_journal Set by -j\n journal_dev Set by -J device=XXX\n sparse_super Don't allocate huge numbers of redundant superblocks"
-
-#define HELP_mke2fs_label "usage: mke2fs [-L label] [-M path] [-o string]\n\n-L Volume label\n-M Path to mount point\n-o Created by"
-
-#define HELP_mke2fs_gen "usage: gene2fs [options] device filename\n\nThe [options] are the same as mke2fs."
-
-#define HELP_mke2fs_journal "usage: mke2fs [-j] [-J size=###,device=XXX]\n\n-j Create journal (ext3)\n-J Journal options\n size: Number of blocks (1024-102400)\n device: Specify an external journal"
-
-#define HELP_mke2fs "usage: mke2fs [-Fnq] [-b ###] [-N|i ###] [-m ###] device\n\nCreate an ext2 filesystem on a block device or filesystem image.\n\n-F Force to run on a mounted device\n-n Don't write to device\n-q Quiet (no output)\n-b size Block size (1024, 2048, or 4096)\n-N inodes Allocate this many inodes\n-i bytes Allocate one inode for every XXX bytes of device\n-m percent Reserve this percent of filesystem space for root user"
-
-#define HELP_mdev_conf "The mdev config file (/etc/mdev.conf) contains lines that look like:\nhd[a-z][0-9]* 0:3 660\n(sd[a-z]) root:disk 660 =usb_storage\n\nEach line must contain three whitespace separated fields. The first\nfield is a regular expression matching one or more device names,\nthe second and third fields are uid:gid and file permissions for\nmatching devices. Fourth field is optional. It could be used to change\ndevice name (prefix '='), path (prefix '=' and postfix '/') or create a\nsymlink (prefix '>')."
-
-#define HELP_mdev "usage: mdev [-s]\n\nCreate devices in /dev using information from /sys.\n\n-s Scan all entries in /sys to populate /dev"
-
-#define HELP_man "usage: man [-M PATH] [-k STRING] | [SECTION] COMMAND\n\nRead manual page for system command.\n\n-k List pages with STRING in their short description\n-M Override $MANPATH\n\nMan pages are divided into 8 sections:\n1 commands 2 system calls 3 library functions 4 /dev files\n5 file formats 6 games 7 miscellaneous 8 system management\n\nSections are searched in the order 1 8 3 2 5 4 6 7 unless you specify a\nsection. Each section has a page called \"intro\", and there's a global\nintroduction under \"man-pages\"."
-
-#define HELP_lsof "usage: lsof [-lt] [-p PID1,PID2,...] [FILE...]\n\nList all open files belonging to all active processes, or processes using\nlisted FILE(s).\n\n-l list uids numerically\n-p for given comma-separated pids only (default all pids)\n-t terse (pid only) output"
-
-#define HELP_last "usage: last [-W] [-f FILE]\n\nShow listing of last logged in users.\n\n-W Display the information without host-column truncation\n-f FILE Read from file FILE instead of /var/log/wtmp"
-
-#define HELP_klogd "usage: klogd [-n] [-c N]\n\n-c N Print to console messages more urgent than prio N (1-8)\"\n-n Run in foreground"
-
-#define HELP_ipcs "usage: ipcs [[-smq] -i shmid] | [[-asmq] [-tcplu]]\n\n-i Show specific resource\nResource specification:\n-a All (default)\n-m Shared memory segments\n-q Message queues\n-s Semaphore arrays\nOutput format:\n-c Creator\n-l Limits\n-p Pid\n-t Time\n-u Summary"
-
-#define HELP_ipcrm "usage: ipcrm [ [-q msqid] [-m shmid] [-s semid]\n [-Q msgkey] [-M shmkey] [-S semkey] ... ]\n\n-mM Remove memory segment after last detach\n-qQ Remove message queue\n-sS Remove semaphore"
-
-#define HELP_ip "usage: ip [ OPTIONS ] OBJECT { COMMAND }\n\nShow / manipulate routing, devices, policy routing and tunnels.\n\nwhere OBJECT := {address | link | route | rule | tunnel}\nOPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }"
-
-#define HELP_init "usage: init\n\nSystem V style init.\n\nFirst program to run (as PID 1) when the system comes up, reading\n/etc/inittab to determine actions."
-
-#define HELP_host "usage: host [-av] [-t TYPE] NAME [SERVER]\n\nPerform DNS lookup on NAME, which can be a domain name to lookup,\nor an IPv4 dotted or IPv6 colon-separated address to reverse lookup.\nSERVER (if present) is the DNS server to use.\n\n-a -v -t ANY\n-t TYPE query records of type TYPE\n-v verbose"
-
-#define HELP_groupdel "usage: groupdel [USER] GROUP\n\nDelete a group or remove a user from a group"
-
-#define HELP_groupadd "usage: groupadd [-S] [-g GID] [USER] GROUP\n\nAdd a group or add a user to a group\n\n -g GID Group id\n -S Create a system group"
-
-#define HELP_getty "usage: getty [OPTIONS] BAUD_RATE[,BAUD_RATE]... TTY [TERMTYPE]\n\n-h Enable hardware RTS/CTS flow control\n-L Set CLOCAL (ignore Carrier Detect state)\n-m Get baud rate from modem's CONNECT status message\n-n Don't prompt for login name\n-w Wait for CR or LF before sending /etc/issue\n-i Don't display /etc/issue\n-f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue\n-l LOGIN Invoke LOGIN instead of /bin/login\n-t SEC Terminate after SEC if no login name is read\n-I INITSTR Send INITSTR before anything else\n-H HOST Log HOST into the utmp file as the hostname"
-
-#define HELP_getfattr "usage: getfattr [-d] [-h] [-n NAME] FILE...\n\nRead POSIX extended attributes.\n\n-d Show values as well as names\n-h Do not dereference symbolic links\n-n Show only attributes with the given name\n--only-values Don't show names"
-
-#define HELP_fsck "usage: fsck [-ANPRTV] [-C FD] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]...\n\nCheck and repair filesystems\n\n-A Walk /etc/fstab and check all filesystems\n-N Don't execute, just show what would be done\n-P With -A, check filesystems in parallel\n-R With -A, skip the root filesystem\n-T Don't show title on startup\n-V Verbose\n-C n Write status information to specified file descriptor\n-t TYPE List of filesystem types to check"
-
-#define HELP_fold "usage: fold [-bsu] [-w WIDTH] [FILE...]\n\nFolds (wraps) or unfolds ascii text by adding or removing newlines.\nDefault line width is 80 columns for folding and infinite for unfolding.\n\n-b Fold based on bytes instead of columns\n-s Fold/unfold at whitespace boundaries if possible\n-u Unfold text (and refold if -w is given)\n-w Set lines to WIDTH columns or bytes"
-
-#define HELP_fdisk "usage: fdisk [-lu] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SECTSZ] DISK\n\nChange partition table\n\n-u Start and End are in sectors (instead of cylinders)\n-l Show partition table for each DISK, then exit\n-b size sector size (512, 1024, 2048 or 4096)\n-C CYLINDERS Set number of cylinders/heads/sectors\n-H HEADS\n-S SECTORS"
-
-#define HELP_expr "usage: expr ARG1 OPERATOR ARG2...\n\nEvaluate expression and print result. For example, \"expr 1 + 2\".\n\nThe supported operators are (grouped from highest to lowest priority):\n\n ( ) : * / % + - != <= < >= > = & |\n\nEach constant and operator must be a separate command line argument.\nAll operators are infix, meaning they expect a constant (or expression\nthat resolves to a constant) on each side of the operator. Operators of\nthe same priority (within each group above) are evaluated left to right.\nParentheses may be used (as separate arguments) to elevate the priority\nof expressions.\n\nCalling expr from a command shell requires a lot of \\( or '*' escaping\nto avoid interpreting shell control characters.\n\nThe & and | operators are logical (not bitwise) and may operate on\nstrings (a blank string is \"false\"). Comparison operators may also\noperate on strings (alphabetical sort).\n\nConstants may be strings or integers. Comparison, logical, and regex\noperators may operate on strings (a blank string is \"false\"), other\noperators require integers."
-
-#define HELP_dumpleases "usage: dumpleases [-r|-a] [-f LEASEFILE]\n\nDisplay DHCP leases granted by udhcpd\n-f FILE, Lease file\n-r Show remaining time\n-a Show expiration time"
-
-#define HELP_diff "usage: diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2\n\n-a Treat all files as text\n-b Ignore changes in the amount of whitespace\n-B Ignore changes whose lines are all blank\n-d Try hard to find a smaller set of changes\n-i Ignore case differences\n-L Use LABEL instead of the filename in the unified header\n-N Treat absent files as empty\n-q Output only whether files differ\n-r Recurse\n-S Start with FILE when comparing directories\n-T Make tabs line up by prefixing a tab when necessary\n-s Report when two files are the same\n-t Expand tabs to spaces in output\n-u Unified diff\n-U Output LINES lines of context\n-w Ignore all whitespace\n\n--color Colored output\n--strip-trailing-cr Strip trailing '\\r's from input lines"
-
-#define HELP_dhcpd "usage: dhcpd [-46fS] [-i IFACE] [-P N] [CONFFILE]\n\n -f Run in foreground\n -i Interface to use\n -S Log to syslog too\n -P N Use port N (default ipv4 67, ipv6 547)\n -4, -6 Run as a DHCPv4 or DHCPv6 server"
-
-#define HELP_dhcp6 "usage: dhcp6 [-fbnqvR] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]\n\n Configure network dynamically using DHCP.\n\n -i Interface to use (default eth0)\n -p Create pidfile\n -s Run PROG at DHCP events\n -t Send up to N Solicit packets\n -T Pause between packets (default 3 seconds)\n -A Wait N seconds after failure (default 20)\n -f Run in foreground\n -b Background if lease is not obtained\n -n Exit if lease is not obtained\n -q Exit after obtaining lease\n -R Release IP on exit\n -S Log to syslog too\n -r Request this IP address\n -v Verbose\n\n Signals:\n USR1 Renew current lease\n USR2 Release current lease"
-
-#define HELP_dhcp "usage: dhcp [-fbnqvoCRB] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]\n [-H HOSTNAME] [-V VENDOR] [-x OPT:VAL] [-O OPT]\n\n Configure network dynamically using DHCP.\n\n -i Interface to use (default eth0)\n -p Create pidfile\n -s Run PROG at DHCP events (default /usr/share/dhcp/default.script)\n -B Request broadcast replies\n -t Send up to N discover packets\n -T Pause between packets (default 3 seconds)\n -A Wait N seconds after failure (default 20)\n -f Run in foreground\n -b Background if lease is not obtained\n -n Exit if lease is not obtained\n -q Exit after obtaining lease\n -R Release IP on exit\n -S Log to syslog too\n -a Use arping to validate offered address\n -O Request option OPT from server (cumulative)\n -o Don't request any options (unless -O is given)\n -r Request this IP address\n -x OPT:VAL Include option OPT in sent packets (cumulative)\n -F Ask server to update DNS mapping for NAME\n -H Send NAME as client hostname (default none)\n -V VENDOR Vendor identifier (default 'toybox VERSION')\n -C Don't send MAC as client identifier\n -v Verbose\n\n Signals:\n USR1 Renew current lease\n USR2 Release current lease"
-
-#define HELP_dd "usage: dd [if=FILE] [of=FILE] [ibs=N] [obs=N] [iflag=FLAGS] [oflag=FLAGS]\n [bs=N] [count=N] [seek=N] [skip=N]\n [conv=notrunc|noerror|sync|fsync] [status=noxfer|none]\n\nCopy/convert files.\n\nif=FILE Read from FILE instead of stdin\nof=FILE Write to FILE instead of stdout\nbs=N Read and write N bytes at a time\nibs=N Input block size\nobs=N Output block size\ncount=N Copy only N input blocks\nskip=N Skip N input blocks\nseek=N Skip N output blocks\niflag=FLAGS Set input flags\noflag=FLAGS Set output flags\nconv=notrunc Don't truncate output file\nconv=noerror Continue after read errors\nconv=sync Pad blocks with zeros\nconv=fsync Physically write data out before finishing\nstatus=noxfer Don't show transfer rate\nstatus=none Don't show transfer rate or records in/out\n\nFLAGS is a comma-separated list of:\n\ncount_bytes (iflag) interpret count=N in bytes, not blocks\nseek_bytes (oflag) interpret seek=N in bytes, not blocks\nskip_bytes (iflag) interpret skip=N in bytes, not blocks\n\nNumbers may be suffixed by c (*1), w (*2), b (*512), kD (*1000), k (*1024),\nMD (*1000*1000), M (*1024*1024), GD (*1000*1000*1000) or G (*1024*1024*1024)."
-
-#define HELP_crontab "usage: crontab [-u user] FILE\n [-u user] [-e | -l | -r]\n [-c dir]\n\nFiles used to schedule the execution of programs.\n\n-c crontab dir\n-e edit user's crontab\n-l list user's crontab\n-r delete user's crontab\n-u user\nFILE Replace crontab by FILE ('-': stdin)"
-
-#define HELP_crond "usage: crond [-fbS] [-l N] [-d N] [-L LOGFILE] [-c DIR]\n\nA daemon to execute scheduled commands.\n\n-b Background (default)\n-c crontab dir\n-d Set log level, log to stderr\n-f Foreground\n-l Set log level. 0 is the most verbose, default 8\n-S Log to syslog (default)\n-L Log to file"
-
-#define HELP_brctl "usage: brctl COMMAND [BRIDGE [INTERFACE]]\n\nManage ethernet bridges\n\nCommands:\nshow Show a list of bridges\naddbr BRIDGE Create BRIDGE\ndelbr BRIDGE Delete BRIDGE\naddif BRIDGE IFACE Add IFACE to BRIDGE\ndelif BRIDGE IFACE Delete IFACE from BRIDGE\nsetageing BRIDGE TIME Set ageing time\nsetfd BRIDGE TIME Set bridge forward delay\nsethello BRIDGE TIME Set hello time\nsetmaxage BRIDGE TIME Set max message age\nsetpathcost BRIDGE PORT COST Set path cost\nsetportprio BRIDGE PORT PRIO Set port priority\nsetbridgeprio BRIDGE PRIO Set bridge priority\nstp BRIDGE [1/yes/on|0/no/off] STP on/off"
-
-#define HELP_bootchartd "usage: bootchartd {start [PROG ARGS]}|stop|init\n\nCreate /var/log/bootlog.tgz with boot chart data\n\nstart: start background logging; with PROG, run PROG,\n then kill logging with USR1\nstop: send USR1 to all bootchartd processes\ninit: start background logging; stop when getty/xdm is seen\n (for init scripts)\n\nUnder PID 1: as init, then exec $bootchart_init, /init, /sbin/init"
-
-#define HELP_bc "usage: bc [-ilqsw] [file ...]\n\nbc is a command-line calculator with a Turing-complete language.\n\noptions:\n\n -i --interactive force interactive mode\n -l --mathlib use predefined math routines:\n\n s(expr) = sine of expr in radians\n c(expr) = cosine of expr in radians\n a(expr) = arctangent of expr, returning radians\n l(expr) = natural log of expr\n e(expr) = raises e to the power of expr\n j(n, x) = Bessel function of integer order n of x\n\n -q --quiet don't print version and copyright\n -s --standard error if any non-POSIX extensions are used\n -w --warn warn if any non-POSIX extensions are used"
-
-#define HELP_arping "usage: arping [-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP\n\nSend ARP requests/replies\n\n-f Quit on first ARP reply\n-q Quiet\n-b Keep broadcasting, don't go unicast\n-D Duplicated address detection mode\n-U Unsolicited ARP mode, update your neighbors\n-A ARP answer mode, update your neighbors\n-c N Stop after sending N ARP requests\n-w TIMEOUT Time to wait for ARP reply, seconds\n-I IFACE Interface to use (default eth0)\n-s SRC_IP Sender IP address\nDST_IP Target IP address"
-
-#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 (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."
-
-#define HELP_wc "usage: wc -lwcm [FILE...]\n\nCount lines, words, and characters in input.\n\n-l Show lines\n-w Show words\n-c Show bytes\n-m Show characters\n\nBy default outputs lines, words, bytes, and filename for each\nargument (or from stdin if none). Displays only either bytes\nor characters."
-
-#define HELP_uuencode "usage: uuencode [-m] [file] encode-filename\n\nUuencode stdin (or file) to stdout, with encode-filename in the output.\n\n-m Base64"
-
-#define HELP_uudecode "usage: uudecode [-o OUTFILE] [INFILE]\n\nDecode file from stdin (or INFILE).\n\n-o Write to OUTFILE instead of filename in header"
-
-#define HELP_unlink "usage: unlink FILE\n\nDelete one file."
-
-#define HELP_uniq "usage: uniq [-cduiz] [-w maxchars] [-f fields] [-s char] [input_file [output_file]]\n\nReport or filter out repeated lines in a file\n\n-c Show counts before each line\n-d Show only lines that are repeated\n-u Show only lines that are unique\n-i Ignore case when comparing lines\n-z Lines end with \\0 not \\n\n-w Compare maximum X chars per line\n-f Ignore first X fields\n-s Ignore first X chars"
-
-#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"
-
-#define HELP_true "Return zero."
-
-#define HELP_touch "usage: touch [-amch] [-d DATE] [-t TIME] [-r FILE] FILE...\n\nUpdate the access and modification times of each FILE to the current time.\n\n-a Change access time\n-m Change modification time\n-c Don't create file\n-h Change symlink\n-d Set time to DATE (in YYYY-MM-DDThh:mm:SS[.frac][tz] format)\n-t Set time to TIME (in [[CC]YY]MMDDhhmm[.ss][frac] format)\n-r Set time same as reference FILE"
-
-#define HELP_time "usage: time [-pv] COMMAND [ARGS...]\n\nRun command line and report real, user, and system time elapsed in seconds.\n(real = clock on the wall, user = cpu used by command's code,\nsystem = cpu used by OS on behalf of command.)\n\n-p POSIX format output (default)\n-v Verbose"
-
-#define HELP_test "usage: test [-bcdefghLPrSsuwx PATH] [-nz STRING] [-t FD] [X ?? Y]\n\nReturn true or false by performing tests. (With no arguments return false.)\n\n--- Tests with a single argument (after the option):\nPATH is/has:\n -b block device -f regular file -p fifo -u setuid bit\n -c char device -g setgid -r read bit -w write bit\n -d directory -h symlink -S socket -x execute bit\n -e exists -L symlink -s nonzero size\nSTRING is:\n -n nonzero size -z zero size (STRING by itself implies -n)\nFD (integer file descriptor) is:\n -t a TTY\n\n--- Tests with one argument on each side of an operator:\nTwo strings:\n = are identical != differ\nTwo integers:\n -eq equal -gt first > second -lt first < second\n -ne not equal -ge first >= second -le first <= second\n\n--- Modify or combine tests:\n ! EXPR not (swap true/false) EXPR -a EXPR and (are both true)\n ( EXPR ) evaluate this first EXPR -o EXPR or (is either true)"
-
-#define HELP_tee "usage: tee [-ai] [file...]\n\nCopy stdin to each listed file, and also to stdout.\nFilename \"-\" is a synonym for stdout.\n\n-a Append to files\n-i Ignore SIGINT"
-
-#define HELP_tar "usage: tar [-cxt] [-fvohmjkOS] [-XTCf NAME] [FILES]\n\nCreate, extract, or list files in a .tar (or compressed t?z) file.\n\nOptions:\nc Create x Extract t Test (list)\nf tar FILE (default -) C Change to DIR first v Verbose display\no Ignore owner h Follow symlinks m Ignore mtime\nJ xz compression j bzip2 compression z gzip compression\nO Extract to stdout X exclude names in FILE T include names in FILE\n\n--exclude FILENAME to exclude --full-time Show seconds with -tv\n--mode MODE Adjust modes --mtime TIME Override timestamps\n--owner NAME Set file owner to NAME --group NAME Set file group to NAME\n--sparse Record sparse files\n--restrict All archive contents must extract under one subdirctory\n--numeric-owner Save/use/display uid and gid, not user/group name\n--no-recursion Don't store directory contents"
-
-#define HELP_tail "usage: tail [-n|c NUMBER] [-f] [FILE...]\n\nCopy last lines from files to stdout. If no files listed, copy from\nstdin. Filename \"-\" is a synonym for stdin.\n\n-n Output the last NUMBER lines (default 10), +X counts from start\n-c Output the last NUMBER bytes, +NUMBER counts from start\n-f Follow FILE(s), waiting for more data to be appended"
-
-#define HELP_strings "usage: strings [-fo] [-t oxd] [-n LEN] [FILE...]\n\nDisplay printable strings in a binary file\n\n-f Show filename\n-n At least LEN characters form a string (default 4)\n-o Show offset (ala -t d)\n-t Show offset type (o=octal, d=decimal, x=hexadecimal)"
-
-#define HELP_split "usage: split [-a SUFFIX_LEN] [-b BYTES] [-l LINES] [INPUT [OUTPUT]]\n\nCopy INPUT (or stdin) data to a series of OUTPUT (or \"x\") files with\nalphabetically increasing suffix (aa, ab, ac... az, ba, bb...).\n\n-a Suffix length (default 2)\n-b BYTES/file (10, 10k, 10m, 10g...)\n-l LINES/file (default 1000)"
-
-#define HELP_sort "usage: sort [-Mbcdfginrsuz] [FILE...] [-k#[,#[x]] [-t X]] [-o FILE]\n\nSort all lines of text from input files (or stdin) to stdout.\n-M Month sort (jan, feb, etc)\n-V Version numbers (name-1.234-rc6.5b.tgz)\n-b Ignore leading blanks (or trailing blanks in second part of key)\n-c Check whether input is sorted\n-d Dictionary order (use alphanumeric and whitespace chars only)\n-f Force uppercase (case insensitive sort)\n-g General numeric sort (double precision with nan and inf)\n-i Ignore nonprinting characters\n-k Sort by \"key\" (see below)\n-n Numeric order (instead of alphabetical)\n-o Output to FILE instead of stdout\n-r Reverse\n-s Skip fallback sort (only sort with keys)\n-t Use a key separator other than whitespace\n-u Unique lines only\n-x Hexadecimal numerical sort\n-z Zero (null) terminated lines\n\nSorting by key looks at a subset of the words on each line. -k2 uses the\nsecond word to the end of the line, -k2,2 looks at only the second word,\n-k2,4 looks from the start of the second to the end of the fourth word.\n-k2.4,5 starts from the fourth character of the second word, to the end\nof the fifth word. Specifying multiple keys uses the later keys as tie\nbreakers, in order. A type specifier appended to a sort key (such as -2,2n)\napplies only to sorting that key."
-
-#define HELP_sleep "usage: sleep DURATION\n\nWait before exiting.\n\nDURATION can be a decimal fraction. An optional suffix can be \"m\"\n(minutes), \"h\" (hours), \"d\" (days), or \"s\" (seconds, the default)."
-
-#define HELP_sed "usage: sed [-inrzE] [-e SCRIPT]...|SCRIPT [-f SCRIPT_FILE]... [FILE...]\n\nStream editor. Apply one or more editing SCRIPTs to each line of input\n(from FILE or stdin) producing output (by default to stdout).\n\n-e Add SCRIPT to list\n-f Add contents of SCRIPT_FILE to list\n-i Edit each file in place (-iEXT keeps backup file with extension EXT)\n-n No default output (use the p command to output matched lines)\n-r Use extended regular expression syntax\n-E POSIX alias for -r\n-s Treat input files separately (implied by -i)\n-z Use \\0 rather than \\n as the input line separator\n\nA SCRIPT is a series of one or more COMMANDs separated by newlines or\nsemicolons. All -e SCRIPTs are concatenated together as if separated\nby newlines, followed by all lines from -f SCRIPT_FILEs, in order.\nIf no -e or -f SCRIPTs are specified, the first argument is the SCRIPT.\n\nEach COMMAND may be preceded by an address which limits the command to\napply only to the specified line(s). Commands without an address apply to\nevery line. Addresses are of the form:\n\n [ADDRESS[,ADDRESS]][!]COMMAND\n\nThe ADDRESS may be a decimal line number (starting at 1), a /regular\nexpression/ within a pair of forward slashes, or the character \"$\" which\nmatches the last line of input. (In -s or -i mode this matches the last\nline of each file, otherwise just the last line of the last file.) A single\naddress matches one line, a pair of comma separated addresses match\neverything from the first address to the second address (inclusive). If\nboth addresses are regular expressions, more than one range of lines in\neach file can match. The second address can be +N to end N lines later.\n\nREGULAR EXPRESSIONS in sed are started and ended by the same character\n(traditionally / but anything except a backslash or a newline works).\nBackslashes may be used to escape the delimiter if it occurs in the\nregex, and for the usual printf escapes (\\abcefnrtv and octal, hex,\nand unicode). An empty regex repeats the previous one. ADDRESS regexes\n(above) require the first delimiter to be escaped with a backslash when\nit isn't a forward slash (to distinguish it from the COMMANDs below).\n\nSed mostly operates on individual lines one at a time. It reads each line,\nprocesses it, and either writes it to the output or discards it before\nreading the next line. Sed can remember one additional line in a separate\nbuffer (using the h, H, g, G, and x commands), and can read the next line\nof input early (using the n and N command), but other than that command\nscripts operate on individual lines of text.\n\nEach COMMAND starts with a single character. The following commands take\nno arguments:\n\n ! Run this command when the test _didn't_ match.\n\n { Start a new command block, continuing until a corresponding \"}\".\n Command blocks may nest. If the block has an address, commands within\n the block are only run for lines within the block's address range.\n\n } End command block (this command cannot have an address)\n\n d Delete this line and move on to the next one\n (ignores remaining COMMANDs)\n\n D Delete one line of input and restart command SCRIPT (same as \"d\"\n unless you've glued lines together with \"N\" or similar)\n\n g Get remembered line (overwriting current line)\n\n G Get remembered line (appending to current line)\n\n h Remember this line (overwriting remembered line)\n\n H Remember this line (appending to remembered line, if any)\n\n l Print line, escaping \\abfrtv (but not newline), octal escaping other\n nonprintable characters, wrapping lines to terminal width with a\n backslash, and appending $ to actual end of line.\n\n n Print default output and read next line, replacing current line\n (If no next line available, quit processing script)\n\n N Append next line of input to this line, separated by a newline\n (This advances the line counter for address matching and \"=\", if no\n next line available quit processing script without default output)\n\n p Print this line\n\n P Print this line up to first newline (from \"N\")\n\n q Quit (print default output, no more commands processed or lines read)\n\n x Exchange this line with remembered line (overwrite in both directions)\n\n = Print the current line number (followed by a newline)\n\nThe following commands (may) take an argument. The \"text\" arguments (to\nthe \"a\", \"b\", and \"c\" commands) may end with an unescaped \"\\\" to append\nthe next line (for which leading whitespace is not skipped), and also\ntreat \";\" as a literal character (use \"\\;\" instead).\n\n a [text] Append text to output before attempting to read next line\n\n b [label] Branch, jumps to :label (or with no label, to end of SCRIPT)\n\n c [text] Delete line, output text at end of matching address range\n (ignores remaining COMMANDs)\n\n i [text] Print text\n\n r [file] Append contents of file to output before attempting to read\n next line.\n\n s/S/R/F Search for regex S, replace matched text with R using flags F.\n The first character after the \"s\" (anything but newline or\n backslash) is the delimiter, escape with \\ to use normally.\n\n The replacement text may contain \"&\" to substitute the matched\n text (escape it with backslash for a literal &), or \\1 through\n \\9 to substitute a parenthetical subexpression in the regex.\n You can also use the normal backslash escapes such as \\n and\n a backslash at the end of the line appends the next line.\n\n The flags are:\n\n [0-9] A number, substitute only that occurrence of pattern\n g Global, substitute all occurrences of pattern\n i Ignore case when matching\n p Print the line if match was found and replaced\n w [file] Write (append) line to file if match replaced\n\n t [label] Test, jump to :label only if an \"s\" command found a match in\n this line since last test (replacing with same text counts)\n\n T [label] Test false, jump only if \"s\" hasn't found a match.\n\n w [file] Write (append) line to file\n\n y/old/new/ Change each character in 'old' to corresponding character\n in 'new' (with standard backslash escapes, delimiter can be\n any repeated character except \\ or \\n)\n\n : [label] Labeled target for jump commands\n\n # Comment, ignore rest of this line of SCRIPT\n\nDeviations from POSIX: allow extended regular expressions with -r,\nediting in place with -i, separate with -s, NUL-separated input with -z,\nprintf escapes in text, line continuations, semicolons after all commands,\n2-address anywhere an address is allowed, \"T\" command, multiline\ncontinuations for [abc], \\; to end [abc] argument before end of line."
-
-#define HELP_rmdir "usage: rmdir [-p] [dirname...]\n\nRemove one or more directories.\n\n-p Remove path\n--ignore-fail-on-non-empty Ignore failures caused by non-empty directories"
-
-#define HELP_rm "usage: rm [-fiRrv] FILE...\n\nRemove each argument from the filesystem.\n\n-f Force: remove without confirmation, no error if it doesn't exist\n-i Interactive: prompt for confirmation\n-rR Recursive: remove directory contents\n-v Verbose"
-
-#define HELP_renice "usage: renice [-gpu] -n increment ID ..."
-
-#define HELP_pwd "usage: pwd [-L|-P]\n\nPrint working (current) directory.\n\n-L Use shell's path from $PWD (when applicable)\n-P Print canonical absolute path"
-
-#define HELP_pkill "usage: pkill [-fnovx] [-SIGNAL|-l SIGNAL] [PATTERN] [-G GID,] [-g PGRP,] [-P PPID,] [-s SID,] [-t TERM,] [-U UID,] [-u EUID,]\n\n-l Send SIGNAL (default SIGTERM)\n-V Verbose\n-f Check full command line for PATTERN\n-G Match real Group ID(s)\n-g Match Process Group(s) (0 is current user)\n-n Newest match only\n-o Oldest match only\n-P Match Parent Process ID(s)\n-s Match Session ID(s) (0 for current)\n-t Match Terminal(s)\n-U Match real User ID(s)\n-u Match effective User ID(s)\n-v Negate the match\n-x Match whole command (not substring)"
-
-#define HELP_pgrep "usage: pgrep [-clfnovx] [-d DELIM] [-L SIGNAL] [PATTERN] [-G GID,] [-g PGRP,] [-P PPID,] [-s SID,] [-t TERM,] [-U UID,] [-u EUID,]\n\nSearch for process(es). PATTERN is an extended regular expression checked\nagainst command names.\n\n-c Show only count of matches\n-d Use DELIM instead of newline\n-L Send SIGNAL instead of printing name\n-l Show command name\n-f Check full command line for PATTERN\n-G Match real Group ID(s)\n-g Match Process Group(s) (0 is current user)\n-n Newest match only\n-o Oldest match only\n-P Match Parent Process ID(s)\n-s Match Session ID(s) (0 for current)\n-t Match Terminal(s)\n-U Match real User ID(s)\n-u Match effective User ID(s)\n-v Negate the match\n-x Match whole command (not substring)"
-
-#define HELP_iotop "usage: iotop [-AaKObq] [-n NUMBER] [-d SECONDS] [-p PID,] [-u USER,]\n\nRank processes by I/O.\n\n-A All I/O, not just disk\n-a Accumulated I/O (not percentage)\n-H Show threads\n-K Kilobytes\n-k Fallback sort FIELDS (default -[D]IO,-ETIME,-PID)\n-m Maximum number of tasks to show\n-O Only show processes doing I/O\n-o Show FIELDS (default PID,PR,USER,[D]READ,[D]WRITE,SWAP,[D]IO,COMM)\n-s Sort by field number (0-X, default 6)\n-b Batch mode (no tty)\n-d Delay SECONDS between each cycle (default 3)\n-n Exit after NUMBER iterations\n-p Show these PIDs\n-u Show these USERs\n-q Quiet (no header lines)\n\nCursor LEFT/RIGHT to change sort, UP/DOWN move list, space to force\nupdate, R to reverse sort, Q to exit."
-
-#define HELP_top "usage: top [-Hbq] [-k FIELD,] [-o FIELD,] [-s SORT] [-n NUMBER] [-m LINES] [-d SECONDS] [-p PID,] [-u USER,]\n\nShow process activity in real time.\n\n-H Show threads\n-k Fallback sort FIELDS (default -S,-%CPU,-ETIME,-PID)\n-o Show FIELDS (def PID,USER,PR,NI,VIRT,RES,SHR,S,%CPU,%MEM,TIME+,CMDLINE)\n-O Add FIELDS (replacing PR,NI,VIRT,RES,SHR,S from default)\n-s Sort by field number (1-X, default 9)\n-b Batch mode (no tty)\n-d Delay SECONDS between each cycle (default 3)\n-m Maximum number of tasks to show\n-n Exit after NUMBER iterations\n-p Show these PIDs\n-u Show these USERs\n-q Quiet (no header lines)\n\nCursor LEFT/RIGHT to change sort, UP/DOWN move list, space to force\nupdate, R to reverse sort, Q to exit."
-
-#define HELP_ps "usage: ps [-AadefLlnwZ] [-gG GROUP,] [-k FIELD,] [-o FIELD,] [-p PID,] [-t TTY,] [-uU USER,]\n\nList processes.\n\nWhich processes to show (-gGuUpPt selections may be comma separated lists):\n\n-A All -a Has terminal not session leader\n-d All but session leaders -e Synonym for -A\n-g In GROUPs -G In real GROUPs (before sgid)\n-p PIDs (--pid) -P Parent PIDs (--ppid)\n-s In session IDs -t Attached to selected TTYs\n-T Show threads also -u Owned by selected USERs\n-U Real USERs (before suid)\n\nOutput modifiers:\n\n-k Sort FIELDs (-FIELD to reverse) -M Measure/pad future field widths\n-n Show numeric USER and GROUP -w Wide output (don't truncate fields)\n\nWhich FIELDs to show. (-o HELP for list, default = -o PID,TTY,TIME,CMD)\n\n-f Full listing (-o USER:12=UID,PID,PPID,C,STIME,TTY,TIME,ARGS=CMD)\n-l Long listing (-o F,S,UID,PID,PPID,C,PRI,NI,ADDR,SZ,WCHAN,TTY,TIME,CMD)\n-o Output FIELDs instead of defaults, each with optional :size and =title\n-O Add FIELDS to defaults\n-Z Include LABEL"
-
-#define HELP_printf "usage: printf FORMAT [ARGUMENT...]\n\nFormat and print ARGUMENT(s) according to FORMAT, using C printf syntax\n(% escapes for cdeEfgGiosuxX, \\ escapes for abefnrtv0 or \\OCTAL or \\xHEX)."
-
-#define HELP_patch "usage: patch [-d DIR] [-i file] [-p depth] [-Rlsu] [--dry-run]\n\nApply a unified diff to one or more files.\n\n-d Modify files in DIR\n-i Input file (default=stdin)\n-l Loose match (ignore whitespace)\n-p Number of '/' to strip from start of file paths (default=all)\n-R Reverse patch\n-s Silent except for errors\n-u Ignored (only handles \"unified\" diffs)\n--dry-run Don't change files, just confirm patch applies\n\nThis version of patch only handles unified diffs, and only modifies\na file when all hunks to that file apply. Patch prints failed hunks\nto stderr, and exits with nonzero status if any hunks fail.\n\nA file compared against /dev/null (or with a date <= the epoch) is\ncreated/deleted as appropriate."
-
-#define HELP_paste "usage: paste [-s] [-d DELIMITERS] [FILE...]\n\nMerge corresponding lines from each input file.\n\n-d List of delimiter characters to separate fields with (default is \\t)\n-s Sequential mode: turn each input file into one line of output"
-
-#define HELP_od "usage: od [-bcdosxv] [-j #] [-N #] [-w #] [-A doxn] [-t acdfoux[#]]\n\nDump data in octal/hex.\n\n-A Address base (decimal, octal, hexadecimal, none)\n-j Skip this many bytes of input\n-N Stop dumping after this many bytes\n-t Output type a(scii) c(har) d(ecimal) f(loat) o(ctal) u(nsigned) (he)x\n plus optional size in bytes\n aliases: -b=-t o1, -c=-t c, -d=-t u2, -o=-t o2, -s=-t d2, -x=-t x2\n-v Don't collapse repeated lines together\n-w Total line width in bytes (default 16)"
-
-#define HELP_nohup "usage: nohup COMMAND [ARG...]\n\nRun a command that survives the end of its terminal.\n\nRedirect tty on stdin to /dev/null, tty on stdout to \"nohup.out\"."
-
-#define HELP_nl "usage: nl [-E] [-l #] [-b MODE] [-n STYLE] [-s SEPARATOR] [-v #] [-w WIDTH] [FILE...]\n\nNumber lines of input.\n\n-E Use extended regex syntax (when doing -b pREGEX)\n-b Which lines to number: a (all) t (non-empty, default) pREGEX (pattern)\n-l Only count last of this many consecutive blank lines\n-n Number STYLE: ln (left justified) rn (right justified) rz (zero pad)\n-s Separator to use between number and line (instead of TAB)\n-v Starting line number for each section (default 1)\n-w Width of line numbers (default 6)"
-
-#define HELP_nice "usage: nice [-n PRIORITY] COMMAND [ARG...]\n\nRun a command line at an increased or decreased scheduling priority.\n\nHigher numbers make a program yield more CPU time, from -20 (highest\npriority) to 19 (lowest). By default processes inherit their parent's\nniceness (usually 0). By default this command adds 10 to the parent's\npriority. Only root can set a negative niceness level."
-
-#define HELP_mkfifo_z "usage: mkfifo [-Z CONTEXT]\n\n-Z Security context"
-
-#define HELP_mkfifo "usage: mkfifo [NAME...]\n\nCreate FIFOs (named pipes)."
-
-#define HELP_mkdir_z "usage: [-Z context]\n\n-Z Set security context"
-
-#define HELP_mkdir "usage: mkdir [-vp] [-m mode] [dirname...]\n\nCreate one or more directories.\n\n-m Set permissions of directory to mode\n-p Make parent directories as needed\n-v Verbose"
-
-#define HELP_ls "usage: ls [-ACFHLRSZacdfhiklmnpqrstux1] [--color[=auto]] [directory...]\n\nList files.\n\nwhat to show:\n-a all files including .hidden -b escape nongraphic chars\n-c use ctime for timestamps -d directory, not contents\n-i inode number -p put a '/' after dir names\n-q unprintable chars as '?' -s storage used (1024 byte units)\n-u use access time for timestamps -A list all files but . and ..\n-H follow command line symlinks -L follow symlinks\n-R recursively list in subdirs -F append /dir *exe @sym |FIFO\n-Z security context\n\noutput formats:\n-1 list one file per line -C columns (sorted vertically)\n-g like -l but no owner -h human readable sizes\n-l long (show full details) -m comma separated\n-n like -l but numeric uid/gid -o like -l but no group\n-x columns (horizontal sort) -ll long with nanoseconds (--full-time)\n--color device=yellow symlink=turquoise/red dir=blue socket=purple\n files: exe=green suid=red suidfile=redback stickydir=greenback\n =auto means detect if output is a tty.\n\nsorting (default is alphabetical):\n-f unsorted -r reverse -t timestamp -S size"
-
-#define HELP_logger "usage: logger [-s] [-t TAG] [-p [FACILITY.]PRIORITY] [message...]\n\nLog message (or stdin) to syslog.\n\n-s Also write message to stderr\n-t Use TAG instead of username to identify message source\n-p Specify PRIORITY with optional FACILITY. Default is \"user.notice\""
-
-#define HELP_ln "usage: ln [-sfnv] [-t DIR] [FROM...] TO\n\nCreate a link between FROM and TO.\nOne/two/many arguments work like \"mv\" or \"cp\".\n\n-s Create a symbolic link\n-f Force the creation of the link, even if TO already exists\n-n Symlink at TO treated as file\n-t Create links in DIR\n-T TO always treated as file, max 2 arguments\n-v Verbose"
-
-#define HELP_link "usage: link FILE NEWLINK\n\nCreate hardlink to a file."
-
-#define HELP_killall5 "usage: killall5 [-l [SIGNAL]] [-SIGNAL|-s SIGNAL] [-o PID]...\n\nSend a signal to all processes outside current session.\n\n-l List signal name(s) and number(s)\n-o PID Omit PID\n-s Send SIGNAL (default SIGTERM)"
-
-#define HELP_kill "usage: kill [-l [SIGNAL] | -s SIGNAL | -SIGNAL] pid...\n\nSend signal to process(es).\n\n-l List signal name(s) and number(s)\n-s Send SIGNAL (default SIGTERM)"
-
-#define HELP_whoami "usage: whoami\n\nPrint the current user name."
-
-#define HELP_logname "usage: logname\n\nPrint the current user name."
-
-#define HELP_groups "usage: groups [user]\n\nPrint the groups a user is in."
-
-#define HELP_id_z "usage: id [-Z]\n\n-Z Show only security context"
-
-#define HELP_id "usage: id [-nGgru] [USER...]\n\nPrint user and group ID.\n\n-n Print names instead of numeric IDs (to be used with -Ggu)\n-G Show only the group IDs\n-g Show only the effective group ID\n-r Show real ID instead of effective ID\n-u Show only the effective user ID"
-
-#define HELP_iconv "usage: iconv [-f FROM] [-t TO] [FILE...]\n\nConvert character encoding of files.\n\n-c Omit invalid chars\n-f Convert from (default utf8)\n-t Convert to (default utf8)"
-
-#define HELP_head "usage: head [-n number] [file...]\n\nCopy first lines from files to stdout. If no files listed, copy from\nstdin. Filename \"-\" is a synonym for stdin.\n\n-n Number of lines to copy\n-c Number of bytes to copy\n-q Never print headers\n-v Always print headers"
-
-#define HELP_grep "usage: grep [-EFrivwcloqsHbhn] [-ABC NUM] [-m MAX] [-e REGEX]... [-MS PATTERN]... [-f REGFILE] [FILE]...\n\nShow lines matching regular expressions. If no -e, first argument is\nregular expression to match. With no files (or \"-\" filename) read stdin.\nReturns 0 if matched, 1 if no match found, 2 for command errors.\n\n-e Regex to match. (May be repeated.)\n-f File listing regular expressions to match.\n\nfile search:\n-r Recurse into subdirectories (defaults FILE to \".\")\n-R Recurse into subdirectories and symlinks to directories\n-M Match filename pattern (--include)\n-S Skip filename pattern (--exclude)\n--exclude-dir=PATTERN Skip directory pattern\n-I Ignore binary files\n\nmatch type:\n-A Show NUM lines after -B Show NUM lines before match\n-C NUM lines context (A+B) -E extended regex syntax\n-F fixed (literal match) -a always text (not binary)\n-i case insensitive -m match MAX many lines\n-v invert match -w whole word (implies -E)\n-x whole line -z input NUL terminated\n\ndisplay modes: (default: matched line)\n-c count of matching lines -l show only matching filenames\n-o only matching part -q quiet (errors only)\n-s silent (no error msg) -Z output NUL terminated\n\noutput prefix (default: filename if checking more than 1 file)\n-H force filename -b byte offset of match\n-h hide filename -n line number of match"
-
-#define HELP_getconf "usage: getconf -a [PATH] | -l | NAME [PATH]\n\nGet system configuration values. Values from pathconf(3) require a path.\n\n-a Show all (defaults to \"/\" if no path given)\n-l List available value names (grouped by source)"
-
-#define HELP_find "usage: find [-HL] [DIR...] [<options>]\n\nSearch directories for matching files.\nDefault: search \".\", match all, -print matches.\n\n-H Follow command line symlinks -L Follow all symlinks\n\nMatch filters:\n-name PATTERN filename with wildcards (-iname case insensitive)\n-path PATTERN path name with wildcards (-ipath case insensitive)\n-user UNAME belongs to user UNAME -nouser user ID not known\n-group GROUP belongs to group GROUP -nogroup group ID not known\n-perm [-/]MODE permissions (-=min /=any) -prune ignore dir contents\n-size N[c] 512 byte blocks (c=bytes) -xdev only this filesystem\n-links N hardlink count -atime N[u] accessed N units ago\n-ctime N[u] created N units ago -mtime N[u] modified N units ago\n-newer FILE newer mtime than FILE -mindepth N at least N dirs down\n-depth ignore contents of dir -maxdepth N at most N dirs down\n-inum N inode number N -empty empty files and dirs\n-type [bcdflps] type is (block, char, dir, file, symlink, pipe, socket)\n-true always true -false always false\n-context PATTERN security context\n-newerXY FILE X=acm time > FILE's Y=acm time (Y=t: FILE is literal time)\n\nNumbers N may be prefixed by a - (less than) or + (greater than). Units for\n-Xtime are d (days, default), h (hours), m (minutes), or s (seconds).\n\nCombine matches with:\n!, -a, -o, ( ) not, and, or, group expressions\n\nActions:\n-print Print match with newline -print0 Print match with null\n-exec Run command with path -execdir Run command in file's dir\n-ok Ask before exec -okdir Ask before execdir\n-delete Remove matching file/dir -printf FORMAT Print using format string\n\nCommands substitute \"{}\" with matched file. End with \";\" to run each file,\nor \"+\" (next argument after \"{}\") to collect and run with multiple files.\n\n-printf FORMAT characters are \\ escapes and:\n%b 512 byte blocks used\n%f basename %g textual gid %G numeric gid\n%i decimal inode %l target of symlink %m octal mode\n%M ls format type/mode %p path to file %P path to file minus DIR\n%s size in bytes %T@ mod time as unixtime\n%u username %U numeric uid %Z security context"
-
-#define HELP_file "usage: file [-bhLs] [file...]\n\nExamine the given files and describe their content types.\n\n-b Brief (no filename)\n-h Don't follow symlinks (default)\n-L Follow symlinks\n-s Show block/char device contents"
-
-#define HELP_false "Return nonzero."
-
-#define HELP_expand "usage: expand [-t TABLIST] [FILE...]\n\nExpand tabs to spaces according to tabstops.\n\n-t TABLIST\n\nSpecify tab stops, either a single number instead of the default 8,\nor a comma separated list of increasing numbers representing tabstop\npositions (absolute, not increments) with each additional tab beyond\nthat becoming one space."
-
-#define HELP_env "usage: env [-i] [-u NAME] [NAME=VALUE...] [COMMAND [ARG...]]\n\nSet the environment for command invocation, or list environment variables.\n\n-i Clear existing environment\n-u NAME Remove NAME from the environment\n-0 Use null instead of newline in output"
-
-#define HELP_echo "usage: echo [-neE] [args...]\n\nWrite each argument to stdout, with one space between each, followed\nby a newline.\n\n-n No trailing newline\n-E Print escape sequences literally (default)\n-e Process the following escape sequences:\n \\\\ Backslash\n \\0NNN Octal values (1 to 3 digits)\n \\a Alert (beep/flash)\n \\b Backspace\n \\c Stop output here (avoids trailing newline)\n \\f Form feed\n \\n Newline\n \\r Carriage return\n \\t Horizontal tab\n \\v Vertical tab\n \\xHH Hexadecimal values (1 to 2 digits)"
-
-#define HELP_du "usage: du [-d N] [-askxHLlmc] [file...]\n\nShow disk usage, space consumed by files and directories.\n\nSize in:\n-k 1024 byte blocks (default)\n-K 512 byte blocks (posix)\n-m Megabytes\n-h Human readable (e.g., 1K 243M 2G)\n\nWhat to show:\n-a All files, not just directories\n-H Follow symlinks on cmdline\n-L Follow all symlinks\n-s Only total size of each argument\n-x Don't leave this filesystem\n-c Cumulative total\n-d N Only depth < N\n-l Disable hardlink filter"
-
-#define HELP_dirname "usage: dirname PATH...\n\nShow directory portion of path."
-
-#define HELP_df "usage: df [-HPkhi] [-t type] [FILESYSTEM ...]\n\nThe \"disk free\" command shows total/used/available disk space for\neach filesystem listed on the command line, or all currently mounted\nfilesystems.\n\n-a Show all (including /proc and friends)\n-P The SUSv3 \"Pedantic\" option\n-k Sets units back to 1024 bytes (the default without -P)\n-h Human readable (K=1024)\n-H Human readable (k=1000)\n-i Show inodes instead of blocks\n-t type Display only filesystems of this type\n\nPedantic provides a slightly less useful output format dictated by Posix,\nand sets the units to 512 bytes instead of the default 1024 bytes."
-
-#define HELP_date "usage: date [-u] [-r FILE] [-d DATE] [+DISPLAY_FORMAT] [-D SET_FORMAT] [SET]\n\nSet/get the current date/time. With no SET shows the current date.\n\n-d Show DATE instead of current time (convert date format)\n-D +FORMAT for SET or -d (instead of MMDDhhmm[[CC]YY][.ss])\n-r Use modification time of FILE instead of current date\n-u Use UTC instead of current timezone\n\nSupported input formats:\n\nMMDDhhmm[[CC]YY][.ss] POSIX\n@UNIXTIME[.FRACTION] seconds since midnight 1970-01-01\nYYYY-MM-DD [hh:mm[:ss]] ISO 8601\nhh:mm[:ss] 24-hour time today\n\nAll input formats can be preceded by TZ=\"id\" to set the input time zone\nseparately from the output time zone. Otherwise $TZ sets both.\n\n+FORMAT specifies display format string using strftime(3) syntax:\n\n%% literal % %n newline %t tab\n%S seconds (00-60) %M minute (00-59) %m month (01-12)\n%H hour (0-23) %I hour (01-12) %p AM/PM\n%y short year (00-99) %Y year %C century\n%a short weekday name %A weekday name %u day of week (1-7, 1=mon)\n%b short month name %B month name %Z timezone name\n%j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)\n%N nanosec (output only)\n\n%U Week of year (0-53 start sunday) %W Week of year (0-53 start monday)\n%V Week of year (1-53 start monday, week < 4 days not part of this year)\n\n%D = \"%m/%d/%y\" %r = \"%I : %M : %S %p\" %T = \"%H:%M:%S\" %h = \"%b\"\n%x locale date %X locale time %c locale date/time"
-
-#define HELP_cut "usage: cut [-Ds] [-bcfF LIST] [-dO DELIM] [FILE...]\n\nPrint selected parts of lines from each FILE to standard output.\n\nEach selection LIST is comma separated, either numbers (counting from 1)\nor dash separated ranges (inclusive, with X- meaning to end of line and -X\nfrom start). By default selection ranges are sorted and collated, use -D\nto prevent that.\n\n-b Select bytes\n-c Select UTF-8 characters\n-C Select unicode columns\n-d Use DELIM (default is TAB for -f, run of whitespace for -F)\n-D Don't sort/collate selections or match -fF lines without delimiter\n-f Select fields (words) separated by single DELIM character\n-F Select fields separated by DELIM regex\n-O Output delimiter (default one space for -F, input delim for -f)\n-s Skip lines without delimiters"
-
-#define HELP_cpio "usage: cpio -{o|t|i|p DEST} [-v] [--verbose] [-F FILE] [--no-preserve-owner]\n [ignored: -mdu -H newc]\n\nCopy files into and out of a \"newc\" format cpio archive.\n\n-F FILE Use archive FILE instead of stdin/stdout\n-p DEST Copy-pass mode, copy stdin file list to directory DEST\n-i Extract from archive into file system (stdin=archive)\n-o Create archive (stdin=list of files, stdout=archive)\n-t Test files (list only, stdin=archive, stdout=list of files)\n-v Verbose\n--no-preserve-owner (don't set ownership during extract)\n--trailer Add legacy trailer (prevents concatenation)"
-
-#define HELP_install "usage: install [-dDpsv] [-o USER] [-g GROUP] [-m MODE] [SOURCE...] DEST\n\nCopy files and set attributes.\n\n-d Act like mkdir -p\n-D Create leading directories for DEST\n-g Make copy belong to GROUP\n-m Set permissions to MODE\n-o Make copy belong to USER\n-p Preserve timestamps\n-s Call \"strip -p\"\n-v Verbose"
-
-#define HELP_mv "usage: mv [-fivn] SOURCE... DEST\n\n-f Force copy by deleting destination file\n-i Interactive, prompt before overwriting existing DEST\n-v Verbose\n-n No clobber (don't overwrite DEST)"
-
-#define HELP_cp_preserve "--preserve takes either a comma separated list of attributes, or the first\nletter(s) of:\n\n mode - permissions (ignore umask for rwx, copy suid and sticky bit)\n ownership - user and group\n timestamps - file creation, modification, and access times.\n context - security context\n xattr - extended attributes\n all - all of the above\n\nusage: cp [--preserve=motcxa] [-adlnrsvfipRHLP] SOURCE... DEST\n\nCopy files from SOURCE to DEST. If more than one SOURCE, DEST must\nbe a directory.\n-v Verbose\n-s Symlink instead of copy\n-r Synonym for -R\n-n No clobber (don't overwrite DEST)\n-l Hard link instead of copy\n-d Don't dereference symlinks\n-a Same as -dpr\n-P Do not follow symlinks [default]\n-L Follow all symlinks\n-H Follow symlinks listed on command line\n-R Recurse into subdirectories (DEST must be a directory)\n-p Preserve timestamps, ownership, and mode\n-i Interactive, prompt before overwriting existing DEST\n-F Delete any existing destination file first (--remove-destination)\n-f Delete destination files we can't write to\n-D Create leading dirs under DEST (--parents)"
-
-#define HELP_cp "usage: cp [--preserve=motcxa] [-adlnrsvfipRHLP] SOURCE... DEST\n\nCopy files from SOURCE to DEST. If more than one SOURCE, DEST must\nbe a directory.\n-v Verbose\n-s Symlink instead of copy\n-r Synonym for -R\n-n No clobber (don't overwrite DEST)\n-l Hard link instead of copy\n-d Don't dereference symlinks\n-a Same as -dpr\n-P Do not follow symlinks [default]\n-L Follow all symlinks\n-H Follow symlinks listed on command line\n-R Recurse into subdirectories (DEST must be a directory)\n-p Preserve timestamps, ownership, and mode\n-i Interactive, prompt before overwriting existing DEST\n-F Delete any existing destination file first (--remove-destination)\n-f Delete destination files we can't write to\n-D Create leading dirs under DEST (--parents)\n--preserve takes either a comma separated list of attributes, or the first\nletter(s) of:\n\n mode - permissions (ignore umask for rwx, copy suid and sticky bit)\n ownership - user and group\n timestamps - file creation, modification, and access times.\n context - security context\n xattr - extended attributes\n all - all of the above"
-
-#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 [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."
-
-#define HELP_cksum "usage: cksum [-IPLN] [file...]\n\nFor each file, output crc32 checksum value, length and name of file.\nIf no files listed, copy from stdin. Filename \"-\" is a synonym for stdin.\n\n-H Hexadecimal checksum (defaults to decimal)\n-L Little endian (defaults to big endian)\n-P Pre-inversion\n-I Skip post-inversion\n-N Do not include length in CRC calculation (or output)"
-
-#define HELP_chmod "usage: chmod [-R] MODE FILE...\n\nChange mode of listed file[s] (recursively with -R).\n\nMODE can be (comma-separated) stanzas: [ugoa][+-=][rwxstXugo]\n\nStanzas are applied in order: For each category (u = user,\ng = group, o = other, a = all three, if none specified default is a),\nset (+), clear (-), or copy (=), r = read, w = write, x = execute.\ns = u+s = suid, g+s = sgid, o+s = sticky. (+t is an alias for o+s).\nsuid/sgid: execute as the user/group who owns the file.\nsticky: can't delete files you don't own out of this directory\nX = x for directories or if any category already has x set.\n\nOr MODE can be an octal value up to 7777 ug uuugggooo top +\nbit 1 = o+x, bit 1<<8 = u+w, 1<<11 = g+1 sstrwxrwxrwx bottom\n\nExamples:\nchmod u+w file - allow owner of \"file\" to write to it.\nchmod 744 file - user can read/write/execute, everyone else read only"
-
-#define HELP_chown "see: chgrp"
-
-#define HELP_chgrp "usage: chgrp/chown [-RHLP] [-fvh] group file...\n\nChange group of one or more files.\n\n-f Suppress most error messages\n-h Change symlinks instead of what they point to\n-R Recurse into subdirectories (implies -h)\n-H With -R change target of symlink, follow command line symlinks\n-L With -R change target of symlink, follow all symlinks\n-P With -R change symlink, do not follow symlinks (default)\n-v Verbose"
-
-#define HELP_catv "usage: catv [-evt] [filename...]\n\nDisplay nonprinting characters as escape sequences. Use M-x for\nhigh ascii characters (>127), and ^x for other nonprinting chars.\n\n-e Mark each newline with $\n-t Show tabs as ^I\n-v Don't use ^x or M-x escapes"
-
-#define HELP_cat "usage: cat [-etuv] [file...]\n\nCopy (concatenate) files to stdout. If no files listed, copy from stdin.\nFilename \"-\" is a synonym for stdin.\n\n-e Mark each newline with $\n-t Show tabs as ^I\n-u Copy one byte at a time (slow)\n-v Display nonprinting characters as escape sequences with M-x for\n high ascii characters (>127), and ^x for other nonprinting chars"
-
-#define HELP_cal "usage: cal [[month] year]\n\nPrint a calendar.\n\nWith one argument, prints all months of the specified year.\nWith two arguments, prints calendar for month and year."
-
-#define HELP_basename "usage: basename [-a] [-s SUFFIX] NAME... | NAME [SUFFIX]\n\nReturn non-directory portion of a pathname removing suffix.\n\n-a All arguments are names\n-s SUFFIX Remove suffix (implies -a)"
-
diff --git a/android/mac/generated/newtoys.h b/android/mac/generated/newtoys.h
deleted file mode 100644
index 62b1d24a..00000000
--- a/android/mac/generated/newtoys.h
+++ /dev/null
@@ -1,301 +0,0 @@
-USE_TOYBOX(NEWTOY(toybox, NULL, TOYFLAG_STAYROOT))
-USE_SH(OLDTOY(-bash, sh, 0))
-USE_SH(OLDTOY(-sh, sh, 0))
-USE_SH(OLDTOY(-toysh, sh, 0))
-USE_TRUE(OLDTOY(:, true, TOYFLAG_NOFORK|TOYFLAG_NOHELP))
-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))
-USE_BASE64(NEWTOY(base64, "diw#<0=76[!dw]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_BASENAME(NEWTOY(basename, "^<1as:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SH(OLDTOY(bash, sh, TOYFLAG_BIN))
-USE_BC(NEWTOY(bc, "i(interactive)l(mathlib)q(quiet)s(standard)w(warn)", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_BLKID(NEWTOY(blkid, "ULs*[!LU]", TOYFLAG_BIN))
-USE_BLOCKDEV(NEWTOY(blockdev, "<1>1(setro)(setrw)(getro)(getss)(getbsz)(setbsz)#<0(getsz)(getsize)(getsize64)(getra)(setra)#<0(flushbufs)(rereadpt)",TOYFLAG_SBIN))
-USE_BOOTCHARTD(NEWTOY(bootchartd, 0, TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
-USE_BRCTL(NEWTOY(brctl, "<1", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_BUNZIP2(NEWTOY(bunzip2, "cftkv", TOYFLAG_USR|TOYFLAG_BIN))
-USE_BZCAT(NEWTOY(bzcat, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_CAL(NEWTOY(cal, ">2", TOYFLAG_USR|TOYFLAG_BIN))
-USE_CAT(NEWTOY(cat, "u"USE_CAT_V("vte"), TOYFLAG_BIN))
-USE_CATV(NEWTOY(catv, USE_CATV("vte"), TOYFLAG_USR|TOYFLAG_BIN))
-USE_SH(NEWTOY(cd, NULL, TOYFLAG_NOFORK))
-USE_CHATTR(NEWTOY(chattr, NULL, TOYFLAG_BIN))
-USE_CHCON(NEWTOY(chcon, "<2hvR", TOYFLAG_USR|TOYFLAG_BIN))
-USE_CHGRP(NEWTOY(chgrp, "<2hPLHRfv[-HLP]", TOYFLAG_BIN))
-USE_CHMOD(NEWTOY(chmod, "<2?vRf[-vf]", TOYFLAG_BIN))
-USE_CHOWN(OLDTOY(chown, chgrp, TOYFLAG_BIN))
-USE_CHROOT(NEWTOY(chroot, "^<1", TOYFLAG_USR|TOYFLAG_SBIN|TOYFLAG_ARGFAIL(125)))
-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, "<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))
-USE_CPIO(NEWTOY(cpio, "(no-preserve-owner)(trailer)mduH:p:|i|t|F:v(verbose)o|[!pio][!pot][!pF]", TOYFLAG_BIN))
-USE_CRC32(NEWTOY(crc32, 0, TOYFLAG_BIN))
-USE_CROND(NEWTOY(crond, "fbSl#<0=8d#<0L:c:[-bf][-LS][-ld]", TOYFLAG_USR|TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_CRONTAB(NEWTOY(crontab, "c:u:elr[!elr]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_STAYROOT))
-USE_CUT(NEWTOY(cut, "b*|c*|f*|F*|C*|O(output-delimiter):d:sDn[!cbf]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_DATE(NEWTOY(date, "d:D:r:u[!dr]", TOYFLAG_BIN))
-USE_DD(NEWTOY(dd, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_DEALLOCVT(NEWTOY(deallocvt, ">1", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_NEEDROOT))
-USE_GROUPDEL(OLDTOY(delgroup, groupdel, TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
-USE_USERDEL(OLDTOY(deluser, userdel, TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
-USE_DEMO_MANY_OPTIONS(NEWTOY(demo_many_options, "ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba", TOYFLAG_BIN))
-USE_DEMO_NUMBER(NEWTOY(demo_number, "D#=3<3hdbs", TOYFLAG_BIN))
-USE_DEMO_SCANKEY(NEWTOY(demo_scankey, 0, TOYFLAG_BIN))
-USE_DEMO_UTF8TOWC(NEWTOY(demo_utf8towc, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_DEVMEM(NEWTOY(devmem, "<1>3", TOYFLAG_USR|TOYFLAG_BIN))
-USE_DF(NEWTOY(df, "HPkhit*a[-HPkh]", TOYFLAG_SBIN))
-USE_DHCP(NEWTOY(dhcp, "V:H:F:x*r:O*A#<0=20T#<0=3t#<0=3s:p:i:SBRCaovqnbf", TOYFLAG_SBIN|TOYFLAG_ROOTONLY))
-USE_DHCP6(NEWTOY(dhcp6, "r:A#<0T#<0t#<0s:p:i:SRvqnbf", TOYFLAG_SBIN|TOYFLAG_ROOTONLY))
-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))
-USE_ECHO(NEWTOY(echo, "^?Een[-eE]", TOYFLAG_BIN|TOYFLAG_MAYFORK))
-USE_EGREP(OLDTOY(egrep, grep, TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
-USE_EJECT(NEWTOY(eject, ">1stT[!tT]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_ENV(NEWTOY(env, "^0iu*", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(125)))
-USE_SH(NEWTOY(exit, NULL, TOYFLAG_NOFORK))
-USE_EXPAND(NEWTOY(expand, "t*", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_EXPR(NEWTOY(expr, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_FACTOR(NEWTOY(factor, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_FALLOCATE(NEWTOY(fallocate, ">1l#|o#", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FALSE(NEWTOY(false, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP))
-USE_FDISK(NEWTOY(fdisk, "C#<0H#<0S#<0b#<512ul", TOYFLAG_SBIN))
-USE_FGREP(OLDTOY(fgrep, grep, TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
-USE_FILE(NEWTOY(file, "<1bhLs[!hL]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FIND(NEWTOY(find, "?^HL[-HL]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FLOCK(NEWTOY(flock, "<1>1nsux[-sux]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FMT(NEWTOY(fmt, "w#<0=75", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_FOLD(NEWTOY(fold, "bsuw#<1", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FREE(NEWTOY(free, "htgmkb[!htgmkb]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FREERAMDISK(NEWTOY(freeramdisk, "<1>1", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_FSCK(NEWTOY(fsck, "?t:ANPRTVsC#", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FSFREEZE(NEWTOY(fsfreeze, "<1>1f|u|[!fu]", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_FSTYPE(NEWTOY(fstype, "<1", TOYFLAG_BIN))
-USE_FSYNC(NEWTOY(fsync, "<1d", TOYFLAG_BIN))
-USE_FTPGET(NEWTOY(ftpget, "<2>3P:cp:u:vgslLmMdD[-gs][!gslLmMdD][!clL]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FTPPUT(OLDTOY(ftpput, ftpget, TOYFLAG_USR|TOYFLAG_BIN))
-USE_GETCONF(NEWTOY(getconf, ">2al", TOYFLAG_USR|TOYFLAG_BIN))
-USE_GETENFORCE(NEWTOY(getenforce, ">0", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_GETFATTR(NEWTOY(getfattr, "(only-values)dhn:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_GETTY(NEWTOY(getty, "<2t#<0H:I:l:f:iwnmLh",TOYFLAG_SBIN))
-USE_GREP(NEWTOY(grep, "(line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]", TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
-USE_GROUPADD(NEWTOY(groupadd, "<1>2g#<0S", TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
-USE_GROUPDEL(NEWTOY(groupdel, "<1>2", TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
-USE_GROUPS(NEWTOY(groups, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_GUNZIP(NEWTOY(gunzip, "cdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_GZIP(NEWTOY(gzip, "ncdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_REBOOT(OLDTOY(halt, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_HEAD(NEWTOY(head, "?n(lines)#<0=10c(bytes)#<0qv[-nc]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_HELLO(NEWTOY(hello, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_HELP(NEWTOY(help, ""USE_HELP_EXTRAS("ah"), TOYFLAG_BIN))
-USE_HEXEDIT(NEWTOY(hexedit, "<1>1r", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_HOST(NEWTOY(host, "<1>2avt:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_HOSTID(NEWTOY(hostid, ">0", TOYFLAG_USR|TOYFLAG_BIN))
-USE_HOSTNAME(NEWTOY(hostname, ">1bdsfF:[!bdsf]", TOYFLAG_BIN))
-USE_HWCLOCK(NEWTOY(hwclock, ">0(fast)f(rtc):u(utc)l(localtime)t(systz)s(hctosys)r(show)w(systohc)[-ul][!rtsw]", TOYFLAG_SBIN))
-USE_I2CDETECT(NEWTOY(i2cdetect, ">3aFly", TOYFLAG_USR|TOYFLAG_BIN))
-USE_I2CDUMP(NEWTOY(i2cdump, "<2>2fy", TOYFLAG_USR|TOYFLAG_BIN))
-USE_I2CGET(NEWTOY(i2cget, "<3>3fy", TOYFLAG_USR|TOYFLAG_BIN))
-USE_I2CSET(NEWTOY(i2cset, "<4fy", TOYFLAG_USR|TOYFLAG_BIN))
-USE_ICONV(NEWTOY(iconv, "cst:f:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_ID(NEWTOY(id, ">1"USE_ID_Z("Z")"nGgru[!"USE_ID_Z("Z")"Ggu]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_IFCONFIG(NEWTOY(ifconfig, "^?aS", TOYFLAG_SBIN))
-USE_INIT(NEWTOY(init, "", TOYFLAG_SBIN))
-USE_INOTIFYD(NEWTOY(inotifyd, "<2", TOYFLAG_USR|TOYFLAG_BIN))
-USE_INSMOD(NEWTOY(insmod, "<1", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_INSTALL(NEWTOY(install, "<1cdDpsvm:o:g:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_IONICE(NEWTOY(ionice, "^tc#<0>3=2n#<0>7=5p#", TOYFLAG_USR|TOYFLAG_BIN))
-USE_IORENICE(NEWTOY(iorenice, "?<1>3", TOYFLAG_USR|TOYFLAG_BIN))
-USE_IOTOP(NEWTOY(iotop, ">0AaKO" "Hk*o*p*u*s#<1=7d%<100=3000m#n#<1bq", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_STAYROOT|TOYFLAG_LOCALE))
-USE_IP(NEWTOY(ip, NULL, TOYFLAG_SBIN))
-USE_IP(OLDTOY(ipaddr, ip, TOYFLAG_SBIN))
-USE_IPCRM(NEWTOY(ipcrm, "m*M*s*S*q*Q*", TOYFLAG_USR|TOYFLAG_BIN))
-USE_IPCS(NEWTOY(ipcs, "acptulsqmi#", TOYFLAG_USR|TOYFLAG_BIN))
-USE_IP(OLDTOY(iplink, ip, TOYFLAG_SBIN))
-USE_IP(OLDTOY(iproute, ip, TOYFLAG_SBIN))
-USE_IP(OLDTOY(iprule, ip, TOYFLAG_SBIN))
-USE_IP(OLDTOY(iptunnel, ip, TOYFLAG_SBIN))
-USE_KILL(NEWTOY(kill, "?ls: ", TOYFLAG_BIN))
-USE_KILLALL(NEWTOY(killall, "?s:ilqvw", TOYFLAG_USR|TOYFLAG_BIN))
-USE_KILLALL5(NEWTOY(killall5, "?o*ls: [!lo][!ls]", TOYFLAG_SBIN))
-USE_KLOGD(NEWTOY(klogd, "c#<1>8n", TOYFLAG_SBIN))
-USE_LAST(NEWTOY(last, "f:W", TOYFLAG_BIN))
-USE_LINK(NEWTOY(link, "<2>2", TOYFLAG_USR|TOYFLAG_BIN))
-USE_LN(NEWTOY(ln, "<1t:Tvnfs", TOYFLAG_BIN))
-USE_LOAD_POLICY(NEWTOY(load_policy, "<1>1", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_LOG(NEWTOY(log, "<1p:t:", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_LOGGER(NEWTOY(logger, "st:p:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_LOGIN(NEWTOY(login, ">1f:ph:", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
-USE_LOGNAME(NEWTOY(logname, ">0", TOYFLAG_USR|TOYFLAG_BIN))
-USE_LOGWRAPPER(NEWTOY(logwrapper, 0, TOYFLAG_NOHELP|TOYFLAG_USR|TOYFLAG_BIN))
-USE_LOSETUP(NEWTOY(losetup, ">2S(sizelimit)#s(show)ro#j:fdcaD[!afj]", TOYFLAG_SBIN))
-USE_LS(NEWTOY(ls, "(color):;(full-time)(show-control-chars)ZgoACFHLRSabcdfhikl@mnpqrstux1[-Cxm1][-Cxml][-Cxmo][-Cxmg][-cu][-ftS][-HL][!qb]", TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_LSATTR(NEWTOY(lsattr, "vldaR", TOYFLAG_BIN))
-USE_LSMOD(NEWTOY(lsmod, NULL, TOYFLAG_SBIN))
-USE_LSOF(NEWTOY(lsof, "lp*t", TOYFLAG_USR|TOYFLAG_BIN))
-USE_LSPCI(NEWTOY(lspci, "emkn"USE_LSPCI_TEXT("@i:"), TOYFLAG_USR|TOYFLAG_BIN))
-USE_LSUSB(NEWTOY(lsusb, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_MAKEDEVS(NEWTOY(makedevs, "<1>1d:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MAN(NEWTOY(man, "k:M:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MCOOKIE(NEWTOY(mcookie, "v(verbose)V(version)", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MD5SUM(NEWTOY(md5sum, "bc(check)s(status)[!bc]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MDEV(NEWTOY(mdev, "s", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_UMASK))
-USE_MICROCOM(NEWTOY(microcom, "<1>1s:X", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MIX(NEWTOY(mix, "c:d:l#r#", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MKDIR(NEWTOY(mkdir, "<1"USE_MKDIR_Z("Z:")"vp(parent)(parents)m:", TOYFLAG_BIN|TOYFLAG_UMASK))
-USE_MKE2FS(NEWTOY(mke2fs, "<1>2g:Fnqm#N#i#b#", TOYFLAG_SBIN))
-USE_MKFIFO(NEWTOY(mkfifo, "<1"USE_MKFIFO_Z("Z:")"m:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MKNOD(NEWTOY(mknod, "<2>4m(mode):"USE_MKNOD_Z("Z:"), TOYFLAG_BIN|TOYFLAG_UMASK))
-USE_MKPASSWD(NEWTOY(mkpasswd, ">2S:m:P#=0<0", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MKSWAP(NEWTOY(mkswap, "<1>1L:", TOYFLAG_SBIN))
-USE_MKTEMP(NEWTOY(mktemp, ">1(tmpdir);:uqd(directory)p:t", TOYFLAG_BIN))
-USE_MODINFO(NEWTOY(modinfo, "<1b:k:F:0", TOYFLAG_SBIN))
-USE_MODPROBE(NEWTOY(modprobe, "alrqvsDbd*", TOYFLAG_SBIN))
-USE_MORE(NEWTOY(more, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_MOUNT(NEWTOY(mount, "?O:afnrvwt:o*[-rw]", TOYFLAG_BIN|TOYFLAG_STAYROOT))
-USE_MOUNTPOINT(NEWTOY(mountpoint, "<1qdx[-dx]", TOYFLAG_BIN))
-USE_MV(NEWTOY(mv, "<2vnF(remove-destination)fi[-ni]", TOYFLAG_BIN))
-USE_NBD_CLIENT(OLDTOY(nbd-client, nbd_client, TOYFLAG_USR|TOYFLAG_BIN))
-USE_NBD_CLIENT(NEWTOY(nbd_client, "<3>3ns", 0))
-USE_NETCAT(OLDTOY(nc, netcat, TOYFLAG_USR|TOYFLAG_BIN))
-USE_NETCAT(NEWTOY(netcat, USE_NETCAT_LISTEN("^tlL")"w#<1W#<1p#<1>65535q#<1s:f:46uU"USE_NETCAT_LISTEN("[!tlL][!Lw]")"[!46U]", TOYFLAG_BIN))
-USE_NETSTAT(NEWTOY(netstat, "pWrxwutneal", TOYFLAG_BIN))
-USE_NICE(NEWTOY(nice, "^<1n#", TOYFLAG_BIN))
-USE_NL(NEWTOY(nl, "v#=1l#w#<0=6Eb:n:s:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_NOHUP(NEWTOY(nohup, "<1^", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(125)))
-USE_NPROC(NEWTOY(nproc, "(all)", TOYFLAG_USR|TOYFLAG_BIN))
-USE_NSENTER(NEWTOY(nsenter, "<1F(no-fork)t#<1(target)i:(ipc);m:(mount);n:(net);p:(pid);u:(uts);U:(user);", TOYFLAG_USR|TOYFLAG_BIN))
-USE_OD(NEWTOY(od, "j#vw#<1=16N#xsodcbA:t*", TOYFLAG_USR|TOYFLAG_BIN))
-USE_ONEIT(NEWTOY(oneit, "^<1nc:p3[!pn]", TOYFLAG_SBIN))
-USE_OPENVT(NEWTOY(openvt, "c#<1>63sw", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
-USE_PARTPROBE(NEWTOY(partprobe, "<1", TOYFLAG_SBIN))
-USE_PASSWD(NEWTOY(passwd, ">1a:dlu", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
-USE_PASTE(NEWTOY(paste, "d:s", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_PATCH(NEWTOY(patch, "(no-backup-if-mismatch)(dry-run)"USE_TOYBOX_DEBUG("x")"g#fulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
-USE_PGREP(NEWTOY(pgrep, "?cld:u*U*t*s*P*g*G*fnovxL:[-no]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_PIDOF(NEWTOY(pidof, "<1so:x", TOYFLAG_BIN))
-USE_PING(NEWTOY(ping, "<1>1m#t#<0>255=64c#<0=3s#<0>4088=56i%W#<0=3w#<0qf46I:[-46]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_PING(OLDTOY(ping6, ping, TOYFLAG_USR|TOYFLAG_BIN))
-USE_PIVOT_ROOT(NEWTOY(pivot_root, "<2>2", TOYFLAG_SBIN))
-USE_PKILL(NEWTOY(pkill, "?Vu*U*t*s*P*g*G*fnovxl:[-no]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_PMAP(NEWTOY(pmap, "<1xq", TOYFLAG_USR|TOYFLAG_BIN))
-USE_REBOOT(OLDTOY(poweroff, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_PRINTENV(NEWTOY(printenv, "0(null)", TOYFLAG_BIN))
-USE_PRINTF(NEWTOY(printf, "<1?^", TOYFLAG_USR|TOYFLAG_BIN))
-USE_ULIMIT(OLDTOY(prlimit, ulimit, TOYFLAG_USR|TOYFLAG_BIN))
-USE_PS(NEWTOY(ps, "k(sort)*P(ppid)*aAdeflMno*O*p(pid)*s*t*Tu*U*g*G*wZ[!ol][+Ae][!oO]", TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_PWD(NEWTOY(pwd, ">0LP[-LP]", TOYFLAG_BIN))
-USE_PWDX(NEWTOY(pwdx, "<1a", TOYFLAG_USR|TOYFLAG_BIN))
-USE_READAHEAD(NEWTOY(readahead, NULL, TOYFLAG_BIN))
-USE_READLINK(NEWTOY(readlink, "<1nqmef(canonicalize)[-mef]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_REALPATH(NEWTOY(realpath, "<1", TOYFLAG_USR|TOYFLAG_BIN))
-USE_REBOOT(NEWTOY(reboot, "fn", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_RENICE(NEWTOY(renice, "<1gpun#|", TOYFLAG_USR|TOYFLAG_BIN))
-USE_RESET(NEWTOY(reset, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_RESTORECON(NEWTOY(restorecon, "<1DFnRrv", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_REV(NEWTOY(rev, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_RFKILL(NEWTOY(rfkill, "<1>2", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_RM(NEWTOY(rm, "fiRrv[-fi]", TOYFLAG_BIN))
-USE_RMDIR(NEWTOY(rmdir, "<1(ignore-fail-on-non-empty)p", TOYFLAG_BIN))
-USE_RMMOD(NEWTOY(rmmod, "<1wf", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_ROUTE(NEWTOY(route, "?neA:", TOYFLAG_BIN))
-USE_RUNCON(NEWTOY(runcon, "<2", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_SED(NEWTOY(sed, "(help)(version)e*f*i:;nErz(null-data)[+Er]", TOYFLAG_BIN|TOYFLAG_LOCALE|TOYFLAG_NOHELP))
-USE_SENDEVENT(NEWTOY(sendevent, "<4>4", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_SEQ(NEWTOY(seq, "<1>3?f:s:w[!fw]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SETENFORCE(NEWTOY(setenforce, "<1>1", TOYFLAG_USR|TOYFLAG_SBIN))
-USE_SETFATTR(NEWTOY(setfattr, "hn:|v:x:|[!xv]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SETSID(NEWTOY(setsid, "^<1t", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SH(NEWTOY(sh, "c:i", TOYFLAG_BIN))
-USE_SHA1SUM(NEWTOY(sha1sum, "bc(check)s(status)[!bc]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TOYBOX_LIBCRYPTO(USE_SHA224SUM(OLDTOY(sha224sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_TOYBOX_LIBCRYPTO(USE_SHA256SUM(OLDTOY(sha256sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_TOYBOX_LIBCRYPTO(USE_SHA384SUM(OLDTOY(sha384sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_TOYBOX_LIBCRYPTO(USE_SHA512SUM(OLDTOY(sha512sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_SHRED(NEWTOY(shred, "<1zxus#<1n#<1o#<0f", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SKELETON(NEWTOY(skeleton, "(walrus)(blubber):;(also):e@d*c#b:a", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SKELETON_ALIAS(NEWTOY(skeleton_alias, "b#dq", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SLEEP(NEWTOY(sleep, "<1", TOYFLAG_BIN))
-USE_SNTP(NEWTOY(sntp, ">1M :m :Sp:t#<0=1>16asdDqr#<4>17=10[!as]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SORT(NEWTOY(sort, USE_SORT_FLOAT("g")"S:T:m" "o:k*t:" "xVbMcszdfirun", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
-USE_SPLIT(NEWTOY(split, ">2a#<1=2>9b#<1l#<1[!bl]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_STAT(NEWTOY(stat, "<1c:(format)fLt", TOYFLAG_BIN))
-USE_STRINGS(NEWTOY(strings, "t:an#=4<1fo", TOYFLAG_USR|TOYFLAG_BIN))
-USE_STTY(NEWTOY(stty, "?aF:g[!ag]", TOYFLAG_BIN))
-USE_SU(NEWTOY(su, "^lmpu:g:c:s:[!lmp]", TOYFLAG_BIN|TOYFLAG_ROOTONLY))
-USE_SULOGIN(NEWTOY(sulogin, "t#<0=0", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_SWAPOFF(NEWTOY(swapoff, "<1>1", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_SWAPON(NEWTOY(swapon, "<1>1p#<0>32767d", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
-USE_SWITCH_ROOT(NEWTOY(switch_root, "<2c:h", TOYFLAG_SBIN))
-USE_SYNC(NEWTOY(sync, NULL, TOYFLAG_BIN))
-USE_SYSCTL(NEWTOY(sysctl, "^neNqwpaA[!ap][!aq][!aw][+aA]", TOYFLAG_SBIN))
-USE_SYSLOGD(NEWTOY(syslogd,">0l#<1>8=8R:b#<0>99=1s#<0=200m#<0>71582787=20O:p:f:a:nSKLD", TOYFLAG_SBIN|TOYFLAG_STAYROOT))
-USE_TAC(NEWTOY(tac, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_TAIL(NEWTOY(tail, "?fc-n-[-cn]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TAR(NEWTOY(tar, "&(restrict)(full-time)(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(mode):(mtime):(group):(owner):(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):a[!txc][!jzJa]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TASKSET(NEWTOY(taskset, "<1^pa", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_STAYROOT))
-USE_TCPSVD(NEWTOY(tcpsvd, "^<3c#=30<1C:b#=20<0u:l:hEv", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TEE(NEWTOY(tee, "ia", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TELNET(NEWTOY(telnet, "<1>2", TOYFLAG_BIN))
-USE_TELNETD(NEWTOY(telnetd, "w#<0b:p#<0>65535=23f:l:FSKi[!wi]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TEST(NEWTOY(test, 0, TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
-USE_TFTP(NEWTOY(tftp, "<1b#<8>65464r:l:g|p|[!gp]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TFTPD(NEWTOY(tftpd, "rcu:l", TOYFLAG_BIN))
-USE_TIME(NEWTOY(time, "<1^pv", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TIMEOUT(NEWTOY(timeout, "<2^(foreground)(preserve-status)vk:s(signal):", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(125)))
-USE_TOP(NEWTOY(top, ">0O*" "Hk*o*p*u*s#<1d%<100=3000m#n#<1bq[!oO]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_TOUCH(NEWTOY(touch, "<1acd:fmr:t:h[!dtr]", TOYFLAG_BIN))
-USE_SH(OLDTOY(toysh, sh, TOYFLAG_BIN))
-USE_TR(NEWTOY(tr, "^>2<1Ccsd[+cC]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TRACEROUTE(NEWTOY(traceroute, "<1>2i:f#<1>255=1z#<0>86400=0g*w#<0>86400=5t#<0>255=0s:q#<1>255=3p#<1>65535=33434m#<1>255=30rvndlIUF64", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
-USE_TRACEROUTE(OLDTOY(traceroute6,traceroute, TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
-USE_TRUE(NEWTOY(true, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP))
-USE_TRUNCATE(NEWTOY(truncate, "<1s:|c", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TTY(NEWTOY(tty, "s", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TUNCTL(NEWTOY(tunctl, "<1>1t|d|u:T[!td]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TCPSVD(OLDTOY(udpsvd, tcpsvd, TOYFLAG_USR|TOYFLAG_BIN))
-USE_ULIMIT(NEWTOY(ulimit, ">1P#<1SHavutsrRqpnmlifedc[-SH][!apvutsrRqnmlifedc]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_UMOUNT(NEWTOY(umount, "cndDflrat*v[!na]", TOYFLAG_BIN|TOYFLAG_STAYROOT))
-USE_UNAME(NEWTOY(uname, "oamvrns[+os]", TOYFLAG_BIN))
-USE_UNIQ(NEWTOY(uniq, "f#s#w#zicdu", TOYFLAG_USR|TOYFLAG_BIN))
-USE_UNIX2DOS(NEWTOY(unix2dos, 0, TOYFLAG_BIN))
-USE_UNLINK(NEWTOY(unlink, "<1>1", TOYFLAG_USR|TOYFLAG_BIN))
-USE_UNSHARE(NEWTOY(unshare, "<1^f(fork);r(map-root-user);i:(ipc);m:(mount);n:(net);p:(pid);u:(uts);U:(user);", TOYFLAG_USR|TOYFLAG_BIN))
-USE_UPTIME(NEWTOY(uptime, ">0ps", TOYFLAG_USR|TOYFLAG_BIN))
-USE_USERADD(NEWTOY(useradd, "<1>2u#<0G:s:g:h:SDH", TOYFLAG_NEEDROOT|TOYFLAG_UMASK|TOYFLAG_SBIN))
-USE_USERDEL(NEWTOY(userdel, "<1>1r", TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
-USE_USLEEP(NEWTOY(usleep, "<1", TOYFLAG_BIN))
-USE_UUDECODE(NEWTOY(uudecode, ">1o:", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_UMASK))
-USE_UUENCODE(NEWTOY(uuencode, "<1>2m", TOYFLAG_USR|TOYFLAG_BIN))
-USE_UUIDGEN(NEWTOY(uuidgen, ">0r(random)", TOYFLAG_USR|TOYFLAG_BIN))
-USE_VCONFIG(NEWTOY(vconfig, "<2>4", TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
-USE_VI(NEWTOY(vi, "<1>1", TOYFLAG_USR|TOYFLAG_BIN))
-USE_VMSTAT(NEWTOY(vmstat, ">2n", TOYFLAG_BIN))
-USE_W(NEWTOY(w, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_WATCH(NEWTOY(watch, "^<1n%<100=2000tebx", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_WC(NEWTOY(wc, "mcwl", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-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: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))
-USE_ZCAT(NEWTOY(zcat, "cdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
diff --git a/android/mac/generated/tags.h b/android/mac/generated/tags.h
deleted file mode 100644
index e1e4d314..00000000
--- a/android/mac/generated/tags.h
+++ /dev/null
@@ -1,140 +0,0 @@
-#define DD_conv_fsync 0
-#define _DD_conv_fsync (1<<0)
-#define DD_conv_noerror 1
-#define _DD_conv_noerror (1<<1)
-#define DD_conv_notrunc 2
-#define _DD_conv_notrunc (1<<2)
-#define DD_conv_sync 3
-#define _DD_conv_sync (1<<3)
-#define DD_iflag_count_bytes 0
-#define _DD_iflag_count_bytes (1<<0)
-#define DD_iflag_skip_bytes 1
-#define _DD_iflag_skip_bytes (1<<1)
-#define DD_oflag_seek_bytes 0
-#define _DD_oflag_seek_bytes (1<<0)
-#define CP_mode 0
-#define _CP_mode (1<<0)
-#define CP_ownership 1
-#define _CP_ownership (1<<1)
-#define CP_timestamps 2
-#define _CP_timestamps (1<<2)
-#define CP_context 3
-#define _CP_context (1<<3)
-#define CP_xattr 4
-#define _CP_xattr (1<<4)
-#define PS_PID 0
-#define _PS_PID (1<<0)
-#define PS_PPID 1
-#define _PS_PPID (1<<1)
-#define PS_PRI 2
-#define _PS_PRI (1<<2)
-#define PS_NI 3
-#define _PS_NI (1<<3)
-#define PS_ADDR 4
-#define _PS_ADDR (1<<4)
-#define PS_SZ 5
-#define _PS_SZ (1<<5)
-#define PS_RSS 6
-#define _PS_RSS (1<<6)
-#define PS_PGID 7
-#define _PS_PGID (1<<7)
-#define PS_VSZ 8
-#define _PS_VSZ (1<<8)
-#define PS_MAJFL 9
-#define _PS_MAJFL (1<<9)
-#define PS_MINFL 10
-#define _PS_MINFL (1<<10)
-#define PS_PR 11
-#define _PS_PR (1<<11)
-#define PS_PSR 12
-#define _PS_PSR (1<<12)
-#define PS_RTPRIO 13
-#define _PS_RTPRIO (1<<13)
-#define PS_SCH 14
-#define _PS_SCH (1<<14)
-#define PS_CPU 15
-#define _PS_CPU (1<<15)
-#define PS_TID 16
-#define _PS_TID (1<<16)
-#define PS_TCNT 17
-#define _PS_TCNT (1<<17)
-#define PS_BIT 18
-#define _PS_BIT (1<<18)
-#define PS_TTY 19
-#define _PS_TTY (1<<19)
-#define PS_WCHAN 20
-#define _PS_WCHAN (1<<20)
-#define PS_LABEL 21
-#define _PS_LABEL (1<<21)
-#define PS_COMM 22
-#define _PS_COMM (1<<22)
-#define PS_NAME 23
-#define _PS_NAME (1<<23)
-#define PS_COMMAND 24
-#define _PS_COMMAND (1<<24)
-#define PS_CMDLINE 25
-#define _PS_CMDLINE (1<<25)
-#define PS_ARGS 26
-#define _PS_ARGS (1<<26)
-#define PS_CMD 27
-#define _PS_CMD (1<<27)
-#define PS_UID 28
-#define _PS_UID (1<<28)
-#define PS_USER 29
-#define _PS_USER (1<<29)
-#define PS_RUID 30
-#define _PS_RUID (1<<30)
-#define PS_RUSER 31
-#define _PS_RUSER (1<<31)
-#define PS_GID 32
-#define _PS_GID (1LL<<32)
-#define PS_GROUP 33
-#define _PS_GROUP (1LL<<33)
-#define PS_RGID 34
-#define _PS_RGID (1LL<<34)
-#define PS_RGROUP 35
-#define _PS_RGROUP (1LL<<35)
-#define PS_TIME 36
-#define _PS_TIME (1LL<<36)
-#define PS_ELAPSED 37
-#define _PS_ELAPSED (1LL<<37)
-#define PS_TIME_ 38
-#define _PS_TIME_ (1LL<<38)
-#define PS_C 39
-#define _PS_C (1LL<<39)
-#define PS__VSZ 40
-#define _PS__VSZ (1LL<<40)
-#define PS__MEM 41
-#define _PS__MEM (1LL<<41)
-#define PS__CPU 42
-#define _PS__CPU (1LL<<42)
-#define PS_VIRT 43
-#define _PS_VIRT (1LL<<43)
-#define PS_RES 44
-#define _PS_RES (1LL<<44)
-#define PS_SHR 45
-#define _PS_SHR (1LL<<45)
-#define PS_READ 46
-#define _PS_READ (1LL<<46)
-#define PS_WRITE 47
-#define _PS_WRITE (1LL<<47)
-#define PS_IO 48
-#define _PS_IO (1LL<<48)
-#define PS_DREAD 49
-#define _PS_DREAD (1LL<<49)
-#define PS_DWRITE 50
-#define _PS_DWRITE (1LL<<50)
-#define PS_SWAP 51
-#define _PS_SWAP (1LL<<51)
-#define PS_DIO 52
-#define _PS_DIO (1LL<<52)
-#define PS_STIME 53
-#define _PS_STIME (1LL<<53)
-#define PS_F 54
-#define _PS_F (1LL<<54)
-#define PS_S 55
-#define _PS_S (1LL<<55)
-#define PS_STAT 56
-#define _PS_STAT (1LL<<56)
-#define PS_PCY 57
-#define _PS_PCY (1LL<<57)
diff --git a/configure b/configure
index 4735a7e9..06d7cbab 100755
--- a/configure
+++ b/configure
@@ -20,8 +20,6 @@ fi
# Required for our expected ABI. we're 8-bit clean thus "char" must be unsigned.
CFLAGS="$CFLAGS -funsigned-char"
[ -z "$OPTIMIZE" ] && OPTIMIZE="-Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fno-strict-aliasing"
-# set ASAN=1 to enable "address sanitizer" and debuggable backtraces
-[ -z "$ASAN" ] || { CFLAGS="$CFLAGS -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address"; NOSTRIP=1; }
# We accept LDFLAGS, but by default don't have anything in it
if [ "$(uname)" != "Darwin" ]
@@ -39,5 +37,3 @@ fi
# If HOSTCC needs CFLAGS or LDFLAGS, just add them to the variable
# ala HOSTCC="blah-cc --static"
[ -z "$HOSTCC" ] && HOSTCC=cc
-
-[ -z "$GENERATED" ] && GENERATED=generated
diff --git a/android/device/generated/config.h b/generated/config.h
index 34ca773e..d018081a 100644
--- a/android/device/generated/config.h
+++ b/generated/config.h
@@ -54,8 +54,6 @@
#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
@@ -168,8 +166,6 @@
#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
@@ -232,6 +228,8 @@
#define USE_GETENFORCE(...) __VA_ARGS__
#define CFG_GETFATTR 1
#define USE_GETFATTR(...) __VA_ARGS__
+#define CFG_GETPROP 0
+#define USE_GETPROP(...)
#define CFG_GETTY 0
#define USE_GETTY(...)
#define CFG_GREP 1
@@ -350,8 +348,6 @@
#define USE_LS_Z(...) __VA_ARGS__
#define CFG_MAKEDEVS 1
#define USE_MAKEDEVS(...) __VA_ARGS__
-#define CFG_MAN 0
-#define USE_MAN(...)
#define CFG_MCOOKIE 0
#define USE_MCOOKIE(...)
#define CFG_MD5SUM 1
@@ -502,6 +498,8 @@
#define USE_SETENFORCE(...) __VA_ARGS__
#define CFG_SETFATTR 1
#define USE_SETFATTR(...) __VA_ARGS__
+#define CFG_SETPROP 1
+#define USE_SETPROP(...) __VA_ARGS__
#define CFG_SETSID 1
#define USE_SETSID(...) __VA_ARGS__
#define CFG_SHA1SUM 1
@@ -536,8 +534,12 @@
#define USE_SORT(...) __VA_ARGS__
#define CFG_SPLIT 1
#define USE_SPLIT(...) __VA_ARGS__
+#define CFG_START 1
+#define USE_START(...) __VA_ARGS__
#define CFG_STAT 1
#define USE_STAT(...) __VA_ARGS__
+#define CFG_STOP 1
+#define USE_STOP(...) __VA_ARGS__
#define CFG_STRINGS 1
#define USE_STRINGS(...) __VA_ARGS__
#define CFG_STTY 1
diff --git a/android/device/generated/flags.h b/generated/flags.h
index 4c12cbf4..0255f55c 100644
--- a/android/device/generated/flags.h
+++ b/generated/flags.h
@@ -21,14 +21,6 @@
#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]"
@@ -84,9 +76,9 @@
#undef FLAG_d
#endif
-// basename ^<1as: ^<1as:
+// basename <1as: <1as:
#undef OPTSTR_basename
-#define OPTSTR_basename "^<1as:"
+#define OPTSTR_basename "<1as:"
#ifdef CLEANUP_basename
#undef CLEANUP_basename
#undef FOR_basename
@@ -107,13 +99,12 @@
#undef FLAG_i
#endif
-// blkid ULs*[!LU] ULs*[!LU]
+// blkid UL[!LU] UL[!LU]
#undef OPTSTR_blkid
-#define OPTSTR_blkid "ULs*[!LU]"
+#define OPTSTR_blkid "UL[!LU]"
#ifdef CLEANUP_blkid
#undef CLEANUP_blkid
#undef FOR_blkid
-#undef FLAG_s
#undef FLAG_L
#undef FLAG_U
#endif
@@ -313,9 +304,9 @@
#undef FOR_clear
#endif
-// cmp <1>2ls(silent)(quiet)[!ls] <1>2ls(silent)(quiet)[!ls]
+// cmp <2>2ls(silent)(quiet)[!ls] <2>2ls(silent)(quiet)[!ls]
#undef OPTSTR_cmp
-#define OPTSTR_cmp "<1>2ls(silent)(quiet)[!ls]"
+#define OPTSTR_cmp "<2>2ls(silent)(quiet)[!ls]"
#ifdef CLEANUP_cmp
#undef CLEANUP_cmp
#undef FOR_cmp
@@ -529,9 +520,9 @@
#undef FLAG_Z
#endif
-// demo_number D#=3<3hdbs
+// demo_number hdbs
#undef OPTSTR_demo_number
-#define OPTSTR_demo_number "D#=3<3hdbs"
+#define OPTSTR_demo_number "hdbs"
#ifdef CLEANUP_demo_number
#undef CLEANUP_demo_number
#undef FOR_demo_number
@@ -539,7 +530,6 @@
#undef FLAG_b
#undef FLAG_d
#undef FLAG_h
-#undef FLAG_D
#endif
// demo_scankey
@@ -648,9 +638,9 @@
#undef FLAG_P
#endif
-// 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 <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
+// diff <2>2(color)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 <2>2(color)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
#undef OPTSTR_diff
-#define OPTSTR_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"
+#define OPTSTR_diff "<2>2(color)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"
#ifdef CLEANUP_diff
#undef CLEANUP_diff
#undef FOR_diff
@@ -670,7 +660,6 @@
#undef FLAG_b
#undef FLAG_d
#undef FLAG_B
-#undef FLAG_strip_trailing_cr
#undef FLAG_color
#endif
@@ -699,14 +688,6 @@
#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
@@ -746,15 +727,14 @@
#undef FLAG_a
#endif
-// echo ^?Een[-eE] ^?Een[-eE]
+// echo ^?en ^?en
#undef OPTSTR_echo
-#define OPTSTR_echo "^?Een[-eE]"
+#define OPTSTR_echo "^?en"
#ifdef CLEANUP_echo
#undef CLEANUP_echo
#undef FOR_echo
#undef FLAG_n
#undef FLAG_e
-#undef FLAG_E
#endif
// eject >1stT[!tT]
@@ -844,16 +824,14 @@
#undef FLAG_C
#endif
-// file <1bhLs[!hL] <1bhLs[!hL]
+// file <1hL[!hL] <1hL[!hL]
#undef OPTSTR_file
-#define OPTSTR_file "<1bhLs[!hL]"
+#define OPTSTR_file "<1hL[!hL]"
#ifdef CLEANUP_file
#undef CLEANUP_file
#undef FOR_file
-#undef FLAG_s
#undef FLAG_L
#undef FLAG_h
-#undef FLAG_b
#endif
// find ?^HL[-HL] ?^HL[-HL]
@@ -1016,6 +994,15 @@
#undef FLAG_only_values
#endif
+// getprop >2Z
+#undef OPTSTR_getprop
+#define OPTSTR_getprop ">2Z"
+#ifdef CLEANUP_getprop
+#undef CLEANUP_getprop
+#undef FOR_getprop
+#undef FLAG_Z
+#endif
+
// getty <2t#<0H:I:l:f:iwnmLh
#undef OPTSTR_getty
#define OPTSTR_getty "<2t#<0H:I:l:f:iwnmLh"
@@ -1035,9 +1022,9 @@
#undef FLAG_t
#endif
-// grep (line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw] (line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]
+// grep (color):;S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw] (color):;S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]
#undef OPTSTR_grep
-#define OPTSTR_grep "(line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]"
+#define OPTSTR_grep "(color):;S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]"
#ifdef CLEANUP_grep
#undef CLEANUP_grep
#undef FOR_grep
@@ -1054,7 +1041,6 @@
#undef FLAG_w
#undef FLAG_v
#undef FLAG_s
-#undef FLAG_R
#undef FLAG_r
#undef FLAG_o
#undef FLAG_n
@@ -1070,9 +1056,7 @@
#undef FLAG_Z
#undef FLAG_M
#undef FLAG_S
-#undef FLAG_exclude_dir
#undef FLAG_color
-#undef FLAG_line_buffered
#endif
// groupadd <1>2g#<0S
@@ -1122,9 +1106,9 @@
#undef FLAG_c
#endif
-// gzip ncdfk123456789[-123456789] ncdfk123456789[-123456789]
+// gzip cdfk123456789[-123456789] cdfk123456789[-123456789]
#undef OPTSTR_gzip
-#define OPTSTR_gzip "ncdfk123456789[-123456789]"
+#define OPTSTR_gzip "cdfk123456789[-123456789]"
#ifdef CLEANUP_gzip
#undef CLEANUP_gzip
#undef FOR_gzip
@@ -1141,7 +1125,6 @@
#undef FLAG_f
#undef FLAG_d
#undef FLAG_c
-#undef FLAG_n
#endif
// head ?n(lines)#<0=10c(bytes)#<0qv[-nc] ?n(lines)#<0=10c(bytes)#<0qv[-nc]
@@ -1443,17 +1426,16 @@
#undef FLAG_l
#endif
-// killall ?s:ilqvw ?s:ilqvw
+// killall ?s:lqvi ?s:lqvi
#undef OPTSTR_killall
-#define OPTSTR_killall "?s:ilqvw"
+#define OPTSTR_killall "?s:lqvi"
#ifdef CLEANUP_killall
#undef CLEANUP_killall
#undef FOR_killall
-#undef FLAG_w
+#undef FLAG_i
#undef FLAG_v
#undef FLAG_q
#undef FLAG_l
-#undef FLAG_i
#undef FLAG_s
#endif
@@ -1496,9 +1478,9 @@
#undef FOR_link
#endif
-// ln <1t:Tvnfs <1t:Tvnfs
+// ln <1vnfs <1vnfs
#undef OPTSTR_ln
-#define OPTSTR_ln "<1t:Tvnfs"
+#define OPTSTR_ln "<1vnfs"
#ifdef CLEANUP_ln
#undef CLEANUP_ln
#undef FOR_ln
@@ -1506,8 +1488,6 @@
#undef FLAG_f
#undef FLAG_n
#undef FLAG_v
-#undef FLAG_T
-#undef FLAG_t
#endif
// load_policy <1>1 <1>1
@@ -1566,13 +1546,12 @@
#undef FOR_logwrapper
#endif
-// losetup >2S(sizelimit)#s(show)ro#j:fdcaD[!afj] >2S(sizelimit)#s(show)ro#j:fdcaD[!afj]
+// losetup >2S(sizelimit)#s(show)ro#j:fdca[!afj] >2S(sizelimit)#s(show)ro#j:fdca[!afj]
#undef OPTSTR_losetup
-#define OPTSTR_losetup ">2S(sizelimit)#s(show)ro#j:fdcaD[!afj]"
+#define OPTSTR_losetup ">2S(sizelimit)#s(show)ro#j:fdca[!afj]"
#ifdef CLEANUP_losetup
#undef CLEANUP_losetup
#undef FOR_losetup
-#undef FLAG_D
#undef FLAG_a
#undef FLAG_c
#undef FLAG_d
@@ -1686,16 +1665,6 @@
#undef FLAG_d
#endif
-// man k:M:
-#undef OPTSTR_man
-#define OPTSTR_man "k:M:"
-#ifdef CLEANUP_man
-#undef CLEANUP_man
-#undef FOR_man
-#undef FLAG_M
-#undef FLAG_k
-#endif
-
// mcookie v(verbose)V(version)
#undef OPTSTR_mcookie
#define OPTSTR_mcookie "v(verbose)V(version)"
@@ -1816,9 +1785,9 @@
#undef FLAG_L
#endif
-// mktemp >1(tmpdir);:uqd(directory)p:t >1(tmpdir);:uqd(directory)p:t
+// mktemp >1uqd(directory)p(tmpdir):t >1uqd(directory)p(tmpdir):t
#undef OPTSTR_mktemp
-#define OPTSTR_mktemp ">1(tmpdir);:uqd(directory)p:t"
+#define OPTSTR_mktemp ">1uqd(directory)p(tmpdir):t"
#ifdef CLEANUP_mktemp
#undef CLEANUP_mktemp
#undef FOR_mktemp
@@ -1827,7 +1796,6 @@
#undef FLAG_d
#undef FLAG_q
#undef FLAG_u
-#undef FLAG_tmpdir
#endif
// modinfo <1b:k:F:0 <1b:k:F:0
@@ -1918,13 +1886,12 @@
#undef FLAG_n
#endif
-// netcat ^tlLw#<1W#<1p#<1>65535q#<1s:f:46uU[!tlL][!Lw][!46U] ^tlLw#<1W#<1p#<1>65535q#<1s:f:46uU[!tlL][!Lw][!46U]
+// netcat ^tlLw#<1W#<1p#<1>65535q#<1s:f:46u[!tlL][!Lw][!46] ^tlLw#<1W#<1p#<1>65535q#<1s:f:46u[!tlL][!Lw][!46]
#undef OPTSTR_netcat
-#define OPTSTR_netcat "^tlLw#<1W#<1p#<1>65535q#<1s:f:46uU[!tlL][!Lw][!46U]"
+#define OPTSTR_netcat "^tlLw#<1W#<1p#<1>65535q#<1s:f:46u[!tlL][!Lw][!46]"
#ifdef CLEANUP_netcat
#undef CLEANUP_netcat
#undef FOR_netcat
-#undef FLAG_U
#undef FLAG_u
#undef FLAG_6
#undef FLAG_4
@@ -1967,9 +1934,9 @@
#undef FLAG_n
#endif
-// nl v#=1l#w#<0=6Eb:n:s: v#=1l#w#<0=6Eb:n:s:
+// nl v#<1=1l#w#<0=6Eb:n:s: v#<1=1l#w#<0=6Eb:n:s:
#undef OPTSTR_nl
-#define OPTSTR_nl "v#=1l#w#<0=6Eb:n:s:"
+#define OPTSTR_nl "v#<1=1l#w#<0=6Eb:n:s:"
#ifdef CLEANUP_nl
#undef CLEANUP_nl
#undef FOR_nl
@@ -2088,9 +2055,9 @@
#undef FLAG_d
#endif
-// patch (no-backup-if-mismatch)(dry-run)g#fulp#d:i:Rs(quiet) (no-backup-if-mismatch)(dry-run)xg#fulp#d:i:Rs(quiet)
+// patch (dry-run)ulp#d:i:Rs(quiet) (dry-run)xulp#d:i:Rs(quiet)
#undef OPTSTR_patch
-#define OPTSTR_patch "(no-backup-if-mismatch)(dry-run)g#fulp#d:i:Rs(quiet)"
+#define OPTSTR_patch "(dry-run)ulp#d:i:Rs(quiet)"
#ifdef CLEANUP_patch
#undef CLEANUP_patch
#undef FOR_patch
@@ -2101,11 +2068,8 @@
#undef FLAG_p
#undef FLAG_l
#undef FLAG_u
-#undef FLAG_f
-#undef FLAG_g
#undef FLAG_x
#undef FLAG_dry_run
-#undef FLAG_no_backup_if_mismatch
#endif
// pgrep ?cld:u*U*t*s*P*g*G*fnovxL:[-no] ?cld:u*U*t*s*P*g*G*fnovxL:[-no]
@@ -2132,13 +2096,12 @@
#undef FLAG_c
#endif
-// pidof <1so:x <1so:x
+// pidof <1so: <1so:
#undef OPTSTR_pidof
-#define OPTSTR_pidof "<1so:x"
+#define OPTSTR_pidof "<1so:"
#ifdef CLEANUP_pidof
#undef CLEANUP_pidof
#undef FOR_pidof
-#undef FLAG_x
#undef FLAG_o
#undef FLAG_s
#endif
@@ -2277,9 +2240,9 @@
#undef FOR_readahead
#endif
-// readlink <1nqmef(canonicalize)[-mef] <1nqmef(canonicalize)[-mef]
+// readlink <1>1nqmef(canonicalize)[-mef] <1>1nqmef(canonicalize)[-mef]
#undef OPTSTR_readlink
-#define OPTSTR_readlink "<1nqmef(canonicalize)[-mef]"
+#define OPTSTR_readlink "<1>1nqmef(canonicalize)[-mef]"
#ifdef CLEANUP_readlink
#undef CLEANUP_readlink
#undef FOR_readlink
@@ -2371,14 +2334,13 @@
#undef FLAG_f
#endif
-// rmdir <1(ignore-fail-on-non-empty)p <1(ignore-fail-on-non-empty)p
+// rmdir <1p <1p
#undef OPTSTR_rmdir
-#define OPTSTR_rmdir "<1(ignore-fail-on-non-empty)p"
+#define OPTSTR_rmdir "<1p"
#ifdef CLEANUP_rmdir
#undef CLEANUP_rmdir
#undef FOR_rmdir
#undef FLAG_p
-#undef FLAG_ignore_fail_on_non_empty
#endif
// rmmod <1wf <1wf
@@ -2466,6 +2428,14 @@
#undef FLAG_h
#endif
+// setprop <2>2 <2>2
+#undef OPTSTR_setprop
+#define OPTSTR_setprop "<2>2"
+#ifdef CLEANUP_setprop
+#undef CLEANUP_setprop
+#undef FOR_setprop
+#endif
+
// setsid ^<1t ^<1t
#undef OPTSTR_setsid
#define OPTSTR_setsid "^<1t"
@@ -2546,9 +2516,9 @@
#undef FOR_sleep
#endif
-// sntp >1M :m :Sp:t#<0=1>16asdDqr#<4>17=10[!as]
+// sntp M:m:Sp:asdDqr#<4>17=10[!as]
#undef OPTSTR_sntp
-#define OPTSTR_sntp ">1M :m :Sp:t#<0=1>16asdDqr#<4>17=10[!as]"
+#define OPTSTR_sntp "M:m:Sp:asdDqr#<4>17=10[!as]"
#ifdef CLEANUP_sntp
#undef CLEANUP_sntp
#undef FOR_sntp
@@ -2558,7 +2528,6 @@
#undef FLAG_d
#undef FLAG_s
#undef FLAG_a
-#undef FLAG_t
#undef FLAG_p
#undef FLAG_S
#undef FLAG_m
@@ -2604,6 +2573,14 @@
#undef FLAG_a
#endif
+// start
+#undef OPTSTR_start
+#define OPTSTR_start 0
+#ifdef CLEANUP_start
+#undef CLEANUP_start
+#undef FOR_start
+#endif
+
// stat <1c:(format)fLt <1c:(format)fLt
#undef OPTSTR_stat
#define OPTSTR_stat "<1c:(format)fLt"
@@ -2616,6 +2593,14 @@
#undef FLAG_c
#endif
+// stop
+#undef OPTSTR_stop
+#define OPTSTR_stop 0
+#ifdef CLEANUP_stop
+#undef CLEANUP_stop
+#undef FOR_stop
+#endif
+
// strings t:an#=4<1fo t:an#=4<1fo
#undef OPTSTR_strings
#define OPTSTR_strings "t:an#=4<1fo"
@@ -2757,23 +2742,20 @@
#undef FLAG_f
#endif
-// tar &(restrict)(full-time)(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(mode):(mtime):(group):(owner):(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):a[!txc][!jzJa] &(restrict)(full-time)(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(mode):(mtime):(group):(owner):(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):a[!txc][!jzJa]
+// tar &(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)j(bzip2)z(gzip)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):[!txc][!jz] &(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)j(bzip2)z(gzip)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):[!txc][!jz]
#undef OPTSTR_tar
-#define OPTSTR_tar "&(restrict)(full-time)(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(mode):(mtime):(group):(owner):(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):a[!txc][!jzJa]"
+#define OPTSTR_tar "&(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)j(bzip2)z(gzip)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):[!txc][!jz]"
#ifdef CLEANUP_tar
#undef CLEANUP_tar
#undef FOR_tar
-#undef FLAG_a
#undef FLAG_f
#undef FLAG_C
#undef FLAG_T
#undef FLAG_X
#undef FLAG_m
#undef FLAG_O
-#undef FLAG_S
#undef FLAG_z
#undef FLAG_j
-#undef FLAG_J
#undef FLAG_v
#undef FLAG_t
#undef FLAG_x
@@ -2783,17 +2765,11 @@
#undef FLAG_p
#undef FLAG_o
#undef FLAG_to_command
-#undef FLAG_owner
-#undef FLAG_group
-#undef FLAG_mtime
-#undef FLAG_mode
#undef FLAG_exclude
#undef FLAG_overwrite
#undef FLAG_no_same_permissions
#undef FLAG_numeric_owner
#undef FLAG_no_recursion
-#undef FLAG_full_time
-#undef FLAG_restrict
#endif
// taskset <1^pa <1^pa
@@ -3273,14 +3249,13 @@
#undef FLAG_m
#endif
-// wget (no-check-certificate)O:
+// wget f:
#undef OPTSTR_wget
-#define OPTSTR_wget "(no-check-certificate)O:"
+#define OPTSTR_wget "f:"
#ifdef CLEANUP_wget
#undef CLEANUP_wget
#undef FOR_wget
-#undef FLAG_O
-#undef FLAG_no_check_certificate
+#undef FLAG_f
#endif
// which <1a <1a
@@ -3301,9 +3276,9 @@
#undef FLAG_a
#endif
-// xargs ^E:P#optrn#<1(max-args)s#0[!0E] ^E:P#optrn#<1(max-args)s#0[!0E]
+// xargs ^I:E:ptrn#<1s#0[!0E] ^I:E:ptrn#<1s#0[!0E]
#undef OPTSTR_xargs
-#define OPTSTR_xargs "^E:P#optrn#<1(max-args)s#0[!0E]"
+#define OPTSTR_xargs "^I:E:ptrn#<1s#0[!0E]"
#ifdef CLEANUP_xargs
#undef CLEANUP_xargs
#undef FOR_xargs
@@ -3313,9 +3288,8 @@
#undef FLAG_r
#undef FLAG_t
#undef FLAG_p
-#undef FLAG_o
-#undef FLAG_P
#undef FLAG_E
+#undef FLAG_I
#endif
// xxd >1c#l#o#g#<1=2iprs#[!rs] >1c#l#o#g#<1=2iprs#[!rs]
@@ -3382,12 +3356,6 @@
#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
@@ -3458,9 +3426,8 @@
#ifndef TT
#define TT this.blkid
#endif
-#define FLAG_s (1<<0)
-#define FLAG_L (1<<1)
-#define FLAG_U (1<<2)
+#define FLAG_L (1<<0)
+#define FLAG_U (1<<1)
#endif
#ifdef FOR_blockdev
@@ -3820,7 +3787,6 @@
#define FLAG_b (FORCED_FLAG<<1)
#define FLAG_d (FORCED_FLAG<<2)
#define FLAG_h (FORCED_FLAG<<3)
-#define FLAG_D (FORCED_FLAG<<4)
#endif
#ifdef FOR_demo_scankey
@@ -3935,8 +3901,7 @@
#define FLAG_b (1<<13)
#define FLAG_d (1<<14)
#define FLAG_B (1<<15)
-#define FLAG_strip_trailing_cr (1<<16)
-#define FLAG_color (1<<17)
+#define FLAG_color (1<<16)
#endif
#ifdef FOR_dirname
@@ -3960,12 +3925,6 @@
#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
@@ -4005,7 +3964,6 @@
#endif
#define FLAG_n (1<<0)
#define FLAG_e (1<<1)
-#define FLAG_E (1<<2)
#endif
#ifdef FOR_eject
@@ -4081,10 +4039,8 @@
#ifndef TT
#define TT this.file
#endif
-#define FLAG_s (1<<0)
-#define FLAG_L (1<<1)
-#define FLAG_h (1<<2)
-#define FLAG_b (1<<3)
+#define FLAG_L (1<<0)
+#define FLAG_h (1<<1)
#endif
#ifdef FOR_find
@@ -4219,6 +4175,13 @@
#define FLAG_only_values (1<<3)
#endif
+#ifdef FOR_getprop
+#ifndef TT
+#define TT this.getprop
+#endif
+#define FLAG_Z (FORCED_FLAG<<0)
+#endif
+
#ifdef FOR_getty
#ifndef TT
#define TT this.getty
@@ -4253,25 +4216,22 @@
#define FLAG_w (1<<10)
#define FLAG_v (1<<11)
#define FLAG_s (1<<12)
-#define FLAG_R (1<<13)
-#define FLAG_r (1<<14)
-#define FLAG_o (1<<15)
-#define FLAG_n (1<<16)
-#define FLAG_i (1<<17)
-#define FLAG_h (1<<18)
-#define FLAG_b (1<<19)
-#define FLAG_a (1<<20)
-#define FLAG_I (1<<21)
-#define FLAG_H (1<<22)
-#define FLAG_F (1<<23)
-#define FLAG_E (1<<24)
-#define FLAG_z (1<<25)
-#define FLAG_Z (1<<26)
-#define FLAG_M (1<<27)
-#define FLAG_S (1<<28)
-#define FLAG_exclude_dir (1<<29)
-#define FLAG_color (1<<30)
-#define FLAG_line_buffered (1<<31)
+#define FLAG_r (1<<13)
+#define FLAG_o (1<<14)
+#define FLAG_n (1<<15)
+#define FLAG_i (1<<16)
+#define FLAG_h (1<<17)
+#define FLAG_b (1<<18)
+#define FLAG_a (1<<19)
+#define FLAG_I (1<<20)
+#define FLAG_H (1<<21)
+#define FLAG_F (1<<22)
+#define FLAG_E (1<<23)
+#define FLAG_z (1<<24)
+#define FLAG_Z (1<<25)
+#define FLAG_M (1<<26)
+#define FLAG_S (1<<27)
+#define FLAG_color (1<<28)
#endif
#ifdef FOR_groupadd
@@ -4330,7 +4290,6 @@
#define FLAG_f (1<<10)
#define FLAG_d (1<<11)
#define FLAG_c (1<<12)
-#define FLAG_n (1<<13)
#endif
#ifdef FOR_head
@@ -4584,12 +4543,11 @@
#ifndef TT
#define TT this.killall
#endif
-#define FLAG_w (1<<0)
+#define FLAG_i (1<<0)
#define FLAG_v (1<<1)
#define FLAG_q (1<<2)
#define FLAG_l (1<<3)
-#define FLAG_i (1<<4)
-#define FLAG_s (1<<5)
+#define FLAG_s (1<<4)
#endif
#ifdef FOR_killall5
@@ -4631,8 +4589,6 @@
#define FLAG_f (1<<1)
#define FLAG_n (1<<2)
#define FLAG_v (1<<3)
-#define FLAG_T (1<<4)
-#define FLAG_t (1<<5)
#endif
#ifdef FOR_load_policy
@@ -4683,16 +4639,15 @@
#ifndef TT
#define TT this.losetup
#endif
-#define FLAG_D (1<<0)
-#define FLAG_a (1<<1)
-#define FLAG_c (1<<2)
-#define FLAG_d (1<<3)
-#define FLAG_f (1<<4)
-#define FLAG_j (1<<5)
-#define FLAG_o (1<<6)
-#define FLAG_r (1<<7)
-#define FLAG_s (1<<8)
-#define FLAG_S (1<<9)
+#define FLAG_a (1<<0)
+#define FLAG_c (1<<1)
+#define FLAG_d (1<<2)
+#define FLAG_f (1<<3)
+#define FLAG_j (1<<4)
+#define FLAG_o (1<<5)
+#define FLAG_r (1<<6)
+#define FLAG_s (1<<7)
+#define FLAG_S (1<<8)
#endif
#ifdef FOR_ls
@@ -4783,14 +4738,6 @@
#define FLAG_d (1<<0)
#endif
-#ifdef FOR_man
-#ifndef TT
-#define TT this.man
-#endif
-#define FLAG_M (FORCED_FLAG<<0)
-#define FLAG_k (FORCED_FLAG<<1)
-#endif
-
#ifdef FOR_mcookie
#ifndef TT
#define TT this.mcookie
@@ -4898,7 +4845,6 @@
#define FLAG_d (1<<2)
#define FLAG_q (1<<3)
#define FLAG_u (1<<4)
-#define FLAG_tmpdir (1<<5)
#endif
#ifdef FOR_modinfo
@@ -4979,19 +4925,18 @@
#ifndef TT
#define TT this.netcat
#endif
-#define FLAG_U (1<<0)
-#define FLAG_u (1<<1)
-#define FLAG_6 (1<<2)
-#define FLAG_4 (1<<3)
-#define FLAG_f (1<<4)
-#define FLAG_s (1<<5)
-#define FLAG_q (1<<6)
-#define FLAG_p (1<<7)
-#define FLAG_W (1<<8)
-#define FLAG_w (1<<9)
-#define FLAG_L (1<<10)
-#define FLAG_l (1<<11)
-#define FLAG_t (1<<12)
+#define FLAG_u (1<<0)
+#define FLAG_6 (1<<1)
+#define FLAG_4 (1<<2)
+#define FLAG_f (1<<3)
+#define FLAG_s (1<<4)
+#define FLAG_q (1<<5)
+#define FLAG_p (1<<6)
+#define FLAG_W (1<<7)
+#define FLAG_w (1<<8)
+#define FLAG_L (1<<9)
+#define FLAG_l (1<<10)
+#define FLAG_t (1<<11)
#endif
#ifdef FOR_netstat
@@ -5130,11 +5075,8 @@
#define FLAG_p (1<<4)
#define FLAG_l (1<<5)
#define FLAG_u (1<<6)
-#define FLAG_f (1<<7)
-#define FLAG_g (1<<8)
-#define FLAG_x (FORCED_FLAG<<9)
-#define FLAG_dry_run (1<<10)
-#define FLAG_no_backup_if_mismatch (1<<11)
+#define FLAG_x (FORCED_FLAG<<7)
+#define FLAG_dry_run (1<<8)
#endif
#ifdef FOR_pgrep
@@ -5163,9 +5105,8 @@
#ifndef TT
#define TT this.pidof
#endif
-#define FLAG_x (1<<0)
-#define FLAG_o (1<<1)
-#define FLAG_s (1<<2)
+#define FLAG_o (1<<0)
+#define FLAG_s (1<<1)
#endif
#ifdef FOR_ping
@@ -5363,7 +5304,6 @@
#define TT this.rmdir
#endif
#define FLAG_p (1<<0)
-#define FLAG_ignore_fail_on_non_empty (1<<1)
#endif
#ifdef FOR_rmmod
@@ -5435,6 +5375,12 @@
#define FLAG_h (1<<3)
#endif
+#ifdef FOR_setprop
+#ifndef TT
+#define TT this.setprop
+#endif
+#endif
+
#ifdef FOR_setsid
#ifndef TT
#define TT this.setsid
@@ -5511,11 +5457,10 @@
#define FLAG_d (FORCED_FLAG<<3)
#define FLAG_s (FORCED_FLAG<<4)
#define FLAG_a (FORCED_FLAG<<5)
-#define FLAG_t (FORCED_FLAG<<6)
-#define FLAG_p (FORCED_FLAG<<7)
-#define FLAG_S (FORCED_FLAG<<8)
-#define FLAG_m (FORCED_FLAG<<9)
-#define FLAG_M (FORCED_FLAG<<10)
+#define FLAG_p (FORCED_FLAG<<6)
+#define FLAG_S (FORCED_FLAG<<7)
+#define FLAG_m (FORCED_FLAG<<8)
+#define FLAG_M (FORCED_FLAG<<9)
#endif
#ifdef FOR_sort
@@ -5553,6 +5498,12 @@
#define FLAG_a (1<<2)
#endif
+#ifdef FOR_start
+#ifndef TT
+#define TT this.start
+#endif
+#endif
+
#ifdef FOR_stat
#ifndef TT
#define TT this.stat
@@ -5563,6 +5514,12 @@
#define FLAG_c (1<<3)
#endif
+#ifdef FOR_stop
+#ifndef TT
+#define TT this.stop
+#endif
+#endif
+
#ifdef FOR_strings
#ifndef TT
#define TT this.strings
@@ -5684,37 +5641,28 @@
#ifndef TT
#define TT this.tar
#endif
-#define FLAG_a (1<<0)
-#define FLAG_f (1<<1)
-#define FLAG_C (1<<2)
-#define FLAG_T (1<<3)
-#define FLAG_X (1<<4)
-#define FLAG_m (1<<5)
-#define FLAG_O (1<<6)
-#define FLAG_S (1<<7)
-#define FLAG_z (1<<8)
-#define FLAG_j (1<<9)
-#define FLAG_J (1<<10)
-#define FLAG_v (1<<11)
-#define FLAG_t (1<<12)
-#define FLAG_x (1<<13)
-#define FLAG_h (1<<14)
-#define FLAG_c (1<<15)
-#define FLAG_k (1<<16)
-#define FLAG_p (1<<17)
-#define FLAG_o (1<<18)
-#define FLAG_to_command (1<<19)
-#define FLAG_owner (1<<20)
-#define FLAG_group (1<<21)
-#define FLAG_mtime (1<<22)
-#define FLAG_mode (1<<23)
-#define FLAG_exclude (1<<24)
-#define FLAG_overwrite (1<<25)
-#define FLAG_no_same_permissions (1<<26)
-#define FLAG_numeric_owner (1<<27)
-#define FLAG_no_recursion (1<<28)
-#define FLAG_full_time (1<<29)
-#define FLAG_restrict (1<<30)
+#define FLAG_f (1<<0)
+#define FLAG_C (1<<1)
+#define FLAG_T (1<<2)
+#define FLAG_X (1<<3)
+#define FLAG_m (1<<4)
+#define FLAG_O (1<<5)
+#define FLAG_z (1<<6)
+#define FLAG_j (1<<7)
+#define FLAG_v (1<<8)
+#define FLAG_t (1<<9)
+#define FLAG_x (1<<10)
+#define FLAG_h (1<<11)
+#define FLAG_c (1<<12)
+#define FLAG_k (1<<13)
+#define FLAG_p (1<<14)
+#define FLAG_o (1<<15)
+#define FLAG_to_command (1<<16)
+#define FLAG_exclude (1<<17)
+#define FLAG_overwrite (1<<18)
+#define FLAG_no_same_permissions (1<<19)
+#define FLAG_numeric_owner (1<<20)
+#define FLAG_no_recursion (1<<21)
#endif
#ifdef FOR_taskset
@@ -6120,8 +6068,7 @@
#ifndef TT
#define TT this.wget
#endif
-#define FLAG_O (FORCED_FLAG<<0)
-#define FLAG_no_check_certificate (FORCED_FLAG<<1)
+#define FLAG_f (FORCED_FLAG<<0)
#endif
#ifdef FOR_which
@@ -6148,9 +6095,8 @@
#define FLAG_r (1<<3)
#define FLAG_t (1<<4)
#define FLAG_p (1<<5)
-#define FLAG_o (1<<6)
-#define FLAG_P (1<<7)
-#define FLAG_E (1<<8)
+#define FLAG_E (1<<6)
+#define FLAG_I (1<<7)
#endif
#ifdef FOR_xxd
diff --git a/android/mac/generated/globals.h b/generated/globals.h
index 04334b61..82089a4d 100644
--- a/android/mac/generated/globals.h
+++ b/generated/globals.h
@@ -1,13 +1,15 @@
-// toys/android/log.c
+// toys/android/getprop.c
-struct log_data {
- char *t, *p;
+struct getprop_data {
+ size_t size;
+ char **nv; // name/value pairs: even=name, odd=value
+ struct selabel_handle *handle;
};
-// toys/example/demo_number.c
+// toys/android/log.c
-struct demo_number_data {
- long D;
+struct log_data {
+ char *t, *p;
};
// toys/example/hello.c
@@ -44,12 +46,6 @@ struct dmesg_data {
time_t tea;
};
-// toys/lsb/gzip.c
-
-struct gzip_data {
- int level;
-};
-
// toys/lsb/hostname.c
struct hostname_data {
@@ -65,7 +61,6 @@ struct killall_data {
pid_t cur_pid;
char **names;
short *err;
- struct int_list { struct int_list *next; int val; } *pids;
};
// toys/lsb/md5sum.c
@@ -92,7 +87,7 @@ struct mknod_data {
// toys/lsb/mktemp.c
struct mktemp_data {
- char *p, *tmpdir;
+ char *p;
};
// toys/lsb/mount.c
@@ -193,7 +188,7 @@ struct ping_data {
// toys/net/sntp.c
struct sntp_data {
- long r, t;
+ long r;
char *p, *m, *M;
};
@@ -218,12 +213,6 @@ struct base64_data {
unsigned total;
};
-// toys/other/blkid.c
-
-struct blkid_data {
- struct arg_list *s;
-};
-
// toys/other/blockdev.c
struct blockdev_data {
@@ -307,7 +296,6 @@ struct losetup_data {
int openflags;
dev_t jdev;
ino_t jino;
- char *dir;
};
// toys/other/lspci.c
@@ -322,7 +310,7 @@ struct lspci_data {
// toys/other/makedevs.c
struct makedevs_data {
- char *d;
+ char *fname;
};
// toys/other/mix.c
@@ -351,7 +339,6 @@ struct modinfo_data {
char *F, *k, *b;
long mod;
- int count;
};
// toys/other/nsenter.c
@@ -406,12 +393,6 @@ struct switch_root_data {
dev_t rootdev;
};
-// toys/other/tac.c
-
-struct tac_data {
- struct double_list *dl;
-};
-
// toys/other/timeout.c
struct timeout_data {
@@ -492,7 +473,7 @@ struct bootchartd_data {
int proc_accounting;
int is_login;
- pid_t cur_pid;
+ void *head;
};
// toys/pending/brctl.c
@@ -533,7 +514,6 @@ struct dd_data {
long sz, count;
unsigned long long offset;
} in, out;
- unsigned conv, iflag, oflag;
};;
// toys/pending/dhcp.c
@@ -657,6 +637,12 @@ struct groupadd_data {
long gid;
};
+// toys/pending/gzip.c
+
+struct gzip_data {
+ int level;
+};
+
// toys/pending/host.c
struct host_data {
@@ -714,15 +700,6 @@ struct lsof_data {
int last_shown_pid, shown_header;
};
-// toys/pending/man.c
-
-struct man_data {
- char *M, *k;
-
- char any, cell, ex, *f, k_done, *line, *m, **sct, **scts, **sufs;
- regex_t reg;
-};
-
// toys/pending/mke2fs.c
struct mke2fs_data {
@@ -787,29 +764,6 @@ struct sh_data {
char *command;
long lineno;
-
- struct double_list functions;
- unsigned options;
-
- // Running jobs.
- struct sh_job {
- struct sh_job *next, *prev;
- unsigned jobno;
-
- // Every pipeline has at least one set of arguments or it's Not A Thing
- struct sh_arg {
- char **v;
- int c;
- } pipeline;
-
- // null terminated array of running processes in pipeline
- struct sh_process {
- struct string_list *delete; // expanded strings
- int pid, exit; // status? Stopped? Exited?
- struct sh_arg arg;
- } *procs, *proc;
- } *jobs, *job;
- unsigned jobcnt;
};
// toys/pending/stty.c
@@ -846,6 +800,20 @@ struct syslogd_data {
int sigfd[2];
};
+// toys/pending/tar.c
+
+struct tar_data {
+ char *fname;
+ char *dir;
+ struct arg_list *inc_file;
+ struct arg_list *exc_file;
+ char *tocmd;
+ struct arg_list *exc;
+
+ struct arg_list *inc, *pass;
+ void *inodes, *handle;
+};
+
// toys/pending/tcpsvd.c
struct tcpsvd_data {
@@ -959,20 +927,9 @@ struct useradd_data {
struct vi_data {
int cur_col;
int cur_row;
- int scr_row;
- int drawn_row;
- int drawn_col;
unsigned screen_height;
unsigned screen_width;
int vi_mode;
- int count0;
- int count1;
- int vi_mov_flag;
- int modified;
- char vi_reg;
- char *last_search;
- int tabstop;
- int list;
};
// toys/pending/wget.c
@@ -1111,14 +1068,13 @@ struct find_data {
int topdir, xdev, depth;
time_t now;
long max_bytes;
- char *start;
};
// toys/posix/grep.c
struct grep_data {
long m, A, B, C;
- struct arg_list *f, *e, *M, *S, *exclude_dir;
+ struct arg_list *f, *e, *M, *S;
char *color;
char *purple, *cyan, *red, *green, *grey;
@@ -1156,12 +1112,6 @@ struct kill_data {
struct arg_list *o;
};
-// toys/posix/ln.c
-
-struct ln_data {
- char *t;
-};
-
// toys/posix/logger.c
struct logger_data {
@@ -1209,7 +1159,6 @@ struct nl_data {
// Count of consecutive blank lines for -l has to persist between files
long lcount;
- long slen;
};
// toys/posix/od.c
@@ -1238,7 +1187,7 @@ struct paste_data {
struct patch_data {
char *i, *d;
- long p, g;
+ long p;
struct double_list *current_hunk;
long oldline, oldlen, newline, newlen;
@@ -1313,7 +1262,6 @@ struct sort_data {
void *key_list;
int linecount;
char **lines;
- char *name;
};
// toys/posix/split.c
@@ -1336,42 +1284,7 @@ struct strings_data {
struct tail_data {
long n, c;
- int file_no, last_fd;
- struct xnotify *not;
-};
-
-// toys/posix/tar.c
-
-struct tar_data {
- char *f, *C;
- struct arg_list *T, *X;
- char *to_command, *owner, *group, *mtime, *mode;
- struct arg_list *exclude;
-
- struct double_list *incl, *excl, *seen;
- struct string_list *dirs;
- char *cwd;
- int fd, ouid, ggid, hlc, warn, adev, aino, sparselen;
- long long *sparse;
- time_t mtt;
-
- // hardlinks seen so far (hlc many)
- struct {
- char *arg;
- ino_t ino;
- dev_t dev;
- } *hlx;
-
- // Parsed information about a tar header.
- struct tar_header {
- char *name, *link_target, *uname, *gname;
- long long size, ssize;
- uid_t uid;
- gid_t gid;
- mode_t mode;
- time_t mtime;
- dev_t device;
- } hdr;
+ int file_no, ffd, *files;
};
// toys/posix/tee.c
@@ -1415,21 +1328,19 @@ struct wc_data {
// toys/posix/xargs.c
struct xargs_data {
- long s, n, P;
- char *E;
+ long s, n;
+ char *E, *I;
long entries, bytes;
char delim;
- FILE *tty;
};
extern union global_union {
+ struct getprop_data getprop;
struct log_data log;
- struct demo_number_data demo_number;
struct hello_data hello;
struct skeleton_data skeleton;
struct dmesg_data dmesg;
- struct gzip_data gzip;
struct hostname_data hostname;
struct killall_data killall;
struct md5sum_data md5sum;
@@ -1451,7 +1362,6 @@ extern union global_union {
struct tunctl_data tunctl;
struct acpi_data acpi;
struct base64_data base64;
- struct blkid_data blkid;
struct blockdev_data blockdev;
struct chrt_data chrt;
struct dos2unix_data dos2unix;
@@ -1476,7 +1386,6 @@ extern union global_union {
struct stat_data stat;
struct swapon_data swapon;
struct switch_root_data switch_root;
- struct tac_data tac;
struct timeout_data timeout;
struct truncate_data truncate;
struct watch_data watch;
@@ -1501,6 +1410,7 @@ extern union global_union {
struct getfattr_data getfattr;
struct getty_data getty;
struct groupadd_data groupadd;
+ struct gzip_data gzip;
struct host_data host;
struct ip_data ip;
struct ipcrm_data ipcrm;
@@ -1508,7 +1418,6 @@ extern union global_union {
struct klogd_data klogd;
struct last_data last;
struct lsof_data lsof;
- struct man_data man;
struct mke2fs_data mke2fs;
struct modprobe_data modprobe;
struct more_data more;
@@ -1518,6 +1427,7 @@ extern union global_union {
struct stty_data stty;
struct sulogin_data sulogin;
struct syslogd_data syslogd;
+ struct tar_data tar;
struct tcpsvd_data tcpsvd;
struct telnet_data telnet;
struct telnetd_data telnetd;
@@ -1548,7 +1458,6 @@ extern union global_union {
struct iconv_data iconv;
struct id_data id;
struct kill_data kill;
- struct ln_data ln;
struct logger_data logger;
struct ls_data ls;
struct mkdir_data mkdir;
@@ -1565,7 +1474,6 @@ extern union global_union {
struct split_data split;
struct strings_data strings;
struct tail_data tail;
- struct tar_data tar;
struct tee_data tee;
struct touch_data touch;
struct ulimit_data ulimit;
diff --git a/android/device/generated/help.h b/generated/help.h
index 86eb663a..fbc1fb37 100644
--- a/android/device/generated/help.h
+++ b/generated/help.h
@@ -1,604 +1,610 @@
-#define HELP_toybox_musl_nommu_is_broken "When using musl-libc on a nommu system, you'll need to say \"y\" here.\n\nAlthough uclibc lets you detect support for things like fork() and\ndaemon() at compile time, musl intentionally includes broken versions\nthat always return -ENOSYS on nommu systems, and goes out of its way\nto prevent any cross-compile compatible compile-time probes for a\nnommu system. (It doesn't even #define __MUSL__ in features.h.)\n\nMusl does this despite the fact that a nommu system can't even run\nstandard ELF binaries, and requires specially packaged executables.\nSo our only choice is to manually provide a musl nommu bug workaround\nyou can manually select to enable (larger, slower) nommu support with\nmusl."
+#define HELP_toybox_musl_nommu_is_broken "When using musl-libc on a nommu system, you'll need to say \"y\" here.\n\nAlthough uclibc lets you detect support for things like fork() and\ndaemon() at compile time, musl intentionally includes broken versions\nthat always return -ENOSYS on nommu systems, and goes out of its way\nto prevent any cross-compile compatible compile-time probes for a\nnommu system. (It doesn't even #define __MUSL__ in features.h.)\n\nMusl does this despite the fact that a nommu system can't even run\nstandard ELF binaries, and requires specially packaged executables.\nSo our only choice is to manually provide a musl nommu bug workaround\nyou can manually select to enable (larger, slower) nommu support with\nmusl.\n\n"
-#define HELP_toybox_uid_usr "When commands like useradd/groupadd allocate user IDs, start here."
+#define HELP_toybox_uid_usr "When commands like useradd/groupadd allocate user IDs, start here.\n\n"
-#define HELP_toybox_uid_sys "When commands like useradd/groupadd allocate system IDs, start here."
+#define HELP_toybox_uid_sys "When commands like useradd/groupadd allocate system IDs, start here.\n\n"
-#define HELP_toybox_pedantic_args "Check arguments for commands that have no arguments."
+#define HELP_toybox_pedantic_args "Check arguments for commands that have no arguments.\n\n"
-#define HELP_toybox_debug "Enable extra checks for debugging purposes. All of them catch\nthings that can only go wrong at development time, not runtime."
+#define HELP_toybox_debug "Enable extra checks for debugging purposes. All of them catch\nthings that can only go wrong at development time, not runtime.\n\n"
-#define HELP_toybox_norecurse "When one toybox command calls another, usually it just calls the new\ncommand's main() function rather than searching the $PATH and calling\nexec on another file (which is much slower).\n\nThis disables that optimization, so toybox will run external commands\n even when it has a built-in version of that command. This requires\n toybox symlinks to be installed in the $PATH, or re-invoking the\n \"toybox\" multiplexer command by name."
+#define HELP_toybox_norecurse "When one toybox command calls another, usually it just calls the new\ncommand's main() function rather than searching the $PATH and calling\nexec on another file (which is much slower).\n\nThis disables that optimization, so toybox will run external commands\n even when it has a built-in version of that command. This requires\n toybox symlinks to be installed in the $PATH, or re-invoking the\n \"toybox\" multiplexer command by name.\n\n"
-#define HELP_toybox_free "When a program exits, the operating system will clean up after it\n(free memory, close files, etc). To save size, toybox usually relies\non this behavior. If you're running toybox under a debugger or\nwithout a real OS (ala newlib+libgloss), enable this to make toybox\nclean up after itself."
+#define HELP_toybox_free "When a program exits, the operating system will clean up after it\n(free memory, close files, etc). To save size, toybox usually relies\non this behavior. If you're running toybox under a debugger or\nwithout a real OS (ala newlib+libgloss), enable this to make toybox\nclean up after itself.\n\n"
-#define HELP_toybox_i18n "Support for UTF-8 character sets, and some locale support."
+#define HELP_toybox_i18n "Support for UTF-8 character sets, and some locale support.\n\n"
-#define HELP_toybox_help_dashdash "Support --help argument in all commands, even ones with a NULL\noptstring. (Use TOYFLAG_NOHELP to disable.) Produces the same output\nas \"help command\". --version shows toybox version."
+#define HELP_toybox_help_dashdash "Support --help argument in all commands, even ones with a NULL\noptstring. (Use TOYFLAG_NOHELP to disable.) Produces the same output\nas \"help command\". --version shows toybox version.\n\n"
-#define HELP_toybox_help "Include help text for each command."
+#define HELP_toybox_help "Include help text for each command.\n\n"
-#define HELP_toybox_float "Include floating point support infrastructure and commands that\nrequire it."
+#define HELP_toybox_float "Include floating point support infrastructure and commands that\nrequire it.\n\n"
-#define HELP_toybox_libz "Use libz for gz support."
+#define HELP_toybox_libz "Use libz for gz support.\n\n"
-#define HELP_toybox_libcrypto "Use faster hash functions out of external -lcrypto library."
+#define HELP_toybox_libcrypto "Use faster hash functions out of external -lcrypto library.\n\n"
-#define HELP_toybox_smack "Include SMACK options in commands like ls for systems like Tizen."
+#define HELP_toybox_smack "Include SMACK options in commands like ls for systems like Tizen.\n\n\n"
-#define HELP_toybox_selinux "Include SELinux options in commands such as ls, and add\nSELinux-specific commands such as chcon to the Android menu."
+#define HELP_toybox_selinux "Include SELinux options in commands such as ls, and add\nSELinux-specific commands such as chcon to the Android menu.\n\n"
-#define HELP_toybox_lsm_none "Don't try to achieve \"watertight\" by plugging the holes in a\ncollander, instead use conventional unix security (and possibly\nLinux Containers) for a simple straightforward system."
+#define HELP_toybox_lsm_none "Don't try to achieve \"watertight\" by plugging the holes in a\ncollander, instead use conventional unix security (and possibly\nLinux Containers) for a simple straightforward system.\n\n"
-#define HELP_toybox_suid "Support for the Set User ID bit, to install toybox suid root and drop\npermissions for commands which do not require root access. To use\nthis change ownership of the file to the root user and set the suid\nbit in the file permissions:\n\nchown root:root toybox; chmod +s toybox\n\nprompt \"Security Blanket\"\ndefault TOYBOX_LSM_NONE\nhelp\nSelect a Linux Security Module to complicate your system\nuntil you can't find holes in it."
+#define HELP_toybox_suid "Support for the Set User ID bit, to install toybox suid root and drop\npermissions for commands which do not require root access. To use\nthis change ownership of the file to the root user and set the suid\nbit in the file permissions:\n\nchown root:root toybox; chmod +s toybox\n\nprompt \"Security Blanket\"\ndefault TOYBOX_LSM_NONE\nhelp\nSelect a Linux Security Module to complicate your system\nuntil you can't find holes in it.\n\n"
-#define HELP_toybox "usage: toybox [--long | --help | --version | [command] [arguments...]]\n\nWith no arguments, shows available commands. First argument is\nname of a command to run, followed by any arguments to that command.\n\n--long Show path to each command\n\nTo install command symlinks with paths, try:\n for i in $(/bin/toybox --long); do ln -s /bin/toybox $i; done\nor all in one directory:\n for i in $(./toybox); do ln -s toybox $i; done; PATH=$PWD:$PATH\n\nMost toybox commands also understand the following arguments:\n\n--help Show command help (only)\n--version Show toybox version (only)\n\nThe filename \"-\" means stdin/stdout, and \"--\" stops argument parsing.\n\nNumerical arguments accept a single letter suffix for\nkilo, mega, giga, tera, peta, and exabytes, plus an additional\n\"d\" to indicate decimal 1000's instead of 1024.\n\nDurations can be decimal fractions and accept minute (\"m\"), hour (\"h\"),\nor day (\"d\") suffixes (so 0.1m = 6s)."
+#define HELP_toybox "usage: toybox [--long | --help | --version | [command] [arguments...]]\n\nWith no arguments, shows available commands. First argument is\nname of a command to run, followed by any arguments to that command.\n\n--long Show path to each command\n\nTo install command symlinks, try:\n for i in $(/bin/toybox --long); do ln -s /bin/toybox $i; done\n\nMost toybox commands also understand the following arguments:\n\n--help Show command help (only)\n--version Show toybox version (only)\n\nThe filename \"-\" means stdin/stdout, and \"--\" stops argument parsing.\n\nNumerical arguments accept a single letter suffix for\nkilo, mega, giga, tera, peta, and exabytes, plus an additional\n\"d\" to indicate decimal 1000's instead of 1024.\n\nDurations can be decimal fractions and accept minute (\"m\"), hour (\"h\"),\nor day (\"d\") suffixes (so 0.1m = 6s).\n\n"
-#define HELP_setenforce "usage: setenforce [enforcing|permissive|1|0]\n\nSets whether SELinux is enforcing (1) or permissive (0)."
+#define HELP_stop "usage: stop [SERVICE...]\n\nStop the given system service, or netd/surfaceflinger/zygotes.\n\n"
-#define HELP_sendevent "usage: sendevent DEVICE TYPE CODE VALUE\n\nSends a Linux input event."
+#define HELP_start "usage: start [SERVICE...]\n\nStarts the given system service, or netd/surfaceflinger/zygotes.\n\n"
-#define HELP_runcon "usage: runcon CONTEXT COMMAND [ARGS...]\n\nRun a command in a specified security context."
+#define HELP_setprop "usage: setprop NAME VALUE\n\nSets an Android system property.\n\n"
-#define HELP_restorecon "usage: restorecon [-D] [-F] [-R] [-n] [-v] FILE...\n\nRestores the default security contexts for the given files.\n\n-D Apply to /data/data too\n-F Force reset\n-R Recurse into directories\n-n Don't make any changes; useful with -v to see what would change\n-v Verbose"
+#define HELP_setenforce "usage: setenforce [enforcing|permissive|1|0]\n\nSets whether SELinux is enforcing (1) or permissive (0).\n\n"
-#define HELP_log "usage: log [-p PRI] [-t TAG] MESSAGE...\n\nLogs message to logcat.\n\n-p Use the given priority instead of INFO:\n d: DEBUG e: ERROR f: FATAL i: INFO v: VERBOSE w: WARN s: SILENT\n-t Use the given tag instead of \"log\""
+#define HELP_sendevent "usage: sendevent DEVICE TYPE CODE VALUE\n\nSends a Linux input event.\n\n"
-#define HELP_load_policy "usage: load_policy FILE\n\nLoad the specified SELinux policy file."
+#define HELP_runcon "usage: runcon CONTEXT COMMAND [ARGS...]\n\nRun a command in a specified security context.\n\n"
-#define HELP_getenforce "usage: getenforce\n\nShows whether SELinux is disabled, enforcing, or permissive."
+#define HELP_restorecon "usage: restorecon [-D] [-F] [-R] [-n] [-v] FILE...\n\nRestores the default security contexts for the given files.\n\n-D Apply to /data/data too\n-F Force reset\n-R Recurse into directories\n-n Don't make any changes; useful with -v to see what would change\n-v Verbose\n\n"
-#define HELP_skeleton_alias "usage: skeleton_alias [-dq] [-b NUMBER]\n\nExample of a second command with different arguments in the same source\nfile as the first. This allows shared infrastructure not added to lib/."
+#define HELP_log "usage: log [-p PRI] [-t TAG] MESSAGE...\n\nLogs message to logcat.\n\n-p Use the given priority instead of INFO:\n d: DEBUG e: ERROR f: FATAL i: INFO v: VERBOSE w: WARN s: SILENT\n-t Use the given tag instead of \"log\"\n\n"
-#define HELP_skeleton "usage: skeleton [-a] [-b STRING] [-c NUMBER] [-d LIST] [-e COUNT] [...]\n\nTemplate for new commands. You don't need this.\n\nWhen creating a new command, copy this file and delete the parts you\ndon't need. Be sure to replace all instances of \"skeleton\" (upper and lower\ncase) with your new command name.\n\nFor simple commands, \"hello.c\" is probably a better starting point."
+#define HELP_load_policy "usage: load_policy FILE\n\nLoad the specified SELinux policy file.\n\n"
-#define HELP_logwrapper "usage: logwrapper ...\n\nAppend command line to $WRAPLOG, then call second instance\nof command in $PATH."
+#define HELP_getprop "usage: getprop [NAME [DEFAULT]]\n\nGets an Android system property, or lists them all.\n\n"
-#define HELP_hostid "usage: hostid\n\nPrint the numeric identifier for the current host."
+#define HELP_getenforce "usage: getenforce\n\nShows whether SELinux is disabled, enforcing, or permissive.\n\n"
-#define HELP_hello "usage: hello\n\nA hello world program.\n\nMostly used as a simple template for adding new commands.\nOccasionally nice to smoketest kernel booting via \"init=/usr/bin/hello\"."
+#define HELP_skeleton_alias "usage: skeleton_alias [-dq] [-b NUMBER]\n\nExample of a second command with different arguments in the same source\nfile as the first. This allows shared infrastructure not added to lib/.\n\n\n"
-#define HELP_demo_utf8towc "usage: demo_utf8towc\n\nPrint differences between toybox's utf8 conversion routines vs libc du jour."
+#define HELP_skeleton "usage: skeleton [-a] [-b STRING] [-c NUMBER] [-d LIST] [-e COUNT] [...]\n\nTemplate for new commands. You don't need this.\n\nWhen creating a new command, copy this file and delete the parts you\ndon't need. Be sure to replace all instances of \"skeleton\" (upper and lower\ncase) with your new command name.\n\nFor simple commands, \"hello.c\" is probably a better starting point.\n\n"
-#define HELP_demo_scankey "usage: demo_scankey\n\nMove a letter around the screen. Hit ESC to exit."
+#define HELP_logwrapper "usage: logwrapper ...\n\nAppend command line to $WRAPLOG, then call second instance\nof command in $PATH.\n\n"
-#define HELP_demo_number "usage: demo_number [-hsbi] NUMBER...\n\n-b Use \"B\" for single byte units (HR_B)\n-d Decimal units\n-h Human readable\n-s Space between number and units (HR_SPACE)"
+#define HELP_hostid "usage: hostid\n\nPrint the numeric identifier for the current host.\n\n"
-#define HELP_demo_many_options "usage: demo_many_options -[a-zA-Z]\n\nPrint the optflags value of the command arguments, in hex."
+#define HELP_hello "usage: hello\n\nA hello world program.\n\nMostly used as a simple template for adding new commands.\nOccasionally nice to smoketest kernel booting via \"init=/usr/bin/hello\".\n\n"
-#define HELP_umount "usage: umount [-a [-t TYPE[,TYPE...]]] [-vrfD] [DIR...]\n\nUnmount the listed filesystems.\n\n-a Unmount all mounts in /proc/mounts instead of command line list\n-D Don't free loopback device(s)\n-f Force unmount\n-l Lazy unmount (detach from filesystem now, close when last user does)\n-n Don't use /proc/mounts\n-r Remount read only if unmounting fails\n-t Restrict \"all\" to mounts of TYPE (or use \"noTYPE\" to skip)\n-v Verbose"
+#define HELP_demo_utf8towc "usage: demo_utf8towc\n\nPrint differences between toybox's utf8 conversion routines vs libc du jour.\n\n"
-#define HELP_sync "usage: sync\n\nWrite pending cached data to disk (synchronize), blocking until done."
+#define HELP_demo_scankey "usage: demo_scankey\n\nMove a letter around the screen. Hit ESC to exit.\n\n"
-#define HELP_su "usage: su [-lp] [-u UID] [-g GID,...] [-s SHELL] [-c CMD] [USER [COMMAND...]]\n\nSwitch user, prompting for password of new user when not run as root.\n\nWith one argument, switch to USER and run user's shell from /etc/passwd.\nWith no arguments, USER is root. If COMMAND line provided after USER,\nexec() it as new USER (bypasing shell). If -u or -g specified, first\nargument (if any) isn't USER (it's COMMAND).\n\nfirst argument is USER name to switch to (which must exist).\nNon-root users are prompted for new user's password.\n\n-s Shell to use (default is user's shell from /etc/passwd)\n-c Command line to pass to -s shell (ala sh -c \"CMD\")\n-l Reset environment as if new login.\n-u Switch to UID instead of USER\n-g Switch to GID (only root allowed, can be comma separated list)\n-p Preserve environment (except for $PATH and $IFS)"
+#define HELP_demo_number "usage: demo_number [-hsbi] NUMBER...\n\n-b Use \"B\" for single byte units (HR_B)\n-d Decimal units\n-h Human readable\n-s Space between number and units (HR_SPACE)\n\n"
-#define HELP_seq "usage: seq [-w|-f fmt_str] [-s sep_str] [first] [increment] last\n\nCount from first to last, by increment. Omitted arguments default\nto 1. Two arguments are used as first and last. Arguments can be\nnegative or floating point.\n\n-f Use fmt_str as a printf-style floating point format string\n-s Use sep_str as separator, default is a newline character\n-w Pad to equal width with leading zeroes"
+#define HELP_demo_many_options "usage: demo_many_options -[a-zA-Z]\n\nPrint the optflags value of the command arguments, in hex.\n\n"
-#define HELP_pidof "usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...\n\nPrint the PIDs of all processes with the given names.\n\n-s Single shot, only return one pid\n-o Omit PID(s)\n-x Match shell scripts too"
+#define HELP_umount "usage: umount [-a [-t TYPE[,TYPE...]]] [-vrfD] [DIR...]\n\nUnmount the listed filesystems.\n\n-a Unmount all mounts in /proc/mounts instead of command line list\n-D Don't free loopback device(s)\n-f Force unmount\n-l Lazy unmount (detach from filesystem now, close when last user does)\n-n Don't use /proc/mounts\n-r Remount read only if unmounting fails\n-t Restrict \"all\" to mounts of TYPE (or use \"noTYPE\" to skip)\n-v Verbose\n\n\n"
-#define HELP_passwd_sad "Password changes are checked to make sure they're at least 6 chars long,\ndon't include the entire username (but not a subset of it), or the entire\nprevious password (but changing password1, password2, password3 is fine).\nThis heuristic accepts \"aaaaaa\" and \"123456\"."
+#define HELP_sync "usage: sync\n\nWrite pending cached data to disk (synchronize), blocking until done.\n\n"
-#define HELP_passwd "usage: passwd [-a ALGO] [-dlu] [USER]\n\nUpdate user's authentication tokens. Defaults to current user.\n\n-a ALGO Encryption method (des, md5, sha256, sha512) default: des\n-d Set password to ''\n-l Lock (disable) account\n-u Unlock (enable) account"
+#define HELP_su "usage: su [-lp] [-u UID] [-g GID,...] [-s SHELL] [-c CMD] [USER [COMMAND...]]\n\nSwitch user, prompting for password of new user when not run as root.\n\nWith one argument, switch to USER and run user's shell from /etc/passwd.\nWith no arguments, USER is root. If COMMAND line provided after USER,\nexec() it as new USER (bypasing shell). If -u or -g specified, first\nargument (if any) isn't USER (it's COMMAND).\n\nfirst argument is USER name to switch to (which must exist).\nNon-root users are prompted for new user's password.\n\n-s Shell to use (default is user's shell from /etc/passwd)\n-c Command line to pass to -s shell (ala sh -c \"CMD\")\n-l Reset environment as if new login.\n-u Switch to UID instead of USER\n-g Switch to GID (only root allowed, can be comma separated list)\n-p Preserve environment (except for $PATH and $IFS)\n\n"
-#define HELP_mount "usage: mount [-afFrsvw] [-t TYPE] [-o OPTION,] [[DEVICE] DIR]\n\nMount new filesystem(s) on directories. With no arguments, display existing\nmounts.\n\n-a Mount all entries in /etc/fstab (with -t, only entries of that TYPE)\n-O Only mount -a entries that have this option\n-f Fake it (don't actually mount)\n-r Read only (same as -o ro)\n-w Read/write (default, same as -o rw)\n-t Specify filesystem type\n-v Verbose\n\nOPTIONS is a comma separated list of options, which can also be supplied\nas --longopts.\n\nAutodetects loopback mounts (a file on a directory) and bind mounts (file\non file, directory on directory), so you don't need to say --bind or --loop.\nYou can also \"mount -a /path\" to mount everything in /etc/fstab under /path,\neven if it's noauto. DEVICE starting with UUID= is identified by blkid -U."
+#define HELP_seq "usage: seq [-w|-f fmt_str] [-s sep_str] [first] [increment] last\n\nCount from first to last, by increment. Omitted arguments default\nto 1. Two arguments are used as first and last. Arguments can be\nnegative or floating point.\n\n-f Use fmt_str as a printf-style floating point format string\n-s Use sep_str as separator, default is a newline character\n-w Pad to equal width with leading zeroes\n\n"
-#define HELP_mktemp "usage: mktemp [-dqu] [-p DIR] [TEMPLATE]\n\nSafely create a new file \"DIR/TEMPLATE\" and print its name.\n\n-d Create directory instead of file (--directory)\n-p Put new file in DIR (--tmpdir)\n-q Quiet, no error messages\n-t Prefer $TMPDIR > DIR > /tmp (default DIR > $TMPDIR > /tmp)\n-u Don't create anything, just print what would be created\n\nEach X in TEMPLATE is replaced with a random printable character. The\ndefault TEMPLATE is tmp.XXXXXXXXXX."
+#define HELP_pidof "usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...\n\nPrint the PIDs of all processes with the given names.\n\n-s Single shot, only return one pid\n-o Omit PID(s)\n\n"
-#define HELP_mknod_z "usage: mknod [-Z CONTEXT] ...\n\n-Z Set security context to created file"
+#define HELP_passwd_sad "Password changes are checked to make sure they're at least 6 chars long,\ndon't include the entire username (but not a subset of it), or the entire\nprevious password (but changing password1, password2, password3 is fine).\nThis heuristic accepts \"aaaaaa\" and \"123456\".\n\n"
-#define HELP_mknod "usage: mknod [-m MODE] NAME TYPE [MAJOR MINOR]\n\nCreate a special file NAME with a given type. TYPE is b for block device,\nc or u for character device, p for named pipe (which ignores MAJOR/MINOR).\n\n-m Mode (file permissions) of new device, in octal or u+x format"
+#define HELP_passwd "usage: passwd [-a ALGO] [-dlu] [USER]\n\nUpdate user's authentication tokens. Defaults to current user.\n\n-a ALGO Encryption method (des, md5, sha256, sha512) default: des\n-d Set password to ''\n-l Lock (disable) account\n-u Unlock (enable) account\n\n"
-#define HELP_sha512sum "See sha1sum"
+#define HELP_mount "usage: mount [-afFrsvw] [-t TYPE] [-o OPTION,] [[DEVICE] DIR]\n\nMount new filesystem(s) on directories. With no arguments, display existing\nmounts.\n\n-a Mount all entries in /etc/fstab (with -t, only entries of that TYPE)\n-O Only mount -a entries that have this option\n-f Fake it (don't actually mount)\n-r Read only (same as -o ro)\n-w Read/write (default, same as -o rw)\n-t Specify filesystem type\n-v Verbose\n\nOPTIONS is a comma separated list of options, which can also be supplied\nas --longopts.\n\nAutodetects loopback mounts (a file on a directory) and bind mounts (file\non file, directory on directory), so you don't need to say --bind or --loop.\nYou can also \"mount -a /path\" to mount everything in /etc/fstab under /path,\neven if it's noauto. DEVICE starting with UUID= is identified by blkid -U.\n\n\n"
-#define HELP_sha384sum "See sha1sum"
+#define HELP_mktemp "usage: mktemp [-dqu] [-p DIR] [TEMPLATE]\n\nSafely create a new file \"DIR/TEMPLATE\" and print its name.\n\n-d Create directory instead of file (--directory)\n-p Put new file in DIR (--tmpdir)\n-q Quiet, no error messages\n-t Prefer $TMPDIR > DIR > /tmp (default DIR > $TMPDIR > /tmp)\n-u Don't create anything, just print what would be created\n\nEach X in TEMPLATE is replaced with a random printable character. The\ndefault TEMPLATE is tmp.XXXXXXXXXX.\n\n"
-#define HELP_sha256sum "See sha1sum"
+#define HELP_mknod_z "usage: mknod [-Z CONTEXT] ...\n\n-Z Set security context to created file\n\n"
-#define HELP_sha224sum "See sha1sum"
+#define HELP_mknod "usage: mknod [-m MODE] NAME TYPE [MAJOR MINOR]\n\nCreate a special file NAME with a given type. TYPE is b for block device,\nc or u for character device, p for named pipe (which ignores MAJOR/MINOR).\n\n-m Mode (file permissions) of new device, in octal or u+x format\n\n"
-#define HELP_sha1sum "usage: sha?sum [-bcs] [FILE]...\n\nCalculate sha hash for each input file, reading from stdin if none. Output\none hash (40 hex digits for sha1, 56 for sha224, 64 for sha256, 96 for sha384,\nand 128 for sha512) for each input file, followed by filename.\n\n-b Brief (hash only, no filename)\n-c Check each line of each FILE is the same hash+filename we'd output\n-s No output, exit status 0 if all hashes match, 1 otherwise"
+#define HELP_sha512sum "See sha1sum\n\n"
-#define HELP_md5sum "usage: md5sum [-bcs] [FILE]...\n\nCalculate md5 hash for each input file, reading from stdin if none.\nOutput one hash (32 hex digits) for each input file, followed by filename.\n\n-b Brief (hash only, no filename)\n-c Check each line of each FILE is the same hash+filename we'd output\n-s No output, exit status 0 if all hashes match, 1 otherwise"
+#define HELP_sha384sum "See sha1sum\n\n"
-#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_sha256sum "See sha1sum\n\n"
-#define HELP_dnsdomainname "usage: dnsdomainname\n\nShow domain this system belongs to (same as hostname -d)."
+#define HELP_sha224sum "See sha1sum\n\n"
-#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_sha1sum "usage: sha?sum [-bcs] [FILE]...\n\nCalculate sha hash for each input file, reading from stdin if none. Output\none hash (40 hex digits for sha1, 56 for sha224, 64 for sha256, 96 for sha384,\nand 128 for sha512) for each input file, followed by filename.\n\n-b Brief (hash only, no filename)\n-c Check each line of each FILE is the same hash+filename we'd output\n-s No output, exit status 0 if all hashes match, 1 otherwise\n\n"
-#define HELP_zcat "usage: zcat [FILE...]\n\nDecompress files to stdout. Like `gzip -dc`.\n\n-f Force: allow read from tty"
+#define HELP_md5sum "usage: md5sum [-bcs] [FILE]...\n\nCalculate md5 hash for each input file, reading from stdin if none.\nOutput one hash (32 hex digits) for each input file, followed by filename.\n\n-b Brief (hash only, no filename)\n-c Check each line of each FILE is the same hash+filename we'd output\n-s No output, exit status 0 if all hashes match, 1 otherwise\n\n"
-#define HELP_gunzip "usage: gunzip [-cfk] [FILE...]\n\nDecompress files. With no files, decompresses stdin to stdout.\nOn success, the input files are removed and replaced by new\nfiles without the .gz suffix.\n\n-c Output to stdout (act as zcat)\n-f Force: allow read from tty\n-k Keep input files (default is to remove)"
+#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\n"
-#define HELP_gzip "usage: gzip [-19cdfk] [FILE...]\n\nCompress files. With no files, compresses stdin to stdout.\nOn success, the input files are removed and replaced by new\nfiles with the .gz suffix.\n\n-c Output to stdout\n-d Decompress (act as gunzip)\n-f Force: allow overwrite of output file\n-k Keep input files (default is to remove)\n-# Compression level 1-9 (1:fastest, 6:default, 9:best)"
+#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)\n\n"
-#define HELP_dmesg "usage: dmesg [-Cc] [-r|-t|-T] [-n LEVEL] [-s SIZE] [-w]\n\nPrint or control the kernel ring buffer.\n\n-C Clear ring buffer without printing\n-c Clear ring buffer after printing\n-n Set kernel logging LEVEL (1-9)\n-r Raw output (with <level markers>)\n-S Use syslog(2) rather than /dev/kmsg\n-s Show the last SIZE many bytes\n-T Human readable timestamps\n-t Don't print timestamps\n-w Keep waiting for more output (aka --follow)"
+#define HELP_dmesg "usage: dmesg [-Cc] [-r|-t|-T] [-n LEVEL] [-s SIZE] [-w]\n\nPrint or control the kernel ring buffer.\n\n-C Clear ring buffer without printing\n-c Clear ring buffer after printing\n-n Set kernel logging LEVEL (1-9)\n-r Raw output (with <level markers>)\n-S Use syslog(2) rather than /dev/kmsg\n-s Show the last SIZE many bytes\n-T Human readable timestamps\n-t Don't print timestamps\n-w Keep waiting for more output (aka --follow)\n\n"
-#define HELP_tunctl "usage: tunctl [-dtT] [-u USER] NAME\n\nCreate and delete tun/tap virtual ethernet devices.\n\n-T Use tap (ethernet frames) instead of tun (ip packets)\n-d Delete tun/tap device\n-t Create tun/tap device\n-u Set owner (user who can read/write device without root access)"
+#define HELP_tunctl "usage: tunctl [-dtT] [-u USER] NAME\n\nCreate and delete tun/tap virtual ethernet devices.\n\n-T Use tap (ethernet frames) instead of tun (ip packets)\n-d Delete tun/tap device\n-t Create tun/tap device\n-u Set owner (user who can read/write device without root access)\n\n\n"
-#define HELP_sntp "usage: sntp [-saSdDq] [-r SHIFT] [-mM[ADDRESS]] [-p PORT] [SERVER]\n\nSimple Network Time Protocol client. Query SERVER and display time.\n\n-p Use PORT (default 123)\n-s Set system clock suddenly\n-a Adjust system clock gradually\n-S Serve time instead of querying (bind to SERVER address if specified)\n-m Wait for updates from multicast ADDRESS (RFC 4330 default 224.0.1.1)\n-M Multicast server on ADDRESS (deault 224.0.0.1)\n-t TTL (multicast only, default 1)\n-d Daemonize (run in background re-querying )\n-D Daemonize but stay in foreground: re-query time every 1000 seconds\n-r Retry shift (every 1<<SHIFT seconds)\n-q Quiet (don't display time)"
+#define HELP_sntp "usage: sntp [-saSdDqm] [-r SHIFT] [-m ADDRESS] [-p PORT] [SERVER]\n\nSimple Network Time Protocol client. Query SERVER and display time.\n\n-p Use PORT (default 123)\n-s Set system clock suddenly\n-a Adjust system clock gradually\n-S Serve time instead of querying (bind to SERVER address if specified)\n-m Wait for updates from multicast ADDRESS (RFC 4330 says use 224.0.1.1)\n-M Multicast server on ADDRESS\n-d Daemonize (run in background re-querying )\n-D Daemonize but stay in foreground: re-query time every 1000 seconds\n-r Retry shift (every 1<<SHIFT seconds)\n-q Quiet (don't display time)\n\n"
-#define HELP_rfkill "usage: rfkill COMMAND [DEVICE]\n\nEnable/disable wireless devices.\n\nCommands:\nlist [DEVICE] List current state\nblock DEVICE Disable device\nunblock DEVICE Enable device\n\nDEVICE is an index number, or one of:\nall, wlan(wifi), bluetooth, uwb(ultrawideband), wimax, wwan, gps, fm."
+#define HELP_rfkill "usage: rfkill COMMAND [DEVICE]\n\nEnable/disable wireless devices.\n\nCommands:\nlist [DEVICE] List current state\nblock DEVICE Disable device\nunblock DEVICE Enable device\n\nDEVICE is an index number, or one of:\nall, wlan(wifi), bluetooth, uwb(ultrawideband), wimax, wwan, gps, fm.\n\n"
-#define HELP_ping "usage: ping [OPTIONS] HOST\n\nCheck network connectivity by sending packets to a host and reporting\nits response.\n\nSend ICMP ECHO_REQUEST packets to ipv4 or ipv6 addresses and prints each\necho it receives back, with round trip time. Returns true if host alive.\n\nOptions:\n-4, -6 Force IPv4 or IPv6\n-c CNT Send CNT many packets (default 3, 0 = infinite)\n-f Flood (print . and \\b to show drops, default -c 15 -i 0.2)\n-i TIME Interval between packets (default 1, need root for < .2)\n-I IFACE/IP Source interface or address\n-m MARK Tag outgoing packets using SO_MARK\n-q Quiet (stops after one returns true if host is alive)\n-s SIZE Data SIZE in bytes (default 56)\n-t TTL Set Time To Live (number of hops)\n-W SEC Seconds to wait for response after last -c packet (default 3)\n-w SEC Exit after this many seconds"
+#define HELP_ping "usage: ping [OPTIONS] HOST\n\nCheck network connectivity by sending packets to a host and reporting\nits response.\n\nSend ICMP ECHO_REQUEST packets to ipv4 or ipv6 addresses and prints each\necho it receives back, with round trip time. Returns true if host alive.\n\nOptions:\n-4, -6 Force IPv4 or IPv6\n-c CNT Send CNT many packets (default 3, 0 = infinite)\n-f Flood (print . and \\b to show drops, default -c 15 -i 0.2)\n-i TIME Interval between packets (default 1, need root for < .2)\n-I IFACE/IP Source interface or address\n-m MARK Tag outgoing packets using SO_MARK\n-q Quiet (stops after one returns true if host is alive)\n-s SIZE Data SIZE in bytes (default 56)\n-t TTL Set Time To Live (number of hops)\n-W SEC Seconds to wait for response after last -c packet (default 3)\n-w SEC Exit after this many seconds\n\n"
-#define HELP_netstat "usage: netstat [-pWrxwutneal]\n\nDisplay networking information. Default is netstat -tuwx\n\n-r Routing table\n-a All sockets (not just connected)\n-l Listening server sockets\n-t TCP sockets\n-u UDP sockets\n-w Raw sockets\n-x Unix sockets\n-e Extended info\n-n Don't resolve names\n-W Wide display\n-p Show PID/program name of sockets"
+#define HELP_netstat "usage: netstat [-pWrxwutneal]\n\nDisplay networking information. Default is netstat -tuwx\n\n-r Routing table\n-a All sockets (not just connected)\n-l Listening server sockets\n-t TCP sockets\n-u UDP sockets\n-w Raw sockets\n-x Unix sockets\n-e Extended info\n-n Don't resolve names\n-W Wide display\n-p Show PID/program name of sockets\n\n"
-#define HELP_netcat "usage: netcat [-46Ut] [-lL COMMAND...] [-u] [-wpq #] [-s addr] {IPADDR PORTNUM|-f FILENAME}\n\nForward stdin/stdout to a file or network connection.\n\n-4 Force IPv4\n-6 Force IPv6\n-L Listen for multiple incoming connections (server mode)\n-U Use a UNIX domain socket\n-W SECONDS timeout for more data on an idle connection\n-f Use FILENAME (ala /dev/ttyS0) instead of network\n-l Listen for one incoming connection\n-p Local port number\n-q Quit SECONDS after EOF on stdin, even if stdout hasn't closed yet\n-s Local source address\n-t Allocate tty (must come before -l or -L)\n-u Use UDP\n-w SECONDS timeout to establish connection\n\nUse \"stty 115200 -F /dev/ttyS0 && stty raw -echo -ctlecho\" with\nnetcat -f to connect to a serial port.\n\nThe command line after -l or -L is executed (as a child process) to handle\neach incoming connection. If blank -l waits for a connection and forwards\nit to stdin/stdout. If no -p specified, -l prints port it bound to and\nbackgrounds itself (returning immediately).\n\nFor a quick-and-dirty server, try something like:\nnetcat -s 127.0.0.1 -p 1234 -tL /bin/bash -l"
+#define HELP_netcat "usage: netcat [-46t] [-lL COMMAND...] [-u] [-wpq #] [-s addr] {IPADDR PORTNUM|-f FILENAME}\n\nForward stdin/stdout to a file or network connection.\n\n-4 Force IPv4\n-6 Force IPv6\n-L Listen for multiple incoming connections (server mode)\n-W SECONDS timeout for more data on an idle connection\n-f Use FILENAME (ala /dev/ttyS0) instead of network\n-l Listen for one incoming connection\n-p Local port number\n-q Quit SECONDS after EOF on stdin, even if stdout hasn't closed yet\n-s Local source address\n-t Allocate tty (must come before -l or -L)\n-u Use UDP\n-w SECONDS timeout to establish connection\n\nUse \"stty 115200 -F /dev/ttyS0 && stty raw -echo -ctlecho\" with\nnetcat -f to connect to a serial port.\n\nThe command line after -l or -L is executed (as a child process) to handle\neach incoming connection. If blank -l waits for a connection and forwards\nit to stdin/stdout. If no -p specified, -l prints port it bound to and\nbackgrounds itself (returning immediately).\n\nFor a quick-and-dirty server, try something like:\nnetcat -s 127.0.0.1 -p 1234 -tL /bin/bash -l\n"
-#define HELP_microcom "usage: microcom [-s SPEED] [-X] DEVICE\n\nSimple serial console.\n\n-s Set baud rate to SPEED\n-X Ignore ^@ (send break) and ^] (exit)"
+#define HELP_microcom "usage: microcom [-s SPEED] [-X] DEVICE\n\nSimple serial console.\n\n-s Set baud rate to SPEED\n-X Ignore ^@ (send break) and ^] (exit)\n\n"
-#define HELP_ifconfig "usage: ifconfig [-aS] [INTERFACE [ACTION...]]\n\nDisplay or configure network interface.\n\nWith no arguments, display active interfaces. First argument is interface\nto operate on, one argument by itself displays that interface.\n\n-a All interfaces displayed, not just active ones\n-S Short view, one line per interface\n\nStandard ACTIONs to perform on an INTERFACE:\n\nADDR[/MASK] - set IPv4 address (1.2.3.4/5) and activate interface\nadd|del ADDR[/LEN] - add/remove IPv6 address (1111::8888/128)\nup|down - activate or deactivate interface\n\nAdvanced ACTIONs (default values usually suffice):\n\ndefault - remove IPv4 address\nnetmask ADDR - set IPv4 netmask via 255.255.255.0 instead of /24\ntxqueuelen LEN - number of buffered packets before output blocks\nmtu LEN - size of outgoing packets (Maximum Transmission Unit)\nbroadcast ADDR - Set broadcast address\npointopoint ADDR - PPP and PPPOE use this instead of \"route add default gw\"\nhw TYPE ADDR - set hardware (mac) address (type = ether|infiniband)\n\nFlags you can set on an interface (or -remove by prefixing with -):\n\narp - don't use Address Resolution Protocol to map LAN routes\npromisc - don't discard packets that aren't to this LAN hardware address\nmulticast - force interface into multicast mode if the driver doesn't\nallmulti - promisc for multicast packets"
+#define HELP_ifconfig "usage: ifconfig [-aS] [INTERFACE [ACTION...]]\n\nDisplay or configure network interface.\n\nWith no arguments, display active interfaces. First argument is interface\nto operate on, one argument by itself displays that interface.\n\n-a All interfaces displayed, not just active ones\n-S Short view, one line per interface\n\nStandard ACTIONs to perform on an INTERFACE:\n\nADDR[/MASK] - set IPv4 address (1.2.3.4/5) and activate interface\nadd|del ADDR[/LEN] - add/remove IPv6 address (1111::8888/128)\nup|down - activate or deactivate interface\n\nAdvanced ACTIONs (default values usually suffice):\n\ndefault - remove IPv4 address\nnetmask ADDR - set IPv4 netmask via 255.255.255.0 instead of /24\ntxqueuelen LEN - number of buffered packets before output blocks\nmtu LEN - size of outgoing packets (Maximum Transmission Unit)\nbroadcast ADDR - Set broadcast address\npointopoint ADDR - PPP and PPPOE use this instead of \"route add default gw\"\nhw TYPE ADDR - set hardware (mac) address (type = ether|infiniband)\n\nFlags you can set on an interface (or -remove by prefixing with -):\n\narp - don't use Address Resolution Protocol to map LAN routes\npromisc - don't discard packets that aren't to this LAN hardware address\nmulticast - force interface into multicast mode if the driver doesn't\nallmulti - promisc for multicast packets\n\n"
-#define HELP_ftpput "An ftpget that defaults to -s instead of -g"
+#define HELP_ftpput "An ftpget that defaults to -s instead of -g\n\n"
-#define HELP_ftpget "usage: ftpget [-cvgslLmMdD] [-P PORT] [-p PASSWORD] [-u USER] HOST [LOCAL] REMOTE\n\nTalk to ftp server. By default get REMOTE file via passive anonymous\ntransfer, optionally saving under a LOCAL name. Can also send, list, etc.\n\n-c Continue partial transfer\n-p Use PORT instead of \"21\"\n-P Use PASSWORD instead of \"ftpget@\"\n-u Use USER instead of \"anonymous\"\n-v Verbose\n\nWays to interact with FTP server:\n-d Delete file\n-D Remove directory\n-g Get file (default)\n-l List directory\n-L List (filenames only)\n-m Move file on server from LOCAL to REMOTE\n-M mkdir\n-s Send file"
+#define HELP_ftpget "usage: ftpget [-cvgslLmMdD] [-P PORT] [-p PASSWORD] [-u USER] HOST [LOCAL] REMOTE\n\nTalk to ftp server. By default get REMOTE file via passive anonymous\ntransfer, optionally saving under a LOCAL name. Can also send, list, etc.\n\n-c Continue partial transfer\n-p Use PORT instead of \"21\"\n-P Use PASSWORD instead of \"ftpget@\"\n-u Use USER instead of \"anonymous\"\n-v Verbose\n\nWays to interact with FTP server:\n-d Delete file\n-D Remove directory\n-g Get file (default)\n-l List directory\n-L List (filenames only)\n-m Move file on server from LOCAL to REMOTE\n-M mkdir\n-s Send file\n\n"
-#define HELP_yes "usage: yes [args...]\n\nRepeatedly output line until killed. If no args, output 'y'."
+#define HELP_yes "usage: yes [args...]\n\nRepeatedly output line until killed. If no args, output 'y'.\n\n\n"
-#define HELP_xxd "usage: xxd [-c n] [-g n] [-i] [-l n] [-o n] [-p] [-r] [-s n] [file]\n\nHexdump a file to stdout. If no file is listed, copy from stdin.\nFilename \"-\" is a synonym for stdin.\n\n-c n Show n bytes per line (default 16)\n-g n Group bytes by adding a ' ' every n bytes (default 2)\n-i Include file output format (comma-separated hex byte literals)\n-l n Limit of n bytes before stopping (default is no limit)\n-o n Add n to display offset\n-p Plain hexdump (30 bytes/line, no grouping)\n-r Reverse operation: turn a hexdump into a binary file\n-s n Skip to offset n"
+#define HELP_xxd "usage: xxd [-c n] [-g n] [-i] [-l n] [-o n] [-p] [-r] [-s n] [file]\n\nHexdump a file to stdout. If no file is listed, copy from stdin.\nFilename \"-\" is a synonym for stdin.\n\n-c n Show n bytes per line (default 16)\n-g n Group bytes by adding a ' ' every n bytes (default 2)\n-i Include file output format (comma-separated hex byte literals)\n-l n Limit of n bytes before stopping (default is no limit)\n-o n Add n to display offset\n-p Plain hexdump (30 bytes/line, no grouping)\n-r Reverse operation: turn a hexdump into a binary file\n-s n Skip to offset n\n\n"
-#define HELP_which "usage: which [-a] filename ...\n\nSearch $PATH for executable files matching filename(s).\n\n-a Show all matches"
+#define HELP_which "usage: which [-a] filename ...\n\nSearch $PATH for executable files matching filename(s).\n\n-a Show all matches\n\n"
-#define HELP_watch "usage: watch [-teb] [-n SEC] PROG ARGS\n\nRun PROG every -n seconds, showing output. Hit q to quit.\n\n-n Loop period in seconds (default 2)\n-t Don't print header\n-e Exit on error\n-b Beep on command error\n-x Exec command directly (vs \"sh -c\")"
+#define HELP_watch "usage: watch [-teb] [-n SEC] PROG ARGS\n\nRun PROG every -n seconds, showing output. Hit q to quit.\n\n-n Loop period in seconds (default 2)\n-t Don't print header\n-e Exit on error\n-b Beep on command error\n-x Exec command directly (vs \"sh -c\")\n\n"
-#define HELP_w "usage: w\n\nShow who is logged on and since how long they logged in."
+#define HELP_w "usage: w\n\nShow who is logged on and since how long they logged in.\n\n"
-#define HELP_vmstat "usage: vmstat [-n] [DELAY [COUNT]]\n\nPrint virtual memory statistics, repeating each DELAY seconds, COUNT times.\n(With no DELAY, prints one line. With no COUNT, repeats until killed.)\n\nShow processes running and blocked, kilobytes swapped, free, buffered, and\ncached, kilobytes swapped in and out per second, file disk blocks input and\noutput per second, interrupts and context switches per second, percent\nof CPU time spent running user code, system code, idle, and awaiting I/O.\nFirst line is since system started, later lines are since last line.\n\n-n Display the header only once"
+#define HELP_vmstat "usage: vmstat [-n] [DELAY [COUNT]]\n\nPrint virtual memory statistics, repeating each DELAY seconds, COUNT times.\n(With no DELAY, prints one line. With no COUNT, repeats until killed.)\n\nShow processes running and blocked, kilobytes swapped, free, buffered, and\ncached, kilobytes swapped in and out per second, file disk blocks input and\noutput per second, interrupts and context switches per second, percent\nof CPU time spent running user code, system code, idle, and awaiting I/O.\nFirst line is since system started, later lines are since last line.\n\n-n Display the header only once\n\n"
-#define HELP_vconfig "usage: vconfig COMMAND [OPTIONS]\n\nCreate and remove virtual ethernet devices\n\nadd [interface-name] [vlan_id]\nrem [vlan-name]\nset_flag [interface-name] [flag-num] [0 | 1]\nset_egress_map [vlan-name] [skb_priority] [vlan_qos]\nset_ingress_map [vlan-name] [skb_priority] [vlan_qos]\nset_name_type [name-type]"
+#define HELP_vconfig "usage: vconfig COMMAND [OPTIONS]\n\nCreate and remove virtual ethernet devices\n\nadd [interface-name] [vlan_id]\nrem [vlan-name]\nset_flag [interface-name] [flag-num] [0 | 1]\nset_egress_map [vlan-name] [skb_priority] [vlan_qos]\nset_ingress_map [vlan-name] [skb_priority] [vlan_qos]\nset_name_type [name-type]\n\n"
-#define HELP_uuidgen "usage: uuidgen\n\nCreate and print a new RFC4122 random UUID."
+#define HELP_uuidgen "usage: uuidgen\n\nCreate and print a new RFC4122 random UUID.\n\n"
-#define HELP_usleep "usage: usleep MICROSECONDS\n\nPause for MICROSECONDS microseconds."
+#define HELP_usleep "usage: usleep MICROSECONDS\n\nPause for MICROSECONDS microseconds.\n\n"
-#define HELP_uptime "usage: uptime [-ps]\n\nTell the current time, how long the system has been running, the number\nof users, and the system load averages for the past 1, 5 and 15 minutes.\n\n-p Pretty (human readable) uptime\n-s Since when has the system been up?"
+#define HELP_uptime "usage: uptime [-ps]\n\nTell the current time, how long the system has been running, the number\nof users, and the system load averages for the past 1, 5 and 15 minutes.\n\n-p Pretty (human readable) uptime\n-s Since when has the system been up?\n\n"
-#define HELP_truncate "usage: truncate [-c] -s SIZE file...\n\nSet length of file(s), extending sparsely if necessary.\n\n-c Don't create file if it doesn't exist\n-s New size (with optional prefix and suffix)\n\nSIZE prefix: + add, - subtract, < shrink to, > expand to,\n / multiple rounding down, % multiple rounding up\nSIZE suffix: k=1024, m=1024^2, g=1024^3, t=1024^4, p=1024^5, e=1024^6"
+#define HELP_truncate "usage: truncate [-c] -s SIZE file...\n\nSet length of file(s), extending sparsely if necessary.\n\n-c Don't create file if it doesn't exist\n-s New size (with optional prefix and suffix)\n\nSIZE prefix: + add, - subtract, < shrink to, > expand to,\n / multiple rounding down, % multiple rounding up\nSIZE suffix: k=1024, m=1024^2, g=1024^3, t=1024^4, p=1024^5, e=1024^6\n\n"
-#define HELP_timeout "usage: timeout [-k DURATION] [-s SIGNAL] DURATION COMMAND...\n\nRun command line as a child process, sending child a signal if the\ncommand doesn't exit soon enough.\n\nDURATION can be a decimal fraction. An optional suffix can be \"m\"\n(minutes), \"h\" (hours), \"d\" (days), or \"s\" (seconds, the default).\n\n-s Send specified signal (default TERM)\n-k Send KILL signal if child still running this long after first signal\n-v Verbose\n--foreground Don't create new process group\n--preserve-status Exit with the child's exit status"
+#define HELP_timeout "usage: timeout [-k DURATION] [-s SIGNAL] DURATION COMMAND...\n\nRun command line as a child process, sending child a signal if the\ncommand doesn't exit soon enough.\n\nDURATION can be a decimal fraction. An optional suffix can be \"m\"\n(minutes), \"h\" (hours), \"d\" (days), or \"s\" (seconds, the default).\n\n-s Send specified signal (default TERM)\n-k Send KILL signal if child still running this long after first signal\n-v Verbose\n--foreground Don't create new process group\n--preserve-status Exit with the child's exit status\n\n"
-#define HELP_taskset "usage: taskset [-ap] [mask] [PID | cmd [args...]]\n\nLaunch a new task which may only run on certain processors, or change\nthe processor affinity of an existing PID.\n\nMask is a hex string where each bit represents a processor the process\nis allowed to run on. PID without a mask displays existing affinity.\n\n-p Set/get the affinity of given PID instead of a new command\n-a Set/get the affinity of all threads of the PID"
+#define HELP_taskset "usage: taskset [-ap] [mask] [PID | cmd [args...]]\n\nLaunch a new task which may only run on certain processors, or change\nthe processor affinity of an existing PID.\n\nMask is a hex string where each bit represents a processor the process\nis allowed to run on. PID without a mask displays existing affinity.\n\n-p Set/get the affinity of given PID instead of a new command\n-a Set/get the affinity of all threads of the PID\n\n"
-#define HELP_nproc "usage: nproc [--all]\n\nPrint number of processors.\n\n--all Show all processors, not just ones this task can run on"
+#define HELP_nproc "usage: nproc [--all]\n\nPrint number of processors.\n\n--all Show all processors, not just ones this task can run on\n\n"
-#define HELP_tac "usage: tac [FILE...]\n\nOutput lines in reverse order."
+#define HELP_tac "usage: tac [FILE...]\n\nOutput lines in reverse order.\n\n"
-#define HELP_sysctl "usage: sysctl [-aAeNnqw] [-p [FILE] | KEY[=VALUE]...]\n\nRead/write system control data (under /proc/sys).\n\n-a,A Show all values\n-e Don't warn about unknown keys\n-N Don't print key values\n-n Don't print key names\n-p Read values from FILE (default /etc/sysctl.conf)\n-q Don't show value after write\n-w Only write values (object to reading)"
+#define HELP_sysctl "usage: sysctl [-aAeNnqw] [-p [FILE] | KEY[=VALUE]...]\n\nRead/write system control data (under /proc/sys).\n\n-a,A Show all values\n-e Don't warn about unknown keys\n-N Don't print key values\n-n Don't print key names\n-p Read values from FILE (default /etc/sysctl.conf)\n-q Don't show value after write\n-w Only write values (object to reading)\n\n"
-#define HELP_switch_root "usage: switch_root [-c /dev/console] NEW_ROOT NEW_INIT...\n\nUse from PID 1 under initramfs to free initramfs, chroot to NEW_ROOT,\nand exec NEW_INIT.\n\n-c Redirect console to device in NEW_ROOT\n-h Hang instead of exiting on failure (avoids kernel panic)"
+#define HELP_switch_root "usage: switch_root [-c /dev/console] NEW_ROOT NEW_INIT...\n\nUse from PID 1 under initramfs to free initramfs, chroot to NEW_ROOT,\nand exec NEW_INIT.\n\n-c Redirect console to device in NEW_ROOT\n-h Hang instead of exiting on failure (avoids kernel panic)\n\n"
-#define HELP_swapon "usage: swapon [-d] [-p priority] filename\n\nEnable swapping on a given device/file.\n\n-d Discard freed SSD pages\n-p Priority (highest priority areas allocated first)"
+#define HELP_swapon "usage: swapon [-d] [-p priority] filename\n\nEnable swapping on a given device/file.\n\n-d Discard freed SSD pages\n-p Priority (highest priority areas allocated first)\n\n"
-#define HELP_swapoff "usage: swapoff swapregion\n\nDisable swapping on a given swapregion."
+#define HELP_swapoff "usage: swapoff swapregion\n\nDisable swapping on a given swapregion.\n\n"
-#define HELP_stat "usage: stat [-tfL] [-c FORMAT] FILE...\n\nDisplay status of files or filesystems.\n\n-c Output specified FORMAT string instead of default\n-f Display filesystem status instead of file status\n-L Follow symlinks\n-t terse (-c \"%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o\")\n (with -f = -c \"%n %i %l %t %s %S %b %f %a %c %d\")\n\nThe valid format escape sequences for files:\n%a Access bits (octal) |%A Access bits (flags)|%b Size/512\n%B Bytes per %b (512) |%C Security context |%d Device ID (dec)\n%D Device ID (hex) |%f All mode bits (hex)|%F File type\n%g Group ID |%G Group name |%h Hard links\n%i Inode |%m Mount point |%n Filename\n%N Long filename |%o I/O block size |%s Size (bytes)\n%t Devtype major (hex) |%T Devtype minor (hex)|%u User ID\n%U User name |%x Access time |%X Access unix time\n%y Modification time |%Y Mod unix time |%z Creation time\n%Z Creation unix time\n\nThe valid format escape sequences for filesystems:\n%a Available blocks |%b Total blocks |%c Total inodes\n%d Free inodes |%f Free blocks |%i File system ID\n%l Max filename length |%n File name |%s Fragment size\n%S Best transfer size |%t FS type (hex) |%T FS type (driver name)"
+#define HELP_stat "usage: stat [-tfL] [-c FORMAT] FILE...\n\nDisplay status of files or filesystems.\n\n-c Output specified FORMAT string instead of default\n-f Display filesystem status instead of file status\n-L Follow symlinks\n-t terse (-c \"%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o\")\n (with -f = -c \"%n %i %l %t %s %S %b %f %a %c %d\")\n\nThe valid format escape sequences for files:\n%a Access bits (octal) |%A Access bits (flags)|%b Size/512\n%B Bytes per %b (512) |%d Device ID (dec) |%D Device ID (hex)\n%f All mode bits (hex) |%F File type |%g Group ID\n%G Group name |%h Hard links |%i Inode\n%m Mount point |%n Filename |%N Long filename\n%o I/O block size |%s Size (bytes) |%t Devtype major (hex)\n%T Devtype minor (hex) |%u User ID |%U User name\n%x Access time |%X Access unix time |%y Modification time\n%Y Mod unix time |%z Creation time |%Z Creation unix time\n\nThe valid format escape sequences for filesystems:\n%a Available blocks |%b Total blocks |%c Total inodes\n%d Free inodes |%f Free blocks |%i File system ID\n%l Max filename length |%n File name |%s Fragment size\n%S Best transfer size |%t FS type (hex) |%T FS type (driver name)\n\n"
-#define HELP_shred "usage: shred [-fuz] [-n COUNT] [-s SIZE] FILE...\n\nSecurely delete a file by overwriting its contents with random data.\n\n-f Force (chmod if necessary)\n-n COUNT Random overwrite iterations (default 1)\n-o OFFSET Start at OFFSET\n-s SIZE Use SIZE instead of detecting file size\n-u Unlink (actually delete file when done)\n-x Use exact size (default without -s rounds up to next 4k)\n-z Zero at end\n\nNote: data journaling filesystems render this command useless, you must\noverwrite all free space (fill up disk) to erase old data on those."
+#define HELP_shred "usage: shred [-fuz] [-n COUNT] [-s SIZE] FILE...\n\nSecurely delete a file by overwriting its contents with random data.\n\n-f Force (chmod if necessary)\n-n COUNT Random overwrite iterations (default 1)\n-o OFFSET Start at OFFSET\n-s SIZE Use SIZE instead of detecting file size\n-u Unlink (actually delete file when done)\n-x Use exact size (default without -s rounds up to next 4k)\n-z Zero at end\n\nNote: data journaling filesystems render this command useless, you must\noverwrite all free space (fill up disk) to erase old data on those.\n\n"
-#define HELP_setsid "usage: setsid [-t] command [args...]\n\nRun process in a new session.\n\n-t Grab tty (become foreground process, receiving keyboard signals)"
+#define HELP_setsid "usage: setsid [-t] command [args...]\n\nRun process in a new session.\n\n-t Grab tty (become foreground process, receiving keyboard signals)\n\n"
-#define HELP_setfattr "usage: setfattr [-h] [-x|-n NAME] [-v VALUE] FILE...\n\nWrite POSIX extended attributes.\n\n-h Do not dereference symlink\n-n Set given attribute\n-x Remove given attribute\n-v Set value for attribute -n (default is empty)"
+#define HELP_setfattr "usage: setfattr [-h] [-x|-n NAME] [-v VALUE] FILE...\n\nWrite POSIX extended attributes.\n\n-h Do not dereference symlink\n-n Set given attribute\n-x Remove given attribute\n-v Set value for attribute -n (default is empty)\n\n"
-#define HELP_rmmod "usage: rmmod [-wf] [MODULE]\n\nUnload the module named MODULE from the Linux kernel.\n-f Force unload of a module\n-w Wait until the module is no longer used"
+#define HELP_rmmod "usage: rmmod [-wf] [MODULE]\n\nUnload the module named MODULE from the Linux kernel.\n-f Force unload of a module\n-w Wait until the module is no longer used\n\n\n"
-#define HELP_rev "usage: rev [FILE...]\n\nOutput each line reversed, when no files are given stdin is used."
+#define HELP_rev "usage: rev [FILE...]\n\nOutput each line reversed, when no files are given stdin is used.\n\n"
-#define HELP_reset "usage: reset\n\nReset the terminal."
+#define HELP_reset "usage: reset\n\nReset the terminal.\n\n"
-#define HELP_reboot "usage: reboot/halt/poweroff [-fn]\n\nRestart, halt or powerdown the system.\n\n-f Don't signal init\n-n Don't sync before stopping the system"
+#define HELP_reboot "usage: reboot/halt/poweroff [-fn]\n\nRestart, halt or powerdown the system.\n\n-f Don't signal init\n-n Don't sync before stopping the system\n\n"
-#define HELP_realpath "usage: realpath FILE...\n\nDisplay the canonical absolute pathname"
+#define HELP_realpath "usage: realpath FILE...\n\nDisplay the canonical absolute pathname\n\n"
-#define HELP_readlink "usage: readlink FILE...\n\nWith no options, show what symlink points to, return error if not symlink.\n\nOptions for producing canonical paths (all symlinks/./.. resolved):\n\n-e Canonical path to existing entry (fail if missing)\n-f Full path (fail if directory missing)\n-m Ignore missing entries, show where it would be\n-n No trailing newline\n-q Quiet (no output, just error code)"
+#define HELP_readlink "usage: readlink FILE\n\nWith no options, show what symlink points to, return error if not symlink.\n\nOptions for producing canonical paths (all symlinks/./.. resolved):\n\n-e Canonical path to existing entry (fail if missing)\n-f Full path (fail if directory missing)\n-m Ignore missing entries, show where it would be\n-n No trailing newline\n-q Quiet (no output, just error code)\n\n"
-#define HELP_readahead "usage: readahead FILE...\n\nPreload files into disk cache."
+#define HELP_readahead "usage: readahead FILE...\n\nPreload files into disk cache.\n\n"
-#define HELP_pwdx "usage: pwdx PID...\n\nPrint working directory of processes listed on command line."
+#define HELP_pwdx "usage: pwdx PID...\n\nPrint working directory of processes listed on command line.\n\n"
-#define HELP_printenv "usage: printenv [-0] [env_var...]\n\nPrint environment variables.\n\n-0 Use \\0 as delimiter instead of \\n"
+#define HELP_printenv "usage: printenv [-0] [env_var...]\n\nPrint environment variables.\n\n-0 Use \\0 as delimiter instead of \\n\n\n"
-#define HELP_pmap "usage: pmap [-xq] [pids...]\n\nReport the memory map of a process or processes.\n\n-x Show the extended format\n-q Do not display some header/footer lines"
+#define HELP_pmap "usage: pmap [-xq] [pids...]\n\nReport the memory map of a process or processes.\n\n-x Show the extended format\n-q Do not display some header/footer lines\n\n"
-#define HELP_pivot_root "usage: pivot_root OLD NEW\n\nSwap OLD and NEW filesystems (as if by simultaneous mount --move), and\nmove all processes with chdir or chroot under OLD into NEW (including\nkernel threads) so OLD may be unmounted.\n\nThe directory NEW must exist under OLD. This doesn't work on initramfs,\nwhich can't be moved (about the same way PID 1 can't be killed; see\nswitch_root instead)."
+#define HELP_pivot_root "usage: pivot_root OLD NEW\n\nSwap OLD and NEW filesystems (as if by simultaneous mount --move), and\nmove all processes with chdir or chroot under OLD into NEW (including\nkernel threads) so OLD may be unmounted.\n\nThe directory NEW must exist under OLD. This doesn't work on initramfs,\nwhich can't be moved (about the same way PID 1 can't be killed; see\nswitch_root instead).\n\n"
-#define HELP_partprobe "usage: partprobe DEVICE...\n\nTell the kernel about partition table changes\n\nAsk the kernel to re-read the partition table on the specified devices."
+#define HELP_partprobe "usage: partprobe DEVICE...\n\nTell the kernel about partition table changes\n\nAsk the kernel to re-read the partition table on the specified devices.\n\n"
-#define HELP_oneit "usage: oneit [-p] [-c /dev/tty0] command [...]\n\nSimple init program that runs a single supplied command line with a\ncontrolling tty (so CTRL-C can kill it).\n\n-c Which console device to use (/dev/console doesn't do CTRL-C, etc)\n-p Power off instead of rebooting when command exits\n-r Restart child when it exits\n-3 Write 32 bit PID of each exiting reparented process to fd 3 of child\n (Blocking writes, child must read to avoid eventual deadlock.)\n\nSpawns a single child process (because PID 1 has signals blocked)\nin its own session, reaps zombies until the child exits, then\nreboots the system (or powers off with -p, or restarts the child with -r).\n\nResponds to SIGUSR1 by halting the system, SIGUSR2 by powering off,\nand SIGTERM or SIGINT reboot."
+#define HELP_oneit "usage: oneit [-p] [-c /dev/tty0] command [...]\n\nSimple init program that runs a single supplied command line with a\ncontrolling tty (so CTRL-C can kill it).\n\n-c Which console device to use (/dev/console doesn't do CTRL-C, etc)\n-p Power off instead of rebooting when command exits\n-r Restart child when it exits\n-3 Write 32 bit PID of each exiting reparented process to fd 3 of child\n (Blocking writes, child must read to avoid eventual deadlock.)\n\nSpawns a single child process (because PID 1 has signals blocked)\nin its own session, reaps zombies until the child exits, then\nreboots the system (or powers off with -p, or restarts the child with -r).\n\nResponds to SIGUSR1 by halting the system, SIGUSR2 by powering off,\nand SIGTERM or SIGINT reboot.\n\n"
-#define HELP_nsenter "usage: nsenter [-t pid] [-F] [-i] [-m] [-n] [-p] [-u] [-U] COMMAND...\n\nRun COMMAND in an existing (set of) namespace(s).\n\n-t PID to take namespaces from (--target)\n-F don't fork, even if -p is used (--no-fork)\n\nThe namespaces to switch are:\n\n-i SysV IPC: message queues, semaphores, shared memory (--ipc)\n-m Mount/unmount tree (--mount)\n-n Network address, sockets, routing, iptables (--net)\n-p Process IDs and init, will fork unless -F is used (--pid)\n-u Host and domain names (--uts)\n-U UIDs, GIDs, capabilities (--user)\n\nIf -t isn't specified, each namespace argument must provide a path\nto a namespace file, ala \"-i=/proc/$PID/ns/ipc\""
+#define HELP_nsenter "usage: nsenter [-t pid] [-F] [-i] [-m] [-n] [-p] [-u] [-U] COMMAND...\n\nRun COMMAND in an existing (set of) namespace(s).\n\n-t PID to take namespaces from (--target)\n-F don't fork, even if -p is used (--no-fork)\n\nThe namespaces to switch are:\n\n-i SysV IPC: message queues, semaphores, shared memory (--ipc)\n-m Mount/unmount tree (--mount)\n-n Network address, sockets, routing, iptables (--net)\n-p Process IDs and init, will fork unless -F is used (--pid)\n-u Host and domain names (--uts)\n-U UIDs, GIDs, capabilities (--user)\n\nIf -t isn't specified, each namespace argument must provide a path\nto a namespace file, ala \"-i=/proc/$PID/ns/ipc\"\n\n"
-#define HELP_unshare "usage: unshare [-imnpuUr] COMMAND...\n\nCreate new container namespace(s) for this process and its children, so\nsome attribute is not shared with the parent process.\n\n-f Fork command in the background (--fork)\n-i SysV IPC (message queues, semaphores, shared memory) (--ipc)\n-m Mount/unmount tree (--mount)\n-n Network address, sockets, routing, iptables (--net)\n-p Process IDs and init (--pid)\n-r Become root (map current euid/egid to 0/0, implies -U) (--map-root-user)\n-u Host and domain names (--uts)\n-U UIDs, GIDs, capabilities (--user)\n\nA namespace allows a set of processes to have a different view of the\nsystem than other sets of processes."
+#define HELP_unshare "usage: unshare [-imnpuUr] COMMAND...\n\nCreate new container namespace(s) for this process and its children, so\nsome attribute is not shared with the parent process.\n\n-f Fork command in the background (--fork)\n-i SysV IPC (message queues, semaphores, shared memory) (--ipc)\n-m Mount/unmount tree (--mount)\n-n Network address, sockets, routing, iptables (--net)\n-p Process IDs and init (--pid)\n-r Become root (map current euid/egid to 0/0, implies -U) (--map-root-user)\n-u Host and domain names (--uts)\n-U UIDs, GIDs, capabilities (--user)\n\nA namespace allows a set of processes to have a different view of the\nsystem than other sets of processes.\n\n"
-#define HELP_nbd_client "usage: nbd-client [-ns] HOST PORT DEVICE\n\n-n Do not fork into background\n-s nbd swap support (lock server into memory)"
+#define HELP_nbd_client "usage: nbd-client [-ns] HOST PORT DEVICE\n\n-n Do not fork into background\n-s nbd swap support (lock server into memory)\n\n"
-#define HELP_mountpoint "usage: mountpoint [-qd] DIR\n mountpoint [-qx] DEVICE\n\nCheck whether the directory or device is a mountpoint.\n\n-q Be quiet, return zero if directory is a mountpoint\n-d Print major/minor device number of the directory\n-x Print major/minor device number of the block device"
+#define HELP_mountpoint "usage: mountpoint [-qd] DIR\n mountpoint [-qx] DEVICE\n\nCheck whether the directory or device is a mountpoint.\n\n-q Be quiet, return zero if directory is a mountpoint\n-d Print major/minor device number of the directory\n-x Print major/minor device number of the block device\n\n"
-#define HELP_modinfo "usage: modinfo [-0] [-b basedir] [-k kernel] [-F field] [module|file...]\n\nDisplay module fields for modules specified by name or .ko path.\n\n-F Only show the given field\n-0 Separate fields with NUL rather than newline\n-b Use <basedir> as root for /lib/modules/\n-k Look in given directory under /lib/modules/"
+#define HELP_modinfo "usage: modinfo [-0] [-b basedir] [-k kernrelease] [-F field] [modulename...]\n\nDisplay module fields for all specified modules, looking in\n<basedir>/lib/modules/<kernrelease>/ (kernrelease defaults to uname -r).\n\n"
-#define HELP_mkswap "usage: mkswap [-L LABEL] DEVICE\n\nSet up a Linux swap area on a device or file."
+#define HELP_mkswap "usage: mkswap [-L LABEL] DEVICE\n\nSet up a Linux swap area on a device or file.\n\n"
-#define HELP_mkpasswd "usage: mkpasswd [-P FD] [-m TYPE] [-S SALT] [PASSWORD] [SALT]\n\nCrypt PASSWORD using crypt(3)\n\n-P FD Read password from file descriptor FD\n-m TYPE Encryption method (des, md5, sha256, or sha512; default is des)\n-S SALT"
+#define HELP_mkpasswd "usage: mkpasswd [-P FD] [-m TYPE] [-S SALT] [PASSWORD] [SALT]\n\nCrypt PASSWORD using crypt(3)\n\n-P FD Read password from file descriptor FD\n-m TYPE Encryption method (des, md5, sha256, or sha512; default is des)\n-S SALT\n\n"
-#define HELP_mix "usage: mix [-d DEV] [-c CHANNEL] [-l VOL] [-r RIGHT]\n\nList OSS sound channels (module snd-mixer-oss), or set volume(s).\n\n-c CHANNEL Set/show volume of CHANNEL (default first channel found)\n-d DEV Device node (default /dev/mixer)\n-l VOL Volume level\n-r RIGHT Volume of right stereo channel (with -r, -l sets left volume)"
+#define HELP_mix "usage: mix [-d DEV] [-c CHANNEL] [-l VOL] [-r RIGHT]\n\nList OSS sound channels (module snd-mixer-oss), or set volume(s).\n\n-c CHANNEL Set/show volume of CHANNEL (default first channel found)\n-d DEV Device node (default /dev/mixer)\n-l VOL Volume level\n-r RIGHT Volume of right stereo channel (with -r, -l sets left volume)\n\n"
-#define HELP_mcookie "usage: mcookie [-vV]\n\nGenerate a 128-bit strong random number.\n\n-v show entropy source (verbose)\n-V show version"
+#define HELP_mcookie "usage: mcookie [-vV]\n\nGenerate a 128-bit strong random number.\n\n-v show entropy source (verbose)\n-V show version\n\n"
-#define HELP_makedevs "usage: makedevs [-d device_table] rootdir\n\nCreate a range of special files as specified in a device table.\n\n-d File containing device table (default reads from stdin)\n\nEach line of the device table has the fields:\n<name> <type> <mode> <uid> <gid> <major> <minor> <start> <increment> <count>\nWhere name is the file name, and type is one of the following:\n\nb Block device\nc Character device\nd Directory\nf Regular file\np Named pipe (fifo)\n\nOther fields specify permissions, user and group id owning the file,\nand additional fields for device special files. Use '-' for blank entries,\nunspecified fields are treated as '-'."
+#define HELP_makedevs "usage: makedevs [-d device_table] rootdir\n\nCreate a range of special files as specified in a device table.\n\n-d File containing device table (default reads from stdin)\n\nEach line of of the device table has the fields:\n<name> <type> <mode> <uid> <gid> <major> <minor> <start> <increment> <count>\nWhere name is the file name, and type is one of the following:\n\nb Block device\nc Character device\nd Directory\nf Regular file\np Named pipe (fifo)\n\nOther fields specify permissions, user and group id owning the file,\nand additional fields for device special files. Use '-' for blank entries,\nunspecified fields are treated as '-'.\n\n"
-#define HELP_lsusb "usage: lsusb\n\nList USB hosts/devices."
+#define HELP_lsusb "usage: lsusb\n\nList USB hosts/devices.\n\n"
-#define HELP_lspci_text "usage: lspci [-n] [-i FILE ]\n\n-n Numeric output (repeat for readable and numeric)\n-i PCI ID database (default /usr/share/misc/pci.ids)"
+#define HELP_lspci_text "usage: lspci [-n] [-i FILE ]\n\n-n Numeric output (repeat for readable and numeric)\n-i PCI ID database (default /usr/share/misc/pci.ids)\n\n\n"
-#define HELP_lspci "usage: lspci [-ekm]\n\nList PCI devices.\n\n-e Print all 6 digits in class\n-k Print kernel driver\n-m Machine parseable format"
+#define HELP_lspci "usage: lspci [-ekm]\n\nList PCI devices.\n\n-e Print all 6 digits in class\n-k Print kernel driver\n-m Machine parseable format\n\n"
-#define HELP_lsmod "usage: lsmod\n\nDisplay the currently loaded modules, their sizes and their dependencies."
+#define HELP_lsmod "usage: lsmod\n\nDisplay the currently loaded modules, their sizes and their dependencies.\n\n"
-#define HELP_chattr "usage: chattr [-R] [-+=AacDdijsStTu] [-v version] [File...]\n\nChange file attributes on a Linux second extended file system.\n\n-R Recurse\n-v Set the file's version/generation number\n\nOperators:\n '-' Remove attributes\n '+' Add attributes\n '=' Set attributes\n\nAttributes:\n A Don't track atime\n a Append mode only\n c Enable compress\n D Write dir contents synchronously\n d Don't backup with dump\n i Cannot be modified (immutable)\n j Write all data to journal first\n s Zero disk storage when deleted\n S Write file contents synchronously\n t Disable tail-merging of partial blocks with other files\n u Allow file to be undeleted"
+#define HELP_chattr "usage: chattr [-R] [-+=AacDdijsStTu] [-v version] [File...]\n\nChange file attributes on a Linux second extended file system.\n\n-R Recurse\n-v Set the file's version/generation number\n\nOperators:\n '-' Remove attributes\n '+' Add attributes\n '=' Set attributes\n\nAttributes:\n A Don't track atime\n a Append mode only\n c Enable compress\n D Write dir contents synchronously\n d Don't backup with dump\n i Cannot be modified (immutable)\n j Write all data to journal first\n s Zero disk storage when deleted\n S Write file contents synchronously\n t Disable tail-merging of partial blocks with other files\n u Allow file to be undeleted\n\n"
-#define HELP_lsattr "usage: lsattr [-Radlv] [Files...]\n\nList file attributes on a Linux second extended file system.\n(AacDdijsStu defined in chattr --help)\n\n-R Recursively list attributes of directories and their contents\n-a List all files in directories, including files that start with '.'\n-d List directories like other files, rather than listing their contents\n-l List long flag names\n-v List the file's version/generation number"
+#define HELP_lsattr "usage: lsattr [-Radlv] [Files...]\n\nList file attributes on a Linux second extended file system.\n(AacDdijsStu defined in chattr --help)\n\n-R Recursively list attributes of directories and their contents\n-a List all files in directories, including files that start with '.'\n-d List directories like other files, rather than listing their contents\n-l List long flag names\n-v List the file's version/generation number\n\n"
-#define HELP_losetup "usage: losetup [-cdrs] [-o OFFSET] [-S SIZE] {-d DEVICE...|-j FILE|-af|{DEVICE FILE}}\n\nAssociate a loopback device with a file, or show current file (if any)\nassociated with a loop device.\n\nInstead of a device:\n-a Iterate through all loopback devices\n-f Find first unused loop device (may create one)\n-j FILE Iterate through all loopback devices associated with FILE\n\nexisting:\n-c Check capacity (file size changed)\n-d DEV Detach loopback device\n-D Detach all loopback devices\n\nnew:\n-s Show device name (alias --show)\n-o OFF Start association at offset OFF into FILE\n-r Read only\n-S SIZE Limit SIZE of loopback association (alias --sizelimit)"
+#define HELP_losetup "usage: losetup [-cdrs] [-o OFFSET] [-S SIZE] {-d DEVICE...|-j FILE|-af|{DEVICE FILE}}\n\nAssociate a loopback device with a file, or show current file (if any)\nassociated with a loop device.\n\nInstead of a device:\n-a Iterate through all loopback devices\n-f Find first unused loop device (may create one)\n-j Iterate through all loopback devices associated with FILE\n\nexisting:\n-c Check capacity (file size changed)\n-d Detach loopback device\n\nnew:\n-s Show device name (alias --show)\n-o Start association at OFFSET into FILE\n-r Read only\n-S Limit SIZE of loopback association (alias --sizelimit)\n\n"
-#define HELP_login "usage: login [-p] [-h host] [-f USERNAME] [USERNAME]\n\nLog in as a user, prompting for username and password if necessary.\n\n-p Preserve environment\n-h The name of the remote host for this login\n-f login as USERNAME without authentication"
+#define HELP_login "usage: login [-p] [-h host] [-f USERNAME] [USERNAME]\n\nLog in as a user, prompting for username and password if necessary.\n\n-p Preserve environment\n-h The name of the remote host for this login\n-f login as USERNAME without authentication\n\n"
-#define HELP_iorenice "usage: iorenice PID [CLASS] [PRIORITY]\n\nDisplay or change I/O priority of existing process. CLASS can be\n\"rt\" for realtime, \"be\" for best effort, \"idle\" for only when idle, or\n\"none\" to leave it alone. PRIORITY can be 0-7 (0 is highest, default 4)."
+#define HELP_iorenice "usage: iorenice PID [CLASS] [PRIORITY]\n\nDisplay or change I/O priority of existing process. CLASS can be\n\"rt\" for realtime, \"be\" for best effort, \"idle\" for only when idle, or\n\"none\" to leave it alone. PRIORITY can be 0-7 (0 is highest, default 4).\n\n"
-#define HELP_ionice "usage: ionice [-t] [-c CLASS] [-n LEVEL] [COMMAND...|-p PID]\n\nChange the I/O scheduling priority of a process. With no arguments\n(or just -p), display process' existing I/O class/priority.\n\n-c CLASS = 1-3: 1(realtime), 2(best-effort, default), 3(when-idle)\n-n LEVEL = 0-7: (0 is highest priority, default = 5)\n-p Affect existing PID instead of spawning new child\n-t Ignore failure to set I/O priority\n\nSystem default iopriority is generally -c 2 -n 4."
+#define HELP_ionice "usage: ionice [-t] [-c CLASS] [-n LEVEL] [COMMAND...|-p PID]\n\nChange the I/O scheduling priority of a process. With no arguments\n(or just -p), display process' existing I/O class/priority.\n\n-c CLASS = 1-3: 1(realtime), 2(best-effort, default), 3(when-idle)\n-n LEVEL = 0-7: (0 is highest priority, default = 5)\n-p Affect existing PID instead of spawning new child\n-t Ignore failure to set I/O priority\n\nSystem default iopriority is generally -c 2 -n 4.\n\n"
-#define HELP_insmod "usage: insmod MODULE [MODULE_OPTIONS]\n\nLoad the module named MODULE passing options if given."
+#define HELP_insmod "usage: insmod MODULE [MODULE_OPTIONS]\n\nLoad the module named MODULE passing options if given.\n\n"
-#define HELP_inotifyd "usage: inotifyd PROG FILE[:MASK] ...\n\nWhen a filesystem event matching MASK occurs to a FILE, run PROG as:\n\n PROG EVENTS FILE [DIRFILE]\n\nIf PROG is \"-\" events are sent to stdout.\n\nThis file is:\n a accessed c modified e metadata change w closed (writable)\n r opened D deleted M moved 0 closed (unwritable)\n u unmounted o overflow x unwatchable\n\nA file in this directory is:\n m moved in y moved out n created d deleted\n\nWhen x event happens for all FILEs, inotifyd exits (after waiting for PROG)."
+#define HELP_inotifyd "usage: inotifyd PROG FILE[:MASK] ...\n\nWhen a filesystem event matching MASK occurs to a FILE, run PROG as:\n\n PROG EVENTS FILE [DIRFILE]\n\nIf PROG is \"-\" events are sent to stdout.\n\nThis file is:\n a accessed c modified e metadata change w closed (writable)\n r opened D deleted M moved 0 closed (unwritable)\n u unmounted o overflow x unwatchable\n\nA file in this directory is:\n m moved in y moved out n created d deleted\n\nWhen x event happens for all FILEs, inotifyd exits (after waiting for PROG).\n\n"
-#define HELP_i2cset "usage: i2cset [-fy] BUS CHIP ADDR VALUE... MODE\n\nWrite an i2c register. MODE is b for byte, w for 16-bit word, i for I2C block.\n\n-f Force access to busy devices\n-y Answer \"yes\" to confirmation prompts (for script use)"
+#define HELP_i2cset "usage: i2cset [-fy] BUS CHIP ADDR VALUE... MODE\n\nWrite an i2c register. MODE is b for byte, w for 16-bit word, i for I2C block.\n\n-f Force access to busy devices\n-y Answer \"yes\" to confirmation prompts (for script use)\n\n"
-#define HELP_i2cget "usage: i2cget [-fy] BUS CHIP ADDR\n\nRead an i2c register.\n\n-f Force access to busy devices\n-y Answer \"yes\" to confirmation prompts (for script use)"
+#define HELP_i2cget "usage: i2cget [-fy] BUS CHIP ADDR\n\nRead an i2c register.\n\n-f Force access to busy devices\n-y Answer \"yes\" to confirmation prompts (for script use)\n\n"
-#define HELP_i2cdump "usage: i2cdump [-fy] BUS CHIP\n\nDump i2c registers.\n\n-f Force access to busy devices\n-y Answer \"yes\" to confirmation prompts (for script use)"
+#define HELP_i2cdump "usage: i2cdump [-fy] BUS CHIP\n\nDump i2c registers.\n\n-f Force access to busy devices\n-y Answer \"yes\" to confirmation prompts (for script use)\n\n"
-#define HELP_i2cdetect "usage: i2cdetect [-ary] BUS [FIRST LAST]\nusage: i2cdetect -F BUS\nusage: i2cdetect -l\n\nDetect i2c devices.\n\n-a All addresses (0x00-0x7f rather than 0x03-0x77)\n-F Show functionality\n-l List all buses\n-r Probe with SMBus Read Byte\n-y Answer \"yes\" to confirmation prompts (for script use)"
+#define HELP_i2cdetect "usage: i2cdetect [-ary] BUS [FIRST LAST]\nusage: i2cdetect -F BUS\nusage: i2cdetect -l\n\nDetect i2c devices.\n\n-a All addresses (0x00-0x7f rather than 0x03-0x77)\n-F Show functionality\n-l List all buses\n-r Probe with SMBus Read Byte\n-y Answer \"yes\" to confirmation prompts (for script use)\n\n"
-#define HELP_hwclock "usage: hwclock [-rswtluf]\n\nGet/set the hardware clock.\n\n-f FILE Use specified device file instead of /dev/rtc (--rtc)\n-l Hardware clock uses localtime (--localtime)\n-r Show hardware clock time (--show)\n-s Set system time from hardware clock (--hctosys)\n-t Set the system time based on the current timezone (--systz)\n-u Hardware clock uses UTC (--utc)\n-w Set hardware clock from system time (--systohc)"
+#define HELP_hwclock "usage: hwclock [-rswtluf]\n\nGet/set the hardware clock.\n\n-f FILE Use specified device file instead of /dev/rtc (--rtc)\n-l Hardware clock uses localtime (--localtime)\n-r Show hardware clock time (--show)\n-s Set system time from hardware clock (--hctosys)\n-t Set the system time based on the current timezone (--systz)\n-u Hardware clock uses UTC (--utc)\n-w Set hardware clock from system time (--systohc)\n\n"
-#define HELP_hexedit "usage: hexedit FILENAME\n\nHexadecimal file editor. All changes are written to disk immediately.\n\n-r Read only (display but don't edit)\n\nKeys:\nArrows Move left/right/up/down by one line/column\nPg Up/Pg Dn Move up/down by one page\n0-9, a-f Change current half-byte to hexadecimal value\nu Undo\nq/^c/^d/<esc> Quit"
+#define HELP_hexedit "usage: hexedit FILENAME\n\nHexadecimal file editor. All changes are written to disk immediately.\n\n-r Read only (display but don't edit)\n\nKeys:\nArrows Move left/right/up/down by one line/column\nPg Up/Pg Dn Move up/down by one page\n0-9, a-f Change current half-byte to hexadecimal value\nu Undo\nq/^c/^d/<esc> Quit\n\n"
-#define HELP_help "usage: help [-ah] [command]\n\nShow usage information for toybox commands.\nRun \"toybox\" with no arguments for a list of available commands.\n\n-h HTML output\n-a All commands"
+#define HELP_help "usage: help [-ah] [command]\n\nShow usage information for toybox commands.\nRun \"toybox\" with no arguments for a list of available commands.\n\n-h HTML output\n-a All commands\n"
-#define HELP_fsync "usage: fsync [-d] [FILE...]\n\nSynchronize a file's in-core state with storage device.\n\n-d Avoid syncing metadata"
+#define HELP_fsync "usage: fsync [-d] [FILE...]\n\nSynchronize a file's in-core state with storage device.\n\n-d Avoid syncing metadata\n\n"
-#define HELP_fsfreeze "usage: fsfreeze {-f | -u} MOUNTPOINT\n\nFreeze or unfreeze a filesystem.\n\n-f Freeze\n-u Unfreeze"
+#define HELP_fsfreeze "usage: fsfreeze {-f | -u} MOUNTPOINT\n\nFreeze or unfreeze a filesystem.\n\n-f Freeze\n-u Unfreeze\n\n"
-#define HELP_freeramdisk "usage: freeramdisk [RAM device]\n\nFree all memory allocated to specified ramdisk"
+#define HELP_freeramdisk "usage: freeramdisk [RAM device]\n\nFree all memory allocated to specified ramdisk\n\n"
-#define HELP_free "usage: free [-bkmgt]\n\nDisplay the total, free and used amount of physical memory and swap space.\n\n-bkmgt Output units (default is bytes)\n-h Human readable (K=1024)"
+#define HELP_free "usage: free [-bkmgt]\n\nDisplay the total, free and used amount of physical memory and swap space.\n\n-bkmgt Output units (default is bytes)\n-h Human readable (K=1024)\n\n"
-#define HELP_fmt "usage: fmt [-w WIDTH] [FILE...]\n\nReformat input to wordwrap at a given line length, preserving existing\nindentation level, writing to stdout.\n\n-w WIDTH Maximum characters per line (default 75)"
+#define HELP_fmt "usage: fmt [-w WIDTH] [FILE...]\n\nReformat input to wordwrap at a given line length, preserving existing\nindentation level, writing to stdout.\n\n-w WIDTH Maximum characters per line (default 75)\n\n"
-#define HELP_flock "usage: flock [-sxun] fd\n\nManage advisory file locks.\n\n-s Shared lock\n-x Exclusive lock (default)\n-u Unlock\n-n Non-blocking: fail rather than wait for the lock"
+#define HELP_flock "usage: flock [-sxun] fd\n\nManage advisory file locks.\n\n-s Shared lock\n-x Exclusive lock (default)\n-u Unlock\n-n Non-blocking: fail rather than wait for the lock\n\n"
-#define HELP_fallocate "usage: fallocate [-l size] [-o offset] file\n\nTell the filesystem to allocate space for a file."
+#define HELP_fallocate "usage: fallocate [-l size] [-o offset] file\n\nTell the filesystem to allocate space for a file.\n\n"
-#define HELP_factor "usage: factor NUMBER...\n\nFactor integers."
+#define HELP_factor "usage: factor NUMBER...\n\nFactor integers.\n\n"
-#define HELP_eject "usage: eject [-stT] [DEVICE]\n\nEject DEVICE or default /dev/cdrom\n\n-s SCSI device\n-t Close tray\n-T Open/close tray (toggle)"
+#define HELP_eject "usage: eject [-stT] [DEVICE]\n\nEject DEVICE or default /dev/cdrom\n\n-s SCSI device\n-t Close tray\n-T Open/close tray (toggle)\n\n"
-#define HELP_unix2dos "usage: unix2dos [FILE...]\n\nConvert newline format from unix \"\\n\" to dos \"\\r\\n\".\nIf no files listed copy from stdin, \"-\" is a synonym for stdin."
+#define HELP_unix2dos "usage: unix2dos [FILE...]\n\nConvert newline format from unix \"\\n\" to dos \"\\r\\n\".\nIf no files listed copy from stdin, \"-\" is a synonym for stdin.\n\n"
-#define HELP_dos2unix "usage: dos2unix [FILE...]\n\nConvert newline format from dos \"\\r\\n\" to unix \"\\n\".\nIf no files listed copy from stdin, \"-\" is a synonym for stdin."
+#define HELP_dos2unix "usage: dos2unix [FILE...]\n\nConvert newline format from dos \"\\r\\n\" to unix \"\\n\".\nIf no files listed copy from stdin, \"-\" is a synonym for stdin.\n\n"
-#define HELP_devmem "usage: devmem ADDR [WIDTH [DATA]]\n\nRead/write physical address via /dev/mem.\n\nWIDTH is 1, 2, 4, or 8 bytes (default 4)."
+#define HELP_devmem "usage: devmem ADDR [WIDTH [DATA]]\n\nRead/write physical address via /dev/mem.\n\nWIDTH is 1, 2, 4, or 8 bytes (default 4).\n\n"
-#define HELP_count "usage: count\n\nCopy stdin to stdout, displaying simple progress indicator to stderr."
+#define HELP_count "usage: count\n\nCopy stdin to stdout, displaying simple progress indicator to stderr.\n\n"
-#define HELP_clear "Clear the screen."
+#define HELP_clear "Clear the screen.\n\n"
-#define HELP_chvt "usage: chvt N\n\nChange to virtual terminal number N. (This only works in text mode.)\n\nVirtual terminals are the Linux VGA text mode displays, ordinarily\nswitched between via alt-F1, alt-F2, etc. Use ctrl-alt-F1 to switch\nfrom X to a virtual terminal, and alt-F6 (or F7, or F8) to get back."
+#define HELP_chvt "usage: chvt N\n\nChange to virtual terminal number N. (This only works in text mode.)\n\nVirtual terminals are the Linux VGA text mode displays, ordinarily\nswitched between via alt-F1, alt-F2, etc. Use ctrl-alt-F1 to switch\nfrom X to a virtual terminal, and alt-F6 (or F7, or F8) to get back.\n\n"
-#define HELP_chrt "usage: chrt [-Rmofrbi] {-p PID [PRIORITY] | [PRIORITY COMMAND...]}\n\nGet/set a process' real-time scheduling policy and priority.\n\n-p Set/query given pid (instead of running COMMAND)\n-R Set SCHED_RESET_ON_FORK\n-m Show min/max priorities available\n\nSet policy (default -r):\n\n -o SCHED_OTHER -f SCHED_FIFO -r SCHED_RR\n -b SCHED_BATCH -i SCHED_IDLE"
+#define HELP_chrt "usage: chrt [-Rmofrbi] {-p PID [PRIORITY] | [PRIORITY COMMAND...]}\n\nGet/set a process' real-time scheduling policy and priority.\n\n-p Set/query given pid (instead of running COMMAND)\n-R Set SCHED_RESET_ON_FORK\n-m Show min/max priorities available\n\nSet policy (default -r):\n\n -o SCHED_OTHER -f SCHED_FIFO -r SCHED_RR\n -b SCHED_BATCH -i SCHED_IDLE\n\n"
-#define HELP_chroot "usage: chroot NEWROOT [COMMAND [ARG...]]\n\nRun command within a new root directory. If no command, run /bin/sh."
+#define HELP_chroot "usage: chroot NEWROOT [COMMAND [ARG...]]\n\nRun command within a new root directory. If no command, run /bin/sh.\n\n"
-#define HELP_chcon "usage: chcon [-hRv] CONTEXT FILE...\n\nChange the SELinux security context of listed file[s].\n\n-h Change symlinks instead of what they point to\n-R Recurse into subdirectories\n-v Verbose"
+#define HELP_chcon "usage: chcon [-hRv] CONTEXT FILE...\n\nChange the SELinux security context of listed file[s].\n\n-h Change symlinks instead of what they point to\n-R Recurse into subdirectories\n-v Verbose\n\n"
-#define HELP_bzcat "usage: bzcat [FILE...]\n\nDecompress listed files to stdout. Use stdin if no files listed."
+#define HELP_bzcat "usage: bzcat [FILE...]\n\nDecompress listed files to stdout. Use stdin if no files listed.\n\n"
-#define HELP_bunzip2 "usage: bunzip2 [-cftkv] [FILE...]\n\nDecompress listed files (file.bz becomes file) deleting archive file(s).\nRead from stdin if no files listed.\n\n-c Force output to stdout\n-f Force decompression (if FILE doesn't end in .bz, replace original)\n-k Keep input files (-c and -t imply this)\n-t Test integrity\n-v Verbose"
+#define HELP_bunzip2 "usage: bunzip2 [-cftkv] [FILE...]\n\nDecompress listed files (file.bz becomes file) deleting archive file(s).\nRead from stdin if no files listed.\n\n-c Force output to stdout\n-f Force decompression (if FILE doesn't end in .bz, replace original)\n-k Keep input files (-c and -t imply this)\n-t Test integrity\n-v Verbose\n\n"
-#define HELP_blockdev "usage: blockdev --OPTION... BLOCKDEV...\n\nCall ioctl(s) on each listed block device\n\n--setro Set read only\n--setrw Set read write\n--getro Get read only\n--getss Get sector size\n--getbsz Get block size\n--setbsz BYTES Set block size\n--getsz Get device size in 512-byte sectors\n--getsize Get device size in sectors (deprecated)\n--getsize64 Get device size in bytes\n--getra Get readahead in 512-byte sectors\n--setra SECTORS Set readahead\n--flushbufs Flush buffers\n--rereadpt Reread partition table"
+#define HELP_blockdev "usage: blockdev --OPTION... BLOCKDEV...\n\nCall ioctl(s) on each listed block device\n\n--setro Set read only\n--setrw Set read write\n--getro Get read only\n--getss Get sector size\n--getbsz Get block size\n--setbsz BYTES Set block size\n--getsz Get device size in 512-byte sectors\n--getsize Get device size in sectors (deprecated)\n--getsize64 Get device size in bytes\n--getra Get readahead in 512-byte sectors\n--setra SECTORS Set readahead\n--flushbufs Flush buffers\n--rereadpt Reread partition table\n\n"
-#define HELP_fstype "usage: fstype DEV...\n\nPrint type of filesystem on a block device or image."
+#define HELP_fstype "usage: fstype DEV...\n\nPrint type of filesystem on a block device or image.\n\n"
-#define HELP_blkid "usage: blkid [-s TAG] [-UL] DEV...\n\nPrint type, label and UUID of filesystem on a block device or image.\n\n-U Show UUID only (or device with that UUID)\n-L Show LABEL only (or device with that LABEL)\n-s TAG Only show matching tags (default all)"
+#define HELP_blkid "usage: blkid [-UL] DEV...\n\nPrint type, label and UUID of filesystem on a block device or image.\n\n-U Show UUID only (or device with that UUID)\n-L Show LABEL only (or device with that LABEL)\n\n"
-#define HELP_base64 "usage: base64 [-di] [-w COLUMNS] [FILE...]\n\nEncode or decode in base64.\n\n-d Decode\n-i Ignore non-alphabetic characters\n-w Wrap output at COLUMNS (default 76 or 0 for no wrap)"
+#define HELP_base64 "usage: base64 [-di] [-w COLUMNS] [FILE...]\n\nEncode or decode in base64.\n\n-d Decode\n-i Ignore non-alphabetic characters\n-w Wrap output at COLUMNS (default 76 or 0 for no wrap)\n\n"
-#define HELP_ascii "usage: ascii\n\nDisplay ascii character set."
+#define HELP_ascii "usage: ascii\n\nDisplay ascii character set.\n\n"
-#define HELP_acpi "usage: acpi [-abctV]\n\nShow status of power sources and thermal devices.\n\n-a Show power adapters\n-b Show batteries\n-c Show cooling device state\n-t Show temperatures\n-V Show everything"
+#define HELP_acpi "usage: acpi [-abctV]\n\nShow status of power sources and thermal devices.\n\n-a Show power adapters\n-b Show batteries\n-c Show cooling device state\n-t Show temperatures\n-V Show everything\n\n"
-#define HELP_xzcat "usage: xzcat [filename...]\n\nDecompress listed files to stdout. Use stdin if no files listed."
+#define HELP_xzcat "usage: xzcat [filename...]\n\nDecompress listed files to stdout. Use stdin if no files listed.\n\n\n\n"
-#define HELP_wget "usage: wget -O filename URL\n-O filename: specify output filename\nURL: uniform resource location, FTP/HTTP only, not HTTPS\n\nexamples:\n wget -O index.html http://www.example.com\n wget -O sample.jpg ftp://ftp.example.com:21/sample.jpg"
+#define HELP_wget "usage: wget -f filename URL\n-f filename: specify the filename to be saved\nURL: HTTP uniform resource location and only HTTP, not HTTPS\n\nexamples:\n wget -f index.html http://www.example.com\n wget -f sample.jpg http://www.example.com:8080/sample.jpg\n\n"
-#define HELP_vi "usage: vi FILE\nVisual text editor. Predates the existence of standardized cursor keys,\nso the controls are weird and historical."
+#define HELP_vi "usage: vi FILE\nVisual text editor. Predates the existence of standardized cursor keys,\nso the controls are weird and historical.\n\n"
-#define HELP_userdel "usage: userdel [-r] USER\nusage: deluser [-r] USER\n\nDelete USER from the SYSTEM\n\n-r remove home directory"
+#define HELP_userdel "usage: userdel [-r] USER\nusage: deluser [-r] USER\n\nDelete USER from the SYSTEM\n\n-r remove home directory\n\n"
-#define HELP_useradd "usage: useradd [-SDH] [-h DIR] [-s SHELL] [-G GRP] [-g NAME] [-u UID] USER [GROUP]\n\nCreate new user, or add USER to GROUP\n\n-D Don't assign a password\n-g NAME Real name\n-G GRP Add user to existing group\n-h DIR Home directory\n-H Don't create home directory\n-s SHELL Login shell\n-S Create a system user\n-u UID User id"
+#define HELP_useradd "usage: useradd [-SDH] [-h DIR] [-s SHELL] [-G GRP] [-g NAME] [-u UID] USER [GROUP]\n\nCreate new user, or add USER to GROUP\n\n-D Don't assign a password\n-g NAME Real name\n-G GRP Add user to existing group\n-h DIR Home directory\n-H Don't create home directory\n-s SHELL Login shell\n-S Create a system user\n-u UID User id\n\n"
-#define HELP_traceroute "usage: traceroute [-46FUIldnvr] [-f 1ST_TTL] [-m MAXTTL] [-p PORT] [-q PROBES]\n[-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-g GATEWAY] [-i IFACE] [-z PAUSE_MSEC] HOST [BYTES]\n\ntraceroute6 [-dnrv] [-m MAXTTL] [-p PORT] [-q PROBES][-s SRC_IP] [-t TOS] [-w WAIT_SEC]\n [-i IFACE] HOST [BYTES]\n\nTrace the route to HOST\n\n-4,-6 Force IP or IPv6 name resolution\n-F Set the don't fragment bit (supports IPV4 only)\n-U Use UDP datagrams instead of ICMP ECHO (supports IPV4 only)\n-I Use ICMP ECHO instead of UDP datagrams (supports IPV4 only)\n-l Display the TTL value of the returned packet (supports IPV4 only)\n-d Set SO_DEBUG options to socket\n-n Print numeric addresses\n-v verbose\n-r Bypass routing tables, send directly to HOST\n-m Max time-to-live (max number of hops)(RANGE 1 to 255)\n-p Base UDP port number used in probes(default 33434)(RANGE 1 to 65535)\n-q Number of probes per TTL (default 3)(RANGE 1 to 255)\n-s IP address to use as the source address\n-t Type-of-service in probe packets (default 0)(RANGE 0 to 255)\n-w Time in seconds to wait for a response (default 3)(RANGE 0 to 86400)\n-g Loose source route gateway (8 max) (supports IPV4 only)\n-z Pause Time in ms (default 0)(RANGE 0 to 86400) (supports IPV4 only)\n-f Start from the 1ST_TTL hop (instead from 1)(RANGE 1 to 255) (supports IPV4 only)\n-i Specify a network interface to operate with"
+#define HELP_traceroute "usage: traceroute [-46FUIldnvr] [-f 1ST_TTL] [-m MAXTTL] [-p PORT] [-q PROBES]\n[-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-g GATEWAY] [-i IFACE] [-z PAUSE_MSEC] HOST [BYTES]\n\ntraceroute6 [-dnrv] [-m MAXTTL] [-p PORT] [-q PROBES][-s SRC_IP] [-t TOS] [-w WAIT_SEC]\n [-i IFACE] HOST [BYTES]\n\nTrace the route to HOST\n\n-4,-6 Force IP or IPv6 name resolution\n-F Set the don't fragment bit (supports IPV4 only)\n-U Use UDP datagrams instead of ICMP ECHO (supports IPV4 only)\n-I Use ICMP ECHO instead of UDP datagrams (supports IPV4 only)\n-l Display the TTL value of the returned packet (supports IPV4 only)\n-d Set SO_DEBUG options to socket\n-n Print numeric addresses\n-v verbose\n-r Bypass routing tables, send directly to HOST\n-m Max time-to-live (max number of hops)(RANGE 1 to 255)\n-p Base UDP port number used in probes(default 33434)(RANGE 1 to 65535)\n-q Number of probes per TTL (default 3)(RANGE 1 to 255)\n-s IP address to use as the source address\n-t Type-of-service in probe packets (default 0)(RANGE 0 to 255)\n-w Time in seconds to wait for a response (default 3)(RANGE 0 to 86400)\n-g Loose source route gateway (8 max) (supports IPV4 only)\n-z Pause Time in ms (default 0)(RANGE 0 to 86400) (supports IPV4 only)\n-f Start from the 1ST_TTL hop (instead from 1)(RANGE 1 to 255) (supports IPV4 only)\n-i Specify a network interface to operate with\n\n"
-#define HELP_tr "usage: tr [-cds] SET1 [SET2]\n\nTranslate, squeeze, or delete characters from stdin, writing to stdout\n\n-c/-C Take complement of SET1\n-d Delete input characters coded SET1\n-s Squeeze multiple output characters of SET2 into one character"
+#define HELP_tr "usage: tr [-cds] SET1 [SET2]\n\nTranslate, squeeze, or delete characters from stdin, writing to stdout\n\n-c/-C Take complement of SET1\n-d Delete input characters coded SET1\n-s Squeeze multiple output characters of SET2 into one character\n\n"
-#define HELP_tftpd "usage: tftpd [-cr] [-u USER] [DIR]\n\nTransfer file from/to tftp server.\n\n-r read only\n-c Allow file creation via upload\n-u run as USER\n-l Log to syslog (inetd mode requires this)"
+#define HELP_tftpd "usage: tftpd [-cr] [-u USER] [DIR]\n\nTransfer file from/to tftp server.\n\n-r read only\n-c Allow file creation via upload\n-u run as USER\n-l Log to syslog (inetd mode requires this)\n\n"
-#define HELP_tftp "usage: tftp [OPTIONS] HOST [PORT]\n\nTransfer file from/to tftp server.\n\n-l FILE Local FILE\n-r FILE Remote FILE\n-g Get file\n-p Put file\n-b SIZE Transfer blocks of SIZE octets(8 <= SIZE <= 65464)"
+#define HELP_tftp "usage: tftp [OPTIONS] HOST [PORT]\n\nTransfer file from/to tftp server.\n\n-l FILE Local FILE\n-r FILE Remote FILE\n-g Get file\n-p Put file\n-b SIZE Transfer blocks of SIZE octets(8 <= SIZE <= 65464)\n\n"
-#define HELP_telnetd "Handle incoming telnet connections\n\n-l LOGIN Exec LOGIN on connect\n-f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue\n-K Close connection as soon as login exits\n-p PORT Port to listen on\n-b ADDR[:PORT] Address to bind to\n-F Run in foreground\n-i Inetd mode\n-w SEC Inetd 'wait' mode, linger time SEC\n-S Log to syslog (implied by -i or without -F and -w)"
+#define HELP_telnetd "Handle incoming telnet connections\n\n-l LOGIN Exec LOGIN on connect\n-f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue\n-K Close connection as soon as login exits\n-p PORT Port to listen on\n-b ADDR[:PORT] Address to bind to\n-F Run in foreground\n-i Inetd mode\n-w SEC Inetd 'wait' mode, linger time SEC\n-S Log to syslog (implied by -i or without -F and -w)\n\n"
-#define HELP_telnet "usage: telnet HOST [PORT]\n\nConnect to telnet server"
+#define HELP_telnet "usage: telnet HOST [PORT]\n\nConnect to telnet server\n\n"
-#define HELP_tcpsvd "usage: tcpsvd [-hEv] [-c N] [-C N[:MSG]] [-b N] [-u User] [-l Name] IP Port Prog\nusage: udpsvd [-hEv] [-c N] [-u User] [-l Name] IP Port Prog\n\nCreate TCP/UDP socket, bind to IP:PORT and listen for incoming connection.\nRun PROG for each connection.\n\nIP IP to listen on, 0 = all\nPORT Port to listen on\nPROG ARGS Program to run\n-l NAME Local hostname (else looks up local hostname in DNS)\n-u USER[:GRP] Change to user/group after bind\n-c N Handle up to N (> 0) connections simultaneously\n-b N (TCP Only) Allow a backlog of approximately N TCP SYNs\n-C N[:MSG] (TCP Only) Allow only up to N (> 0) connections from the same IP\n New connections from this IP address are closed\n immediately. MSG is written to the peer before close\n-h Look up peer's hostname\n-E Don't set up environment variables\n-v Verbose"
+#define HELP_tcpsvd "usage: tcpsvd [-hEv] [-c N] [-C N[:MSG]] [-b N] [-u User] [-l Name] IP Port Prog\nusage: udpsvd [-hEv] [-c N] [-u User] [-l Name] IP Port Prog\n\nCreate TCP/UDP socket, bind to IP:PORT and listen for incoming connection.\nRun PROG for each connection.\n\nIP IP to listen on, 0 = all\nPORT Port to listen on\nPROG ARGS Program to run\n-l NAME Local hostname (else looks up local hostname in DNS)\n-u USER[:GRP] Change to user/group after bind\n-c N Handle up to N (> 0) connections simultaneously\n-b N (TCP Only) Allow a backlog of approximately N TCP SYNs\n-C N[:MSG] (TCP Only) Allow only up to N (> 0) connections from the same IP\n New connections from this IP address are closed\n immediately. MSG is written to the peer before close\n-h Look up peer's hostname\n-E Don't set up environment variables\n-v Verbose\n\n"
-#define HELP_syslogd "usage: syslogd [-a socket] [-O logfile] [-f config file] [-m interval]\n [-p socket] [-s SIZE] [-b N] [-R HOST] [-l N] [-nSLKD]\n\nSystem logging utility\n\n-a Extra unix socket for listen\n-O FILE Default log file <DEFAULT: /var/log/messages>\n-f FILE Config file <DEFAULT: /etc/syslog.conf>\n-p Alternative unix domain socket <DEFAULT : /dev/log>\n-n Avoid auto-backgrounding\n-S Smaller output\n-m MARK interval <DEFAULT: 20 minutes> (RANGE: 0 to 71582787)\n-R HOST Log to IP or hostname on PORT (default PORT=514/UDP)\"\n-L Log locally and via network (default is network only if -R)\"\n-s SIZE Max size (KB) before rotation (default:200KB, 0=off)\n-b N rotated logs to keep (default:1, max=99, 0=purge)\n-K Log to kernel printk buffer (use dmesg to read it)\n-l N Log only messages more urgent than prio(default:8 max:8 min:1)\n-D Drop duplicates"
+#define HELP_tar "usage: tar -[cxtjzhmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR]\n\nCreate, extract, or list files from a tar file\n\nOperation:\nc Create\nf Name of TARFILE ('-' for stdin/out)\nh Follow symlinks\nj (De)compress using bzip2\nm Don't restore mtime\nt List\nv Verbose\nx Extract\nz (De)compress using gzip\nC Change to DIR before operation\nO Extract to stdout\nexclude=FILE File to exclude\nX File with names to exclude\nT File with names to include\n\n"
-#define HELP_sulogin "usage: sulogin [-t time] [tty]\n\nSingle User Login.\n-t Default Time for Single User Login"
+#define HELP_syslogd "usage: syslogd [-a socket] [-O logfile] [-f config file] [-m interval]\n [-p socket] [-s SIZE] [-b N] [-R HOST] [-l N] [-nSLKD]\n\nSystem logging utility\n\n-a Extra unix socket for listen\n-O FILE Default log file <DEFAULT: /var/log/messages>\n-f FILE Config file <DEFAULT: /etc/syslog.conf>\n-p Alternative unix domain socket <DEFAULT : /dev/log>\n-n Avoid auto-backgrounding\n-S Smaller output\n-m MARK interval <DEFAULT: 20 minutes> (RANGE: 0 to 71582787)\n-R HOST Log to IP or hostname on PORT (default PORT=514/UDP)\"\n-L Log locally and via network (default is network only if -R)\"\n-s SIZE Max size (KB) before rotation (default:200KB, 0=off)\n-b N rotated logs to keep (default:1, max=99, 0=purge)\n-K Log to kernel printk buffer (use dmesg to read it)\n-l N Log only messages more urgent than prio(default:8 max:8 min:1)\n-D Drop duplicates\n\n"
-#define HELP_stty "usage: stty [-ag] [-F device] SETTING...\n\nGet/set terminal configuration.\n\n-F Open device instead of stdin\n-a Show all current settings (default differences from \"sane\")\n-g Show all current settings usable as input to stty\n\nSpecial characters (syntax ^c or undef): intr quit erase kill eof eol eol2\nswtch start stop susp rprnt werase lnext discard\n\nControl/input/output/local settings as shown by -a, '-' prefix to disable\n\nCombo settings: cooked/raw, evenp/oddp/parity, nl, ek, sane\n\nN set input and output speed (ispeed N or ospeed N for just one)\ncols N set number of columns\nrows N set number of rows\nline N set line discipline\nmin N set minimum chars per read\ntime N set read timeout\nspeed show speed only\nsize show size only"
+#define HELP_sulogin "usage: sulogin [-t time] [tty]\n\nSingle User Login.\n-t Default Time for Single User Login\n\n"
-#define HELP_exit "usage: exit [status]\n\nExit shell. If no return value supplied on command line, use value\nof most recent command, or 0 if none."
+#define HELP_stty "usage: stty [-ag] [-F device] SETTING...\n\nGet/set terminal configuration.\n\n-F Open device instead of stdin\n-a Show all current settings (default differences from \"sane\")\n-g Show all current settings usable as input to stty\n\nSpecial characters (syntax ^c or undef): intr quit erase kill eof eol eol2\nswtch start stop susp rprnt werase lnext discard\n\nControl/input/output/local settings as shown by -a, '-' prefix to disable\n\nCombo settings: cooked/raw, evenp/oddp/parity, nl, ek, sane\n\nN set input and output speed (ispeed N or ospeed N for just one)\ncols N set number of columns\nrows N set number of rows\nline N set line discipline\nmin N set minimum chars per read\ntime N set read timeout\nspeed show speed only\nsize show size only\n\n"
-#define HELP_cd "usage: cd [-PL] [path]\n\nChange current directory. With no arguments, go $HOME.\n\n-P Physical path: resolve symlinks in path\n-L Local path: .. trims directories off $PWD (default)"
+#define HELP_exit "usage: exit [status]\n\nExit shell. If no return value supplied on command line, use value\nof most recent command, or 0 if none.\n\n"
-#define HELP_sh "usage: sh [-c command] [script]\n\nCommand shell. Runs a shell script, or reads input interactively\nand responds to it.\n\n-c command line to execute\n-i interactive mode (default when STDIN is a tty)"
+#define HELP_cd "usage: cd [-PL] [path]\n\nChange current directory. With no arguments, go $HOME.\n\n-P Physical path: resolve symlinks in path\n-L Local path: .. trims directories off $PWD (default)\n\n"
-#define HELP_route "usage: route [-ne] [-A [46]] [add|del TARGET [OPTIONS]]\n\nDisplay, add or delete network routes in the \"Forwarding Information Base\".\n\n-n Show numerical addresses (no DNS lookups)\n-e display netstat fields\n\nRouting means sending packets out a network interface to an address.\nThe kernel can tell where to send packets one hop away by examining each\ninterface's address and netmask, so the most common use of this command\nis to identify a \"gateway\" that forwards other traffic.\n\nAssigning an address to an interface automatically creates an appropriate\nnetwork route (\"ifconfig eth0 10.0.2.15/8\" does \"route add 10.0.0.0/8 eth0\"\nfor you), although some devices (such as loopback) won't show it in the\ntable. For machines more than one hop away, you need to specify a gateway\n(ala \"route add default gw 10.0.2.2\").\n\nThe address \"default\" is a wildcard address (0.0.0.0/0) matching all\npackets without a more specific route.\n\nAvailable OPTIONS include:\nreject - blocking route (force match failure)\ndev NAME - force packets out this interface (ala \"eth0\")\nnetmask - old way of saying things like ADDR/24\ngw ADDR - forward packets to gateway ADDR"
+#define HELP_sh "usage: sh [-c command] [script]\n\nCommand shell. Runs a shell script, or reads input interactively\nand responds to it.\n\n-c command line to execute\n-i interactive mode (default when STDIN is a tty)\n\n"
-#define HELP_deallocvt "usage: deallocvt [N]\n\nDeallocate unused virtual terminal /dev/ttyN, or all unused consoles."
+#define HELP_route "usage: route [-ne] [-A [46]] [add|del TARGET [OPTIONS]]\n\nDisplay, add or delete network routes in the \"Forwarding Information Base\".\n\n-n Show numerical addresses (no DNS lookups)\n-e display netstat fields\n\nRouting means sending packets out a network interface to an address.\nThe kernel can tell where to send packets one hop away by examining each\ninterface's address and netmask, so the most common use of this command\nis to identify a \"gateway\" that forwards other traffic.\n\nAssigning an address to an interface automatically creates an appropriate\nnetwork route (\"ifconfig eth0 10.0.2.15/8\" does \"route add 10.0.0.0/8 eth0\"\nfor you), although some devices (such as loopback) won't show it in the\ntable. For machines more than one hop away, you need to specify a gateway\n(ala \"route add default gw 10.0.2.2\").\n\nThe address \"default\" is a wildcard address (0.0.0.0/0) matching all\npackets without a more specific route.\n\nAvailable OPTIONS include:\nreject - blocking route (force match failure)\ndev NAME - force packets out this interface (ala \"eth0\")\nnetmask - old way of saying things like ADDR/24\ngw ADDR - forward packets to gateway ADDR\n\n\n"
-#define HELP_openvt "usage: openvt [-c N] [-sw] [command [command_options]]\n\nstart a program on a new virtual terminal (VT)\n\n-c N Use VT N\n-s Switch to new VT\n-w Wait for command to exit\n\nif -sw used together, switch back to originating VT when command completes"
+#define HELP_deallocvt "usage: deallocvt [N]\n\nDeallocate unused virtual terminal /dev/ttyN, or all unused consoles.\n\n"
-#define HELP_more "usage: more [FILE...]\n\nView FILE(s) (or stdin) one screenfull at a time."
+#define HELP_openvt "usage: openvt [-c N] [-sw] [command [command_options]]\n\nstart a program on a new virtual terminal (VT)\n\n-c N Use VT N\n-s Switch to new VT\n-w Wait for command to exit\n\nif -sw used together, switch back to originating VT when command completes\n\n"
-#define HELP_modprobe "usage: modprobe [-alrqvsDb] [-d DIR] MODULE [symbol=value][...]\n\nmodprobe utility - inserts modules and dependencies.\n\n-a Load multiple MODULEs\n-d Load modules from DIR, option may be used multiple times\n-l List (MODULE is a pattern)\n-r Remove MODULE (stacks) or do autoclean\n-q Quiet\n-v Verbose\n-s Log to syslog\n-D Show dependencies\n-b Apply blacklist to module names too"
+#define HELP_more "usage: more [FILE...]\n\nView FILE(s) (or stdin) one screenfull at a time.\n\n"
-#define HELP_mke2fs_extended "usage: mke2fs [-E stride=###] [-O option[,option]]\n\n-E stride= Set RAID stripe size (in blocks)\n-O [opts] Specify fewer ext2 option flags (for old kernels)\n All of these are on by default (as appropriate)\n none Clear default options (all but journaling)\n dir_index Use htree indexes for large directories\n filetype Store file type info in directory entry\n has_journal Set by -j\n journal_dev Set by -J device=XXX\n sparse_super Don't allocate huge numbers of redundant superblocks"
+#define HELP_modprobe "usage: modprobe [-alrqvsDb] [-d DIR] MODULE [symbol=value][...]\n\nmodprobe utility - inserts modules and dependencies.\n\n-a Load multiple MODULEs\n-d Load modules from DIR, option may be used multiple times\n-l List (MODULE is a pattern)\n-r Remove MODULE (stacks) or do autoclean\n-q Quiet\n-v Verbose\n-s Log to syslog\n-D Show dependencies\n-b Apply blacklist to module names too\n\n"
-#define HELP_mke2fs_label "usage: mke2fs [-L label] [-M path] [-o string]\n\n-L Volume label\n-M Path to mount point\n-o Created by"
+#define HELP_mke2fs_extended "usage: mke2fs [-E stride=###] [-O option[,option]]\n\n-E stride= Set RAID stripe size (in blocks)\n-O [opts] Specify fewer ext2 option flags (for old kernels)\n All of these are on by default (as appropriate)\n none Clear default options (all but journaling)\n dir_index Use htree indexes for large directories\n filetype Store file type info in directory entry\n has_journal Set by -j\n journal_dev Set by -J device=XXX\n sparse_super Don't allocate huge numbers of redundant superblocks\n\n"
-#define HELP_mke2fs_gen "usage: gene2fs [options] device filename\n\nThe [options] are the same as mke2fs."
+#define HELP_mke2fs_label "usage: mke2fs [-L label] [-M path] [-o string]\n\n-L Volume label\n-M Path to mount point\n-o Created by\n\n"
-#define HELP_mke2fs_journal "usage: mke2fs [-j] [-J size=###,device=XXX]\n\n-j Create journal (ext3)\n-J Journal options\n size: Number of blocks (1024-102400)\n device: Specify an external journal"
+#define HELP_mke2fs_gen "usage: gene2fs [options] device filename\n\nThe [options] are the same as mke2fs.\n\n"
-#define HELP_mke2fs "usage: mke2fs [-Fnq] [-b ###] [-N|i ###] [-m ###] device\n\nCreate an ext2 filesystem on a block device or filesystem image.\n\n-F Force to run on a mounted device\n-n Don't write to device\n-q Quiet (no output)\n-b size Block size (1024, 2048, or 4096)\n-N inodes Allocate this many inodes\n-i bytes Allocate one inode for every XXX bytes of device\n-m percent Reserve this percent of filesystem space for root user"
+#define HELP_mke2fs_journal "usage: mke2fs [-j] [-J size=###,device=XXX]\n\n-j Create journal (ext3)\n-J Journal options\n size: Number of blocks (1024-102400)\n device: Specify an external journal\n\n"
-#define HELP_mdev_conf "The mdev config file (/etc/mdev.conf) contains lines that look like:\nhd[a-z][0-9]* 0:3 660\n(sd[a-z]) root:disk 660 =usb_storage\n\nEach line must contain three whitespace separated fields. The first\nfield is a regular expression matching one or more device names,\nthe second and third fields are uid:gid and file permissions for\nmatching devices. Fourth field is optional. It could be used to change\ndevice name (prefix '='), path (prefix '=' and postfix '/') or create a\nsymlink (prefix '>')."
+#define HELP_mke2fs "usage: mke2fs [-Fnq] [-b ###] [-N|i ###] [-m ###] device\n\nCreate an ext2 filesystem on a block device or filesystem image.\n\n-F Force to run on a mounted device\n-n Don't write to device\n-q Quiet (no output)\n-b size Block size (1024, 2048, or 4096)\n-N inodes Allocate this many inodes\n-i bytes Allocate one inode for every XXX bytes of device\n-m percent Reserve this percent of filesystem space for root user\n\n"
-#define HELP_mdev "usage: mdev [-s]\n\nCreate devices in /dev using information from /sys.\n\n-s Scan all entries in /sys to populate /dev"
+#define HELP_mdev_conf "The mdev config file (/etc/mdev.conf) contains lines that look like:\nhd[a-z][0-9]* 0:3 660\n(sd[a-z]) root:disk 660 =usb_storage\n\nEach line must contain three whitespace separated fields. The first\nfield is a regular expression matching one or more device names,\nthe second and third fields are uid:gid and file permissions for\nmatching devices. Fourth field is optional. It could be used to change\ndevice name (prefix '='), path (prefix '=' and postfix '/') or create a\nsymlink (prefix '>').\n\n"
-#define HELP_man "usage: man [-M PATH] [-k STRING] | [SECTION] COMMAND\n\nRead manual page for system command.\n\n-k List pages with STRING in their short description\n-M Override $MANPATH\n\nMan pages are divided into 8 sections:\n1 commands 2 system calls 3 library functions 4 /dev files\n5 file formats 6 games 7 miscellaneous 8 system management\n\nSections are searched in the order 1 8 3 2 5 4 6 7 unless you specify a\nsection. Each section has a page called \"intro\", and there's a global\nintroduction under \"man-pages\"."
+#define HELP_mdev "usage: mdev [-s]\n\nCreate devices in /dev using information from /sys.\n\n-s Scan all entries in /sys to populate /dev\n\n"
-#define HELP_lsof "usage: lsof [-lt] [-p PID1,PID2,...] [FILE...]\n\nList all open files belonging to all active processes, or processes using\nlisted FILE(s).\n\n-l list uids numerically\n-p for given comma-separated pids only (default all pids)\n-t terse (pid only) output"
+#define HELP_lsof "usage: lsof [-lt] [-p PID1,PID2,...] [FILE...]\n\nList all open files belonging to all active processes, or processes using\nlisted FILE(s).\n\n-l list uids numerically\n-p for given comma-separated pids only (default all pids)\n-t terse (pid only) output\n\n"
-#define HELP_last "usage: last [-W] [-f FILE]\n\nShow listing of last logged in users.\n\n-W Display the information without host-column truncation\n-f FILE Read from file FILE instead of /var/log/wtmp"
+#define HELP_last "usage: last [-W] [-f FILE]\n\nShow listing of last logged in users.\n\n-W Display the information without host-column truncation\n-f FILE Read from file FILE instead of /var/log/wtmp\n\n"
-#define HELP_klogd "usage: klogd [-n] [-c N]\n\n-c N Print to console messages more urgent than prio N (1-8)\"\n-n Run in foreground"
+#define HELP_klogd "usage: klogd [-n] [-c N]\n\n-c N Print to console messages more urgent than prio N (1-8)\"\n-n Run in foreground\n\n"
-#define HELP_ipcs "usage: ipcs [[-smq] -i shmid] | [[-asmq] [-tcplu]]\n\n-i Show specific resource\nResource specification:\n-a All (default)\n-m Shared memory segments\n-q Message queues\n-s Semaphore arrays\nOutput format:\n-c Creator\n-l Limits\n-p Pid\n-t Time\n-u Summary"
+#define HELP_ipcs "usage: ipcs [[-smq] -i shmid] | [[-asmq] [-tcplu]]\n\n-i Show specific resource\nResource specification:\n-a All (default)\n-m Shared memory segments\n-q Message queues\n-s Semaphore arrays\nOutput format:\n-c Creator\n-l Limits\n-p Pid\n-t Time\n-u Summary\n\n"
-#define HELP_ipcrm "usage: ipcrm [ [-q msqid] [-m shmid] [-s semid]\n [-Q msgkey] [-M shmkey] [-S semkey] ... ]\n\n-mM Remove memory segment after last detach\n-qQ Remove message queue\n-sS Remove semaphore"
+#define HELP_ipcrm "usage: ipcrm [ [-q msqid] [-m shmid] [-s semid]\n [-Q msgkey] [-M shmkey] [-S semkey] ... ]\n\n-mM Remove memory segment after last detach\n-qQ Remove message queue\n-sS Remove semaphore\n\n"
-#define HELP_ip "usage: ip [ OPTIONS ] OBJECT { COMMAND }\n\nShow / manipulate routing, devices, policy routing and tunnels.\n\nwhere OBJECT := {address | link | route | rule | tunnel}\nOPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }"
+#define HELP_ip "usage: ip [ OPTIONS ] OBJECT { COMMAND }\n\nShow / manipulate routing, devices, policy routing and tunnels.\n\nwhere OBJECT := {address | link | route | rule | tunnel}\nOPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }\n\n"
-#define HELP_init "usage: init\n\nSystem V style init.\n\nFirst program to run (as PID 1) when the system comes up, reading\n/etc/inittab to determine actions."
+#define HELP_init "usage: init\n\nSystem V style init.\n\nFirst program to run (as PID 1) when the system comes up, reading\n/etc/inittab to determine actions.\n\n"
-#define HELP_host "usage: host [-av] [-t TYPE] NAME [SERVER]\n\nPerform DNS lookup on NAME, which can be a domain name to lookup,\nor an IPv4 dotted or IPv6 colon-separated address to reverse lookup.\nSERVER (if present) is the DNS server to use.\n\n-a -v -t ANY\n-t TYPE query records of type TYPE\n-v verbose"
+#define HELP_host "usage: host [-av] [-t TYPE] NAME [SERVER]\n\nPerform DNS lookup on NAME, which can be a domain name to lookup,\nor an IPv4 dotted or IPv6 colon-separated address to reverse lookup.\nSERVER (if present) is the DNS server to use.\n\n-a no idea\n-t not a clue\n-v verbose\n\n"
-#define HELP_groupdel "usage: groupdel [USER] GROUP\n\nDelete a group or remove a user from a group"
+#define HELP_zcat "usage: zcat [FILE...]\n\nDecompress files to stdout. Like `gzip -dc`.\n\n-f Force: allow read from tty\n\n"
-#define HELP_groupadd "usage: groupadd [-S] [-g GID] [USER] GROUP\n\nAdd a group or add a user to a group\n\n -g GID Group id\n -S Create a system group"
+#define HELP_gunzip "usage: gunzip [-cfk] [FILE...]\n\nDecompress files. With no files, decompresses stdin to stdout.\nOn success, the input files are removed and replaced by new\nfiles without the .gz suffix.\n\n-c Output to stdout (act as zcat)\n-f Force: allow read from tty\n-k Keep input files (default is to remove)\n\n"
-#define HELP_getty "usage: getty [OPTIONS] BAUD_RATE[,BAUD_RATE]... TTY [TERMTYPE]\n\n-h Enable hardware RTS/CTS flow control\n-L Set CLOCAL (ignore Carrier Detect state)\n-m Get baud rate from modem's CONNECT status message\n-n Don't prompt for login name\n-w Wait for CR or LF before sending /etc/issue\n-i Don't display /etc/issue\n-f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue\n-l LOGIN Invoke LOGIN instead of /bin/login\n-t SEC Terminate after SEC if no login name is read\n-I INITSTR Send INITSTR before anything else\n-H HOST Log HOST into the utmp file as the hostname"
+#define HELP_gzip "usage: gzip [-19cdfk] [FILE...]\n\nCompress files. With no files, compresses stdin to stdout.\nOn success, the input files are removed and replaced by new\nfiles with the .gz suffix.\n\n-c Output to stdout\n-d Decompress (act as gunzip)\n-f Force: allow overwrite of output file\n-k Keep input files (default is to remove)\n-# Compression level 1-9 (1:fastest, 6:default, 9:best)\n\n"
-#define HELP_getfattr "usage: getfattr [-d] [-h] [-n NAME] FILE...\n\nRead POSIX extended attributes.\n\n-d Show values as well as names\n-h Do not dereference symbolic links\n-n Show only attributes with the given name\n--only-values Don't show names"
+#define HELP_groupdel "usage: groupdel [USER] GROUP\n\nDelete a group or remove a user from a group\n\n"
-#define HELP_fsck "usage: fsck [-ANPRTV] [-C FD] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]...\n\nCheck and repair filesystems\n\n-A Walk /etc/fstab and check all filesystems\n-N Don't execute, just show what would be done\n-P With -A, check filesystems in parallel\n-R With -A, skip the root filesystem\n-T Don't show title on startup\n-V Verbose\n-C n Write status information to specified file descriptor\n-t TYPE List of filesystem types to check"
+#define HELP_groupadd "usage: groupadd [-S] [-g GID] [USER] GROUP\n\nAdd a group or add a user to a group\n\n -g GID Group id\n -S Create a system group\n\n"
-#define HELP_fold "usage: fold [-bsu] [-w WIDTH] [FILE...]\n\nFolds (wraps) or unfolds ascii text by adding or removing newlines.\nDefault line width is 80 columns for folding and infinite for unfolding.\n\n-b Fold based on bytes instead of columns\n-s Fold/unfold at whitespace boundaries if possible\n-u Unfold text (and refold if -w is given)\n-w Set lines to WIDTH columns or bytes"
+#define HELP_getty "usage: getty [OPTIONS] BAUD_RATE[,BAUD_RATE]... TTY [TERMTYPE]\n\n-h Enable hardware RTS/CTS flow control\n-L Set CLOCAL (ignore Carrier Detect state)\n-m Get baud rate from modem's CONNECT status message\n-n Don't prompt for login name\n-w Wait for CR or LF before sending /etc/issue\n-i Don't display /etc/issue\n-f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue\n-l LOGIN Invoke LOGIN instead of /bin/login\n-t SEC Terminate after SEC if no login name is read\n-I INITSTR Send INITSTR before anything else\n-H HOST Log HOST into the utmp file as the hostname\n\n"
-#define HELP_fdisk "usage: fdisk [-lu] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SECTSZ] DISK\n\nChange partition table\n\n-u Start and End are in sectors (instead of cylinders)\n-l Show partition table for each DISK, then exit\n-b size sector size (512, 1024, 2048 or 4096)\n-C CYLINDERS Set number of cylinders/heads/sectors\n-H HEADS\n-S SECTORS"
+#define HELP_getfattr "usage: getfattr [-d] [-h] [-n NAME] FILE...\n\nRead POSIX extended attributes.\n\n-d Show values as well as names\n-h Do not dereference symbolic links\n-n Show only attributes with the given name\n--only-values Don't show names\n\n"
-#define HELP_expr "usage: expr ARG1 OPERATOR ARG2...\n\nEvaluate expression and print result. For example, \"expr 1 + 2\".\n\nThe supported operators are (grouped from highest to lowest priority):\n\n ( ) : * / % + - != <= < >= > = & |\n\nEach constant and operator must be a separate command line argument.\nAll operators are infix, meaning they expect a constant (or expression\nthat resolves to a constant) on each side of the operator. Operators of\nthe same priority (within each group above) are evaluated left to right.\nParentheses may be used (as separate arguments) to elevate the priority\nof expressions.\n\nCalling expr from a command shell requires a lot of \\( or '*' escaping\nto avoid interpreting shell control characters.\n\nThe & and | operators are logical (not bitwise) and may operate on\nstrings (a blank string is \"false\"). Comparison operators may also\noperate on strings (alphabetical sort).\n\nConstants may be strings or integers. Comparison, logical, and regex\noperators may operate on strings (a blank string is \"false\"), other\noperators require integers."
+#define HELP_fsck "usage: fsck [-ANPRTV] [-C FD] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]...\n\nCheck and repair filesystems\n\n-A Walk /etc/fstab and check all filesystems\n-N Don't execute, just show what would be done\n-P With -A, check filesystems in parallel\n-R With -A, skip the root filesystem\n-T Don't show title on startup\n-V Verbose\n-C n Write status information to specified file descriptor\n-t TYPE List of filesystem types to check\n\n\n"
-#define HELP_dumpleases "usage: dumpleases [-r|-a] [-f LEASEFILE]\n\nDisplay DHCP leases granted by udhcpd\n-f FILE, Lease file\n-r Show remaining time\n-a Show expiration time"
+#define HELP_fold "usage: fold [-bsu] [-w WIDTH] [FILE...]\n\nFolds (wraps) or unfolds ascii text by adding or removing newlines.\nDefault line width is 80 columns for folding and infinite for unfolding.\n\n-b Fold based on bytes instead of columns\n-s Fold/unfold at whitespace boundaries if possible\n-u Unfold text (and refold if -w is given)\n-w Set lines to WIDTH columns or bytes\n\n"
-#define HELP_diff "usage: diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2\n\n-a Treat all files as text\n-b Ignore changes in the amount of whitespace\n-B Ignore changes whose lines are all blank\n-d Try hard to find a smaller set of changes\n-i Ignore case differences\n-L Use LABEL instead of the filename in the unified header\n-N Treat absent files as empty\n-q Output only whether files differ\n-r Recurse\n-S Start with FILE when comparing directories\n-T Make tabs line up by prefixing a tab when necessary\n-s Report when two files are the same\n-t Expand tabs to spaces in output\n-u Unified diff\n-U Output LINES lines of context\n-w Ignore all whitespace\n\n--color Colored output\n--strip-trailing-cr Strip trailing '\\r's from input lines"
+#define HELP_fdisk "usage: fdisk [-lu] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SECTSZ] DISK\n\nChange partition table\n\n-u Start and End are in sectors (instead of cylinders)\n-l Show partition table for each DISK, then exit\n-b size sector size (512, 1024, 2048 or 4096)\n-C CYLINDERS Set number of cylinders/heads/sectors\n-H HEADS\n-S SECTORS\n\n"
-#define HELP_dhcpd "usage: dhcpd [-46fS] [-i IFACE] [-P N] [CONFFILE]\n\n -f Run in foreground\n -i Interface to use\n -S Log to syslog too\n -P N Use port N (default ipv4 67, ipv6 547)\n -4, -6 Run as a DHCPv4 or DHCPv6 server"
+#define HELP_expr "usage: expr ARG1 OPERATOR ARG2...\n\nEvaluate expression and print result. For example, \"expr 1 + 2\".\n\nThe supported operators are (grouped from highest to lowest priority):\n\n ( ) : * / % + - != <= < >= > = & |\n\nEach constant and operator must be a separate command line argument.\nAll operators are infix, meaning they expect a constant (or expression\nthat resolves to a constant) on each side of the operator. Operators of\nthe same priority (within each group above) are evaluated left to right.\nParentheses may be used (as separate arguments) to elevate the priority\nof expressions.\n\nCalling expr from a command shell requires a lot of \\( or '*' escaping\nto avoid interpreting shell control characters.\n\nThe & and | operators are logical (not bitwise) and may operate on\nstrings (a blank string is \"false\"). Comparison operators may also\noperate on strings (alphabetical sort).\n\nConstants may be strings or integers. Comparison, logical, and regex\noperators may operate on strings (a blank string is \"false\"), other\noperators require integers.\n\n"
-#define HELP_dhcp6 "usage: dhcp6 [-fbnqvR] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]\n\n Configure network dynamically using DHCP.\n\n -i Interface to use (default eth0)\n -p Create pidfile\n -s Run PROG at DHCP events\n -t Send up to N Solicit packets\n -T Pause between packets (default 3 seconds)\n -A Wait N seconds after failure (default 20)\n -f Run in foreground\n -b Background if lease is not obtained\n -n Exit if lease is not obtained\n -q Exit after obtaining lease\n -R Release IP on exit\n -S Log to syslog too\n -r Request this IP address\n -v Verbose\n\n Signals:\n USR1 Renew current lease\n USR2 Release current lease"
+#define HELP_dumpleases "usage: dumpleases [-r|-a] [-f LEASEFILE]\n\nDisplay DHCP leases granted by udhcpd\n-f FILE, Lease file\n-r Show remaining time\n-a Show expiration time\n\n"
-#define HELP_dhcp "usage: dhcp [-fbnqvoCRB] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]\n [-H HOSTNAME] [-V VENDOR] [-x OPT:VAL] [-O OPT]\n\n Configure network dynamically using DHCP.\n\n -i Interface to use (default eth0)\n -p Create pidfile\n -s Run PROG at DHCP events (default /usr/share/dhcp/default.script)\n -B Request broadcast replies\n -t Send up to N discover packets\n -T Pause between packets (default 3 seconds)\n -A Wait N seconds after failure (default 20)\n -f Run in foreground\n -b Background if lease is not obtained\n -n Exit if lease is not obtained\n -q Exit after obtaining lease\n -R Release IP on exit\n -S Log to syslog too\n -a Use arping to validate offered address\n -O Request option OPT from server (cumulative)\n -o Don't request any options (unless -O is given)\n -r Request this IP address\n -x OPT:VAL Include option OPT in sent packets (cumulative)\n -F Ask server to update DNS mapping for NAME\n -H Send NAME as client hostname (default none)\n -V VENDOR Vendor identifier (default 'toybox VERSION')\n -C Don't send MAC as client identifier\n -v Verbose\n\n Signals:\n USR1 Renew current lease\n USR2 Release current lease"
+#define HELP_diff "usage: diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2\n\n-a Treat all files as text\n-b Ignore changes in the amount of whitespace\n-B Ignore changes whose lines are all blank\n-d Try hard to find a smaller set of changes\n-i Ignore case differences\n-L Use LABEL instead of the filename in the unified header\n-N Treat absent files as empty\n-q Output only whether files differ\n-r Recurse\n-S Start with FILE when comparing directories\n-T Make tabs line up by prefixing a tab when necessary\n-s Report when two files are the same\n-t Expand tabs to spaces in output\n-U Output LINES lines of context\n-w Ignore all whitespace\n\n--color Colored output\n\n"
-#define HELP_dd "usage: dd [if=FILE] [of=FILE] [ibs=N] [obs=N] [iflag=FLAGS] [oflag=FLAGS]\n [bs=N] [count=N] [seek=N] [skip=N]\n [conv=notrunc|noerror|sync|fsync] [status=noxfer|none]\n\nCopy/convert files.\n\nif=FILE Read from FILE instead of stdin\nof=FILE Write to FILE instead of stdout\nbs=N Read and write N bytes at a time\nibs=N Input block size\nobs=N Output block size\ncount=N Copy only N input blocks\nskip=N Skip N input blocks\nseek=N Skip N output blocks\niflag=FLAGS Set input flags\noflag=FLAGS Set output flags\nconv=notrunc Don't truncate output file\nconv=noerror Continue after read errors\nconv=sync Pad blocks with zeros\nconv=fsync Physically write data out before finishing\nstatus=noxfer Don't show transfer rate\nstatus=none Don't show transfer rate or records in/out\n\nFLAGS is a comma-separated list of:\n\ncount_bytes (iflag) interpret count=N in bytes, not blocks\nseek_bytes (oflag) interpret seek=N in bytes, not blocks\nskip_bytes (iflag) interpret skip=N in bytes, not blocks\n\nNumbers may be suffixed by c (*1), w (*2), b (*512), kD (*1000), k (*1024),\nMD (*1000*1000), M (*1024*1024), GD (*1000*1000*1000) or G (*1024*1024*1024)."
+#define HELP_dhcpd "usage: dhcpd [-46fS] [-i IFACE] [-P N] [CONFFILE]\n\n -f Run in foreground\n -i Interface to use\n -S Log to syslog too\n -P N Use port N (default ipv4 67, ipv6 547)\n -4, -6 Run as a DHCPv4 or DHCPv6 server\n\n"
-#define HELP_crontab "usage: crontab [-u user] FILE\n [-u user] [-e | -l | -r]\n [-c dir]\n\nFiles used to schedule the execution of programs.\n\n-c crontab dir\n-e edit user's crontab\n-l list user's crontab\n-r delete user's crontab\n-u user\nFILE Replace crontab by FILE ('-': stdin)"
+#define HELP_dhcp6 "usage: dhcp6 [-fbnqvR] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]\n\n Configure network dynamically using DHCP.\n\n -i Interface to use (default eth0)\n -p Create pidfile\n -s Run PROG at DHCP events\n -t Send up to N Solicit packets\n -T Pause between packets (default 3 seconds)\n -A Wait N seconds after failure (default 20)\n -f Run in foreground\n -b Background if lease is not obtained\n -n Exit if lease is not obtained\n -q Exit after obtaining lease\n -R Release IP on exit\n -S Log to syslog too\n -r Request this IP address\n -v Verbose\n\n Signals:\n USR1 Renew current lease\n USR2 Release current lease\n\n"
-#define HELP_crond "usage: crond [-fbS] [-l N] [-d N] [-L LOGFILE] [-c DIR]\n\nA daemon to execute scheduled commands.\n\n-b Background (default)\n-c crontab dir\n-d Set log level, log to stderr\n-f Foreground\n-l Set log level. 0 is the most verbose, default 8\n-S Log to syslog (default)\n-L Log to file"
+#define HELP_dhcp "usage: dhcp [-fbnqvoCRB] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]\n [-H HOSTNAME] [-V VENDOR] [-x OPT:VAL] [-O OPT]\n\n Configure network dynamically using DHCP.\n\n -i Interface to use (default eth0)\n -p Create pidfile\n -s Run PROG at DHCP events (default /usr/share/dhcp/default.script)\n -B Request broadcast replies\n -t Send up to N discover packets\n -T Pause between packets (default 3 seconds)\n -A Wait N seconds after failure (default 20)\n -f Run in foreground\n -b Background if lease is not obtained\n -n Exit if lease is not obtained\n -q Exit after obtaining lease\n -R Release IP on exit\n -S Log to syslog too\n -a Use arping to validate offered address\n -O Request option OPT from server (cumulative)\n -o Don't request any options (unless -O is given)\n -r Request this IP address\n -x OPT:VAL Include option OPT in sent packets (cumulative)\n -F Ask server to update DNS mapping for NAME\n -H Send NAME as client hostname (default none)\n -V VENDOR Vendor identifier (default 'toybox VERSION')\n -C Don't send MAC as client identifier\n -v Verbose\n\n Signals:\n USR1 Renew current lease\n USR2 Release current lease\n\n\n"
-#define HELP_brctl "usage: brctl COMMAND [BRIDGE [INTERFACE]]\n\nManage ethernet bridges\n\nCommands:\nshow Show a list of bridges\naddbr BRIDGE Create BRIDGE\ndelbr BRIDGE Delete BRIDGE\naddif BRIDGE IFACE Add IFACE to BRIDGE\ndelif BRIDGE IFACE Delete IFACE from BRIDGE\nsetageing BRIDGE TIME Set ageing time\nsetfd BRIDGE TIME Set bridge forward delay\nsethello BRIDGE TIME Set hello time\nsetmaxage BRIDGE TIME Set max message age\nsetpathcost BRIDGE PORT COST Set path cost\nsetportprio BRIDGE PORT PRIO Set port priority\nsetbridgeprio BRIDGE PRIO Set bridge priority\nstp BRIDGE [1/yes/on|0/no/off] STP on/off"
+#define HELP_dd "usage: dd [if=FILE] [of=FILE] [ibs=N] [obs=N] [bs=N] [count=N] [skip=N]\n [seek=N] [conv=notrunc|noerror|sync|fsync] [status=noxfer|none]\n\nCopy/convert files.\n\nif=FILE Read from FILE instead of stdin\nof=FILE Write to FILE instead of stdout\nbs=N Read and write N bytes at a time\nibs=N Read N bytes at a time\nobs=N Write N bytes at a time\ncount=N Copy only N input blocks\nskip=N Skip N input blocks\nseek=N Skip N output blocks\nconv=notrunc Don't truncate output file\nconv=noerror Continue after read errors\nconv=sync Pad blocks with zeros\nconv=fsync Physically write data out before finishing\nstatus=noxfer Don't show transfer rate\nstatus=none Don't show transfer rate or records in/out\n\nNumbers may be suffixed by c (*1), w (*2), b (*512), kD (*1000), k (*1024),\nMD (*1000*1000), M (*1024*1024), GD (*1000*1000*1000) or G (*1024*1024*1024).\n\n"
-#define HELP_bootchartd "usage: bootchartd {start [PROG ARGS]}|stop|init\n\nCreate /var/log/bootlog.tgz with boot chart data\n\nstart: start background logging; with PROG, run PROG,\n then kill logging with USR1\nstop: send USR1 to all bootchartd processes\ninit: start background logging; stop when getty/xdm is seen\n (for init scripts)\n\nUnder PID 1: as init, then exec $bootchart_init, /init, /sbin/init"
+#define HELP_crontab "usage: crontab [-u user] FILE\n [-u user] [-e | -l | -r]\n [-c dir]\n\nFiles used to schedule the execution of programs.\n\n-c crontab dir\n-e edit user's crontab\n-l list user's crontab\n-r delete user's crontab\n-u user\nFILE Replace crontab by FILE ('-': stdin)\n\n"
-#define HELP_bc "usage: bc [-ilqsw] [file ...]\n\nbc is a command-line calculator with a Turing-complete language.\n\noptions:\n\n -i --interactive force interactive mode\n -l --mathlib use predefined math routines:\n\n s(expr) = sine of expr in radians\n c(expr) = cosine of expr in radians\n a(expr) = arctangent of expr, returning radians\n l(expr) = natural log of expr\n e(expr) = raises e to the power of expr\n j(n, x) = Bessel function of integer order n of x\n\n -q --quiet don't print version and copyright\n -s --standard error if any non-POSIX extensions are used\n -w --warn warn if any non-POSIX extensions are used"
+#define HELP_crond "usage: crond [-fbS] [-l N] [-d N] [-L LOGFILE] [-c DIR]\n\nA daemon to execute scheduled commands.\n\n-b Background (default)\n-c crontab dir\n-d Set log level, log to stderr\n-f Foreground\n-l Set log level. 0 is the most verbose, default 8\n-S Log to syslog (default)\n-L Log to file\n\n"
-#define HELP_arping "usage: arping [-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP\n\nSend ARP requests/replies\n\n-f Quit on first ARP reply\n-q Quiet\n-b Keep broadcasting, don't go unicast\n-D Duplicated address detection mode\n-U Unsolicited ARP mode, update your neighbors\n-A ARP answer mode, update your neighbors\n-c N Stop after sending N ARP requests\n-w TIMEOUT Time to wait for ARP reply, seconds\n-I IFACE Interface to use (default eth0)\n-s SRC_IP Sender IP address\nDST_IP Target IP address"
+#define HELP_brctl "usage: brctl COMMAND [BRIDGE [INTERFACE]]\n\nManage ethernet bridges\n\nCommands:\nshow Show a list of bridges\naddbr BRIDGE Create BRIDGE\ndelbr BRIDGE Delete BRIDGE\naddif BRIDGE IFACE Add IFACE to BRIDGE\ndelif BRIDGE IFACE Delete IFACE from BRIDGE\nsetageing BRIDGE TIME Set ageing time\nsetfd BRIDGE TIME Set bridge forward delay\nsethello BRIDGE TIME Set hello time\nsetmaxage BRIDGE TIME Set max message age\nsetpathcost BRIDGE PORT COST Set path cost\nsetportprio BRIDGE PORT PRIO Set port priority\nsetbridgeprio BRIDGE PRIO Set bridge priority\nstp BRIDGE [1/yes/on|0/no/off] STP on/off\n\n"
-#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_bootchartd "usage: bootchartd {start [PROG ARGS]}|stop|init\n\nCreate /var/log/bootlog.tgz with boot chart data\n\nstart: start background logging; with PROG, run PROG,\n then kill logging with USR1\nstop: send USR1 to all bootchartd processes\ninit: start background logging; stop when getty/xdm is seen\n (for init scripts)\n\nUnder PID 1: as init, then exec $bootchart_init, /init, /sbin/init\n\n"
-#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_bc "usage: bc [-ilqsw] [file ...]\n\nbc is a command-line calculator with a Turing-complete language.\n\noptions:\n\n -i --interactive force interactive mode\n -l --mathlib use predefined math routines:\n\n s(expr) = sine of expr in radians\n c(expr) = cosine of expr in radians\n a(expr) = arctangent of expr, returning radians\n l(expr) = natural log of expr\n e(expr) = raises e to the power of expr\n j(n, x) = Bessel function of integer order n of x\n\n -q --quiet don't print version and copyright\n -s --standard error if any non-POSIX extensions are used\n -w --warn warn if any non-POSIX extensions are used\n\n\n"
-#define HELP_who "usage: who\n\nPrint information about logged in users."
+#define HELP_arping "usage: arping [-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP\n\nSend ARP requests/replies\n\n-f Quit on first ARP reply\n-q Quiet\n-b Keep broadcasting, don't go unicast\n-D Duplicated address detection mode\n-U Unsolicited ARP mode, update your neighbors\n-A ARP answer mode, update your neighbors\n-c N Stop after sending N ARP requests\n-w TIMEOUT Time to wait for ARP reply, seconds\n-I IFACE Interface to use (default eth0)\n-s SRC_IP Sender IP address\nDST_IP Target IP address\n\n"
-#define HELP_wc "usage: wc -lwcm [FILE...]\n\nCount lines, words, and characters in input.\n\n-l Show lines\n-w Show words\n-c Show bytes\n-m Show characters\n\nBy default outputs lines, words, bytes, and filename for each\nargument (or from stdin if none). Displays only either bytes\nor characters."
+#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\n\n\n"
-#define HELP_uuencode "usage: uuencode [-m] [file] encode-filename\n\nUuencode stdin (or file) to stdout, with encode-filename in the output.\n\n-m Base64"
+#define HELP_xargs_pedantic "This version supports insane posix whitespace handling rendered obsolete\nby -0 mode.\n\n\n"
-#define HELP_uudecode "usage: uudecode [-o OUTFILE] [INFILE]\n\nDecode file from stdin (or INFILE).\n\n-o Write to OUTFILE instead of filename in header"
+#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-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\n\n"
-#define HELP_unlink "usage: unlink FILE\n\nDelete one file."
+#define HELP_who "usage: who\n\nPrint information about logged in users.\n\n"
-#define HELP_uniq "usage: uniq [-cduiz] [-w maxchars] [-f fields] [-s char] [input_file [output_file]]\n\nReport or filter out repeated lines in a file\n\n-c Show counts before each line\n-d Show only lines that are repeated\n-u Show only lines that are unique\n-i Ignore case when comparing lines\n-z Lines end with \\0 not \\n\n-w Compare maximum X chars per line\n-f Ignore first X fields\n-s Ignore first X chars"
+#define HELP_wc "usage: wc -lwcm [FILE...]\n\nCount lines, words, and characters in input.\n\n-l Show lines\n-w Show words\n-c Show bytes\n-m Show characters\n\nBy default outputs lines, words, bytes, and filename for each\nargument (or from stdin if none). Displays only either bytes\nor characters.\n\n"
-#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_uuencode "usage: uuencode [-m] [file] encode-filename\n\nUuencode stdin (or file) to stdout, with encode-filename in the output.\n\n-m Base64\n\n"
-#define HELP_arch "usage: arch\n\nPrint machine (hardware) name, same as uname -m."
+#define HELP_uudecode "usage: uudecode [-o OUTFILE] [INFILE]\n\nDecode file from stdin (or INFILE).\n\n-o Write to OUTFILE instead of filename in header\n\n"
-#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_unlink "usage: unlink FILE\n\nDelete one file.\n\n"
-#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"
+#define HELP_uniq "usage: uniq [-cduiz] [-w maxchars] [-f fields] [-s char] [input_file [output_file]]\n\nReport or filter out repeated lines in a file\n\n-c Show counts before each line\n-d Show only lines that are repeated\n-u Show only lines that are unique\n-i Ignore case when comparing lines\n-z Lines end with \\0 not \\n\n-w Compare maximum X chars per line\n-f Ignore first X fields\n-s Ignore first X chars\n\n"
-#define HELP_true "Return zero."
+#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\n\n"
-#define HELP_touch "usage: touch [-amch] [-d DATE] [-t TIME] [-r FILE] FILE...\n\nUpdate the access and modification times of each FILE to the current time.\n\n-a Change access time\n-m Change modification time\n-c Don't create file\n-h Change symlink\n-d Set time to DATE (in YYYY-MM-DDThh:mm:SS[.frac][tz] format)\n-t Set time to TIME (in [[CC]YY]MMDDhhmm[.ss][frac] format)\n-r Set time same as reference FILE"
+#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)\n\n"
-#define HELP_time "usage: time [-pv] COMMAND [ARGS...]\n\nRun command line and report real, user, and system time elapsed in seconds.\n(real = clock on the wall, user = cpu used by command's code,\nsystem = cpu used by OS on behalf of command.)\n\n-p POSIX format output (default)\n-v Verbose"
+#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\n\n"
-#define HELP_test "usage: test [-bcdefghLPrSsuwx PATH] [-nz STRING] [-t FD] [X ?? Y]\n\nReturn true or false by performing tests. (With no arguments return false.)\n\n--- Tests with a single argument (after the option):\nPATH is/has:\n -b block device -f regular file -p fifo -u setuid bit\n -c char device -g setgid -r read bit -w write bit\n -d directory -h symlink -S socket -x execute bit\n -e exists -L symlink -s nonzero size\nSTRING is:\n -n nonzero size -z zero size (STRING by itself implies -n)\nFD (integer file descriptor) is:\n -t a TTY\n\n--- Tests with one argument on each side of an operator:\nTwo strings:\n = are identical != differ\nTwo integers:\n -eq equal -gt first > second -lt first < second\n -ne not equal -ge first >= second -le first <= second\n\n--- Modify or combine tests:\n ! EXPR not (swap true/false) EXPR -a EXPR and (are both true)\n ( EXPR ) evaluate this first EXPR -o EXPR or (is either true)"
+#define HELP_true "Return zero.\n\n"
-#define HELP_tee "usage: tee [-ai] [file...]\n\nCopy stdin to each listed file, and also to stdout.\nFilename \"-\" is a synonym for stdout.\n\n-a Append to files\n-i Ignore SIGINT"
+#define HELP_touch "usage: touch [-amch] [-d DATE] [-t TIME] [-r FILE] FILE...\n\nUpdate the access and modification times of each FILE to the current time.\n\n-a Change access time\n-m Change modification time\n-c Don't create file\n-h Change symlink\n-d Set time to DATE (in YYYY-MM-DDThh:mm:SS[.frac][tz] format)\n-t Set time to TIME (in [[CC]YY]MMDDhhmm[.ss][frac] format)\n-r Set time same as reference FILE\n\n"
-#define HELP_tar "usage: tar [-cxt] [-fvohmjkOS] [-XTCf NAME] [FILES]\n\nCreate, extract, or list files in a .tar (or compressed t?z) file.\n\nOptions:\nc Create x Extract t Test (list)\nf tar FILE (default -) C Change to DIR first v Verbose display\no Ignore owner h Follow symlinks m Ignore mtime\nJ xz compression j bzip2 compression z gzip compression\nO Extract to stdout X exclude names in FILE T include names in FILE\n\n--exclude FILENAME to exclude --full-time Show seconds with -tv\n--mode MODE Adjust modes --mtime TIME Override timestamps\n--owner NAME Set file owner to NAME --group NAME Set file group to NAME\n--sparse Record sparse files\n--restrict All archive contents must extract under one subdirctory\n--numeric-owner Save/use/display uid and gid, not user/group name\n--no-recursion Don't store directory contents"
+#define HELP_time "usage: time [-pv] COMMAND [ARGS...]\n\nRun command line and report real, user, and system time elapsed in seconds.\n(real = clock on the wall, user = cpu used by command's code,\nsystem = cpu used by OS on behalf of command.)\n\n-p POSIX format output (default)\n-v Verbose\n\n"
-#define HELP_tail "usage: tail [-n|c NUMBER] [-f] [FILE...]\n\nCopy last lines from files to stdout. If no files listed, copy from\nstdin. Filename \"-\" is a synonym for stdin.\n\n-n Output the last NUMBER lines (default 10), +X counts from start\n-c Output the last NUMBER bytes, +NUMBER counts from start\n-f Follow FILE(s), waiting for more data to be appended"
+#define HELP_test "usage: test [-bcdefghLPrSsuwx PATH] [-nz STRING] [-t FD] [X ?? Y]\n\nReturn true or false by performing tests. (With no arguments return false.)\n\n--- Tests with a single argument (after the option):\nPATH is/has:\n -b block device -f regular file -p fifo -u setuid bit\n -c char device -g setgid -r read bit -w write bit\n -d directory -h symlink -S socket -x execute bit\n -e exists -L symlink -s nonzero size\nSTRING is:\n -n nonzero size -z zero size (STRING by itself implies -n)\nFD (integer file descriptor) is:\n -t a TTY\n\n--- Tests with one argument on each side of an operator:\nTwo strings:\n = are identical != differ\nTwo integers:\n -eq equal -gt first > second -lt first < second\n -ne not equal -ge first >= second -le first <= second\n\n--- Modify or combine tests:\n ! EXPR not (swap true/false) EXPR -a EXPR and (are both true)\n ( EXPR ) evaluate this first EXPR -o EXPR or (is either true)\n\n"
-#define HELP_strings "usage: strings [-fo] [-t oxd] [-n LEN] [FILE...]\n\nDisplay printable strings in a binary file\n\n-f Show filename\n-n At least LEN characters form a string (default 4)\n-o Show offset (ala -t d)\n-t Show offset type (o=octal, d=decimal, x=hexadecimal)"
+#define HELP_tee "usage: tee [-ai] [file...]\n\nCopy stdin to each listed file, and also to stdout.\nFilename \"-\" is a synonym for stdout.\n\n-a Append to files\n-i Ignore SIGINT\n\n"
-#define HELP_split "usage: split [-a SUFFIX_LEN] [-b BYTES] [-l LINES] [INPUT [OUTPUT]]\n\nCopy INPUT (or stdin) data to a series of OUTPUT (or \"x\") files with\nalphabetically increasing suffix (aa, ab, ac... az, ba, bb...).\n\n-a Suffix length (default 2)\n-b BYTES/file (10, 10k, 10m, 10g...)\n-l LINES/file (default 1000)"
+#define HELP_tail_seek "This version uses lseek, which is faster on large files.\n\n"
-#define HELP_sort "usage: sort [-Mbcdfginrsuz] [FILE...] [-k#[,#[x]] [-t X]] [-o FILE]\n\nSort all lines of text from input files (or stdin) to stdout.\n-M Month sort (jan, feb, etc)\n-V Version numbers (name-1.234-rc6.5b.tgz)\n-b Ignore leading blanks (or trailing blanks in second part of key)\n-c Check whether input is sorted\n-d Dictionary order (use alphanumeric and whitespace chars only)\n-f Force uppercase (case insensitive sort)\n-g General numeric sort (double precision with nan and inf)\n-i Ignore nonprinting characters\n-k Sort by \"key\" (see below)\n-n Numeric order (instead of alphabetical)\n-o Output to FILE instead of stdout\n-r Reverse\n-s Skip fallback sort (only sort with keys)\n-t Use a key separator other than whitespace\n-u Unique lines only\n-x Hexadecimal numerical sort\n-z Zero (null) terminated lines\n\nSorting by key looks at a subset of the words on each line. -k2 uses the\nsecond word to the end of the line, -k2,2 looks at only the second word,\n-k2,4 looks from the start of the second to the end of the fourth word.\n-k2.4,5 starts from the fourth character of the second word, to the end\nof the fifth word. Specifying multiple keys uses the later keys as tie\nbreakers, in order. A type specifier appended to a sort key (such as -2,2n)\napplies only to sorting that key."
+#define HELP_tail "usage: tail [-n|c NUMBER] [-f] [FILE...]\n\nCopy last lines from files to stdout. If no files listed, copy from\nstdin. Filename \"-\" is a synonym for stdin.\n\n-n Output the last NUMBER lines (default 10), +X counts from start\n-c Output the last NUMBER bytes, +NUMBER counts from start\n-f Follow FILE(s), waiting for more data to be appended\n\n"
-#define HELP_sleep "usage: sleep DURATION\n\nWait before exiting.\n\nDURATION can be a decimal fraction. An optional suffix can be \"m\"\n(minutes), \"h\" (hours), \"d\" (days), or \"s\" (seconds, the default)."
+#define HELP_strings "usage: strings [-fo] [-t oxd] [-n LEN] [FILE...]\n\nDisplay printable strings in a binary file\n\n-f Show filename\n-n At least LEN characters form a string (default 4)\n-o Show offset (ala -t d)\n-t Show offset type (o=octal, d=decimal, x=hexadecimal)\n\n"
-#define HELP_sed "usage: sed [-inrzE] [-e SCRIPT]...|SCRIPT [-f SCRIPT_FILE]... [FILE...]\n\nStream editor. Apply one or more editing SCRIPTs to each line of input\n(from FILE or stdin) producing output (by default to stdout).\n\n-e Add SCRIPT to list\n-f Add contents of SCRIPT_FILE to list\n-i Edit each file in place (-iEXT keeps backup file with extension EXT)\n-n No default output (use the p command to output matched lines)\n-r Use extended regular expression syntax\n-E POSIX alias for -r\n-s Treat input files separately (implied by -i)\n-z Use \\0 rather than \\n as the input line separator\n\nA SCRIPT is a series of one or more COMMANDs separated by newlines or\nsemicolons. All -e SCRIPTs are concatenated together as if separated\nby newlines, followed by all lines from -f SCRIPT_FILEs, in order.\nIf no -e or -f SCRIPTs are specified, the first argument is the SCRIPT.\n\nEach COMMAND may be preceded by an address which limits the command to\napply only to the specified line(s). Commands without an address apply to\nevery line. Addresses are of the form:\n\n [ADDRESS[,ADDRESS]][!]COMMAND\n\nThe ADDRESS may be a decimal line number (starting at 1), a /regular\nexpression/ within a pair of forward slashes, or the character \"$\" which\nmatches the last line of input. (In -s or -i mode this matches the last\nline of each file, otherwise just the last line of the last file.) A single\naddress matches one line, a pair of comma separated addresses match\neverything from the first address to the second address (inclusive). If\nboth addresses are regular expressions, more than one range of lines in\neach file can match. The second address can be +N to end N lines later.\n\nREGULAR EXPRESSIONS in sed are started and ended by the same character\n(traditionally / but anything except a backslash or a newline works).\nBackslashes may be used to escape the delimiter if it occurs in the\nregex, and for the usual printf escapes (\\abcefnrtv and octal, hex,\nand unicode). An empty regex repeats the previous one. ADDRESS regexes\n(above) require the first delimiter to be escaped with a backslash when\nit isn't a forward slash (to distinguish it from the COMMANDs below).\n\nSed mostly operates on individual lines one at a time. It reads each line,\nprocesses it, and either writes it to the output or discards it before\nreading the next line. Sed can remember one additional line in a separate\nbuffer (using the h, H, g, G, and x commands), and can read the next line\nof input early (using the n and N command), but other than that command\nscripts operate on individual lines of text.\n\nEach COMMAND starts with a single character. The following commands take\nno arguments:\n\n ! Run this command when the test _didn't_ match.\n\n { Start a new command block, continuing until a corresponding \"}\".\n Command blocks may nest. If the block has an address, commands within\n the block are only run for lines within the block's address range.\n\n } End command block (this command cannot have an address)\n\n d Delete this line and move on to the next one\n (ignores remaining COMMANDs)\n\n D Delete one line of input and restart command SCRIPT (same as \"d\"\n unless you've glued lines together with \"N\" or similar)\n\n g Get remembered line (overwriting current line)\n\n G Get remembered line (appending to current line)\n\n h Remember this line (overwriting remembered line)\n\n H Remember this line (appending to remembered line, if any)\n\n l Print line, escaping \\abfrtv (but not newline), octal escaping other\n nonprintable characters, wrapping lines to terminal width with a\n backslash, and appending $ to actual end of line.\n\n n Print default output and read next line, replacing current line\n (If no next line available, quit processing script)\n\n N Append next line of input to this line, separated by a newline\n (This advances the line counter for address matching and \"=\", if no\n next line available quit processing script without default output)\n\n p Print this line\n\n P Print this line up to first newline (from \"N\")\n\n q Quit (print default output, no more commands processed or lines read)\n\n x Exchange this line with remembered line (overwrite in both directions)\n\n = Print the current line number (followed by a newline)\n\nThe following commands (may) take an argument. The \"text\" arguments (to\nthe \"a\", \"b\", and \"c\" commands) may end with an unescaped \"\\\" to append\nthe next line (for which leading whitespace is not skipped), and also\ntreat \";\" as a literal character (use \"\\;\" instead).\n\n a [text] Append text to output before attempting to read next line\n\n b [label] Branch, jumps to :label (or with no label, to end of SCRIPT)\n\n c [text] Delete line, output text at end of matching address range\n (ignores remaining COMMANDs)\n\n i [text] Print text\n\n r [file] Append contents of file to output before attempting to read\n next line.\n\n s/S/R/F Search for regex S, replace matched text with R using flags F.\n The first character after the \"s\" (anything but newline or\n backslash) is the delimiter, escape with \\ to use normally.\n\n The replacement text may contain \"&\" to substitute the matched\n text (escape it with backslash for a literal &), or \\1 through\n \\9 to substitute a parenthetical subexpression in the regex.\n You can also use the normal backslash escapes such as \\n and\n a backslash at the end of the line appends the next line.\n\n The flags are:\n\n [0-9] A number, substitute only that occurrence of pattern\n g Global, substitute all occurrences of pattern\n i Ignore case when matching\n p Print the line if match was found and replaced\n w [file] Write (append) line to file if match replaced\n\n t [label] Test, jump to :label only if an \"s\" command found a match in\n this line since last test (replacing with same text counts)\n\n T [label] Test false, jump only if \"s\" hasn't found a match.\n\n w [file] Write (append) line to file\n\n y/old/new/ Change each character in 'old' to corresponding character\n in 'new' (with standard backslash escapes, delimiter can be\n any repeated character except \\ or \\n)\n\n : [label] Labeled target for jump commands\n\n # Comment, ignore rest of this line of SCRIPT\n\nDeviations from POSIX: allow extended regular expressions with -r,\nediting in place with -i, separate with -s, NUL-separated input with -z,\nprintf escapes in text, line continuations, semicolons after all commands,\n2-address anywhere an address is allowed, \"T\" command, multiline\ncontinuations for [abc], \\; to end [abc] argument before end of line."
+#define HELP_split "usage: split [-a SUFFIX_LEN] [-b BYTES] [-l LINES] [INPUT [OUTPUT]]\n\nCopy INPUT (or stdin) data to a series of OUTPUT (or \"x\") files with\nalphabetically increasing suffix (aa, ab, ac... az, ba, bb...).\n\n-a Suffix length (default 2)\n-b BYTES/file (10, 10k, 10m, 10g...)\n-l LINES/file (default 1000)\n\n"
-#define HELP_rmdir "usage: rmdir [-p] [dirname...]\n\nRemove one or more directories.\n\n-p Remove path\n--ignore-fail-on-non-empty Ignore failures caused by non-empty directories"
+#define HELP_sort "usage: sort [-Mbcdfginrsuz] [FILE...] [-k#[,#[x]] [-t X]] [-o FILE]\n\nSort all lines of text from input files (or stdin) to stdout.\n-M Month sort (jan, feb, etc)\n-V Version numbers (name-1.234-rc6.5b.tgz)\n-b Ignore leading blanks (or trailing blanks in second part of key)\n-c Check whether input is sorted\n-d Dictionary order (use alphanumeric and whitespace chars only)\n-f Force uppercase (case insensitive sort)\n-g General numeric sort (double precision with nan and inf)\n-i Ignore nonprinting characters\n-k Sort by \"key\" (see below)\n-n Numeric order (instead of alphabetical)\n-o Output to FILE instead of stdout\n-r Reverse\n-s Skip fallback sort (only sort with keys)\n-t Use a key separator other than whitespace\n-u Unique lines only\n-x Hexadecimal numerical sort\n-z Zero (null) terminated lines\n\nSorting by key looks at a subset of the words on each line. -k2 uses the\nsecond word to the end of the line, -k2,2 looks at only the second word,\n-k2,4 looks from the start of the second to the end of the fourth word.\n-k2.4,5 starts from the fourth character of the second word, to the end\nof the fifth word. Specifying multiple keys uses the later keys as tie\nbreakers, in order. A type specifier appended to a sort key (such as -2,2n)\napplies only to sorting that key.\n"
-#define HELP_rm "usage: rm [-fiRrv] FILE...\n\nRemove each argument from the filesystem.\n\n-f Force: remove without confirmation, no error if it doesn't exist\n-i Interactive: prompt for confirmation\n-rR Recursive: remove directory contents\n-v Verbose"
+#define HELP_sleep "usage: sleep DURATION\n\nWait before exiting.\n\nDURATION can be a decimal fraction. An optional suffix can be \"m\"\n(minutes), \"h\" (hours), \"d\" (days), or \"s\" (seconds, the default).\n\n"
-#define HELP_renice "usage: renice [-gpu] -n increment ID ..."
+#define HELP_sed "usage: sed [-inrzE] [-e SCRIPT]...|SCRIPT [-f SCRIPT_FILE]... [FILE...]\n\nStream editor. Apply one or more editing SCRIPTs to each line of input\n(from FILE or stdin) producing output (by default to stdout).\n\n-e Add SCRIPT to list\n-f Add contents of SCRIPT_FILE to list\n-i Edit each file in place (-iEXT keeps backup file with extension EXT)\n-n No default output (use the p command to output matched lines)\n-r Use extended regular expression syntax\n-E POSIX alias for -r\n-s Treat input files separately (implied by -i)\n-z Use \\0 rather than \\n as the input line separator\n\nA SCRIPT is a series of one or more COMMANDs separated by newlines or\nsemicolons. All -e SCRIPTs are concatenated together as if separated\nby newlines, followed by all lines from -f SCRIPT_FILEs, in order.\nIf no -e or -f SCRIPTs are specified, the first argument is the SCRIPT.\n\nEach COMMAND may be preceded by an address which limits the command to\napply only to the specified line(s). Commands without an address apply to\nevery line. Addresses are of the form:\n\n [ADDRESS[,ADDRESS]]COMMAND\n\nThe ADDRESS may be a decimal line number (starting at 1), a /regular\nexpression/ within a pair of forward slashes, or the character \"$\" which\nmatches the last line of input. (In -s or -i mode this matches the last\nline of each file, otherwise just the last line of the last file.) A single\naddress matches one line, a pair of comma separated addresses match\neverything from the first address to the second address (inclusive). If\nboth addresses are regular expressions, more than one range of lines in\neach file can match.\n\nREGULAR EXPRESSIONS in sed are started and ended by the same character\n(traditionally / but anything except a backslash or a newline works).\nBackslashes may be used to escape the delimiter if it occurs in the\nregex, and for the usual printf escapes (\\abcefnrtv and octal, hex,\nand unicode). An empty regex repeats the previous one. ADDRESS regexes\n(above) require the first delimiter to be escaped with a backslash when\nit isn't a forward slash (to distinguish it from the COMMANDs below).\n\nSed mostly operates on individual lines one at a time. It reads each line,\nprocesses it, and either writes it to the output or discards it before\nreading the next line. Sed can remember one additional line in a separate\nbuffer (using the h, H, g, G, and x commands), and can read the next line\nof input early (using the n and N command), but other than that command\nscripts operate on individual lines of text.\n\nEach COMMAND starts with a single character. The following commands take\nno arguments:\n\n { Start a new command block, continuing until a corresponding \"}\".\n Command blocks may nest. If the block has an address, commands within\n the block are only run for lines within the block's address range.\n\n } End command block (this command cannot have an address)\n\n d Delete this line and move on to the next one\n (ignores remaining COMMANDs)\n\n D Delete one line of input and restart command SCRIPT (same as \"d\"\n unless you've glued lines together with \"N\" or similar)\n\n g Get remembered line (overwriting current line)\n\n G Get remembered line (appending to current line)\n\n h Remember this line (overwriting remembered line)\n\n H Remember this line (appending to remembered line, if any)\n\n l Print line, escaping \\abfrtv (but not newline), octal escaping other\n nonprintable characters, wrapping lines to terminal width with a\n backslash, and appending $ to actual end of line.\n\n n Print default output and read next line, replacing current line\n (If no next line available, quit processing script)\n\n N Append next line of input to this line, separated by a newline\n (This advances the line counter for address matching and \"=\", if no\n next line available quit processing script without default output)\n\n p Print this line\n\n P Print this line up to first newline (from \"N\")\n\n q Quit (print default output, no more commands processed or lines read)\n\n x Exchange this line with remembered line (overwrite in both directions)\n\n = Print the current line number (followed by a newline)\n\nThe following commands (may) take an argument. The \"text\" arguments (to\nthe \"a\", \"b\", and \"c\" commands) may end with an unescaped \"\\\" to append\nthe next line (for which leading whitespace is not skipped), and also\ntreat \";\" as a literal character (use \"\\;\" instead).\n\n a [text] Append text to output before attempting to read next line\n\n b [label] Branch, jumps to :label (or with no label, to end of SCRIPT)\n\n c [text] Delete line, output text at end of matching address range\n (ignores remaining COMMANDs)\n\n i [text] Print text\n\n r [file] Append contents of file to output before attempting to read\n next line.\n\n s/S/R/F Search for regex S, replace matched text with R using flags F.\n The first character after the \"s\" (anything but newline or\n backslash) is the delimiter, escape with \\ to use normally.\n\n The replacement text may contain \"&\" to substitute the matched\n text (escape it with backslash for a literal &), or \\1 through\n \\9 to substitute a parenthetical subexpression in the regex.\n You can also use the normal backslash escapes such as \\n and\n a backslash at the end of the line appends the next line.\n\n The flags are:\n\n [0-9] A number, substitute only that occurrence of pattern\n g Global, substitute all occurrences of pattern\n i Ignore case when matching\n p Print the line if match was found and replaced\n w [file] Write (append) line to file if match replaced\n\n t [label] Test, jump to :label only if an \"s\" command found a match in\n this line since last test (replacing with same text counts)\n\n T [label] Test false, jump only if \"s\" hasn't found a match.\n\n w [file] Write (append) line to file\n\n y/old/new/ Change each character in 'old' to corresponding character\n in 'new' (with standard backslash escapes, delimiter can be\n any repeated character except \\ or \\n)\n\n : [label] Labeled target for jump commands\n\n # Comment, ignore rest of this line of SCRIPT\n\nDeviations from POSIX: allow extended regular expressions with -r,\nediting in place with -i, separate with -s, NUL-separated input with -z,\nprintf escapes in text, line continuations, semicolons after all commands,\n2-address anywhere an address is allowed, \"T\" command, multiline\ncontinuations for [abc], \\; to end [abc] argument before end of line.\n\n"
-#define HELP_pwd "usage: pwd [-L|-P]\n\nPrint working (current) directory.\n\n-L Use shell's path from $PWD (when applicable)\n-P Print canonical absolute path"
+#define HELP_rmdir "usage: rmdir [-p] [dirname...]\n\nRemove one or more directories.\n\n-p Remove path\n\n"
-#define HELP_pkill "usage: pkill [-fnovx] [-SIGNAL|-l SIGNAL] [PATTERN] [-G GID,] [-g PGRP,] [-P PPID,] [-s SID,] [-t TERM,] [-U UID,] [-u EUID,]\n\n-l Send SIGNAL (default SIGTERM)\n-V Verbose\n-f Check full command line for PATTERN\n-G Match real Group ID(s)\n-g Match Process Group(s) (0 is current user)\n-n Newest match only\n-o Oldest match only\n-P Match Parent Process ID(s)\n-s Match Session ID(s) (0 for current)\n-t Match Terminal(s)\n-U Match real User ID(s)\n-u Match effective User ID(s)\n-v Negate the match\n-x Match whole command (not substring)"
+#define HELP_rm "usage: rm [-fiRrv] FILE...\n\nRemove each argument from the filesystem.\n\n-f Force: remove without confirmation, no error if it doesn't exist\n-i Interactive: prompt for confirmation\n-rR Recursive: remove directory contents\n-v Verbose\n\n"
-#define HELP_pgrep "usage: pgrep [-clfnovx] [-d DELIM] [-L SIGNAL] [PATTERN] [-G GID,] [-g PGRP,] [-P PPID,] [-s SID,] [-t TERM,] [-U UID,] [-u EUID,]\n\nSearch for process(es). PATTERN is an extended regular expression checked\nagainst command names.\n\n-c Show only count of matches\n-d Use DELIM instead of newline\n-L Send SIGNAL instead of printing name\n-l Show command name\n-f Check full command line for PATTERN\n-G Match real Group ID(s)\n-g Match Process Group(s) (0 is current user)\n-n Newest match only\n-o Oldest match only\n-P Match Parent Process ID(s)\n-s Match Session ID(s) (0 for current)\n-t Match Terminal(s)\n-U Match real User ID(s)\n-u Match effective User ID(s)\n-v Negate the match\n-x Match whole command (not substring)"
+#define HELP_renice "usage: renice [-gpu] -n increment ID ...\n\n"
-#define HELP_iotop "usage: iotop [-AaKObq] [-n NUMBER] [-d SECONDS] [-p PID,] [-u USER,]\n\nRank processes by I/O.\n\n-A All I/O, not just disk\n-a Accumulated I/O (not percentage)\n-H Show threads\n-K Kilobytes\n-k Fallback sort FIELDS (default -[D]IO,-ETIME,-PID)\n-m Maximum number of tasks to show\n-O Only show processes doing I/O\n-o Show FIELDS (default PID,PR,USER,[D]READ,[D]WRITE,SWAP,[D]IO,COMM)\n-s Sort by field number (0-X, default 6)\n-b Batch mode (no tty)\n-d Delay SECONDS between each cycle (default 3)\n-n Exit after NUMBER iterations\n-p Show these PIDs\n-u Show these USERs\n-q Quiet (no header lines)\n\nCursor LEFT/RIGHT to change sort, UP/DOWN move list, space to force\nupdate, R to reverse sort, Q to exit."
+#define HELP_pwd "usage: pwd [-L|-P]\n\nPrint working (current) directory.\n\n-L Use shell's path from $PWD (when applicable)\n-P Print canonical absolute path\n\n"
-#define HELP_top "usage: top [-Hbq] [-k FIELD,] [-o FIELD,] [-s SORT] [-n NUMBER] [-m LINES] [-d SECONDS] [-p PID,] [-u USER,]\n\nShow process activity in real time.\n\n-H Show threads\n-k Fallback sort FIELDS (default -S,-%CPU,-ETIME,-PID)\n-o Show FIELDS (def PID,USER,PR,NI,VIRT,RES,SHR,S,%CPU,%MEM,TIME+,CMDLINE)\n-O Add FIELDS (replacing PR,NI,VIRT,RES,SHR,S from default)\n-s Sort by field number (1-X, default 9)\n-b Batch mode (no tty)\n-d Delay SECONDS between each cycle (default 3)\n-m Maximum number of tasks to show\n-n Exit after NUMBER iterations\n-p Show these PIDs\n-u Show these USERs\n-q Quiet (no header lines)\n\nCursor LEFT/RIGHT to change sort, UP/DOWN move list, space to force\nupdate, R to reverse sort, Q to exit."
+#define HELP_pkill "usage: pkill [-fnovx] [-SIGNAL|-l SIGNAL] [PATTERN] [-G GID,] [-g PGRP,] [-P PPID,] [-s SID,] [-t TERM,] [-U UID,] [-u EUID,]\n\n-l Send SIGNAL (default SIGTERM)\n-V Verbose\n-f Check full command line for PATTERN\n-G Match real Group ID(s)\n-g Match Process Group(s) (0 is current user)\n-n Newest match only\n-o Oldest match only\n-P Match Parent Process ID(s)\n-s Match Session ID(s) (0 for current)\n-t Match Terminal(s)\n-U Match real User ID(s)\n-u Match effective User ID(s)\n-v Negate the match\n-x Match whole command (not substring)\n\n"
-#define HELP_ps "usage: ps [-AadefLlnwZ] [-gG GROUP,] [-k FIELD,] [-o FIELD,] [-p PID,] [-t TTY,] [-uU USER,]\n\nList processes.\n\nWhich processes to show (-gGuUpPt selections may be comma separated lists):\n\n-A All -a Has terminal not session leader\n-d All but session leaders -e Synonym for -A\n-g In GROUPs -G In real GROUPs (before sgid)\n-p PIDs (--pid) -P Parent PIDs (--ppid)\n-s In session IDs -t Attached to selected TTYs\n-T Show threads also -u Owned by selected USERs\n-U Real USERs (before suid)\n\nOutput modifiers:\n\n-k Sort FIELDs (-FIELD to reverse) -M Measure/pad future field widths\n-n Show numeric USER and GROUP -w Wide output (don't truncate fields)\n\nWhich FIELDs to show. (-o HELP for list, default = -o PID,TTY,TIME,CMD)\n\n-f Full listing (-o USER:12=UID,PID,PPID,C,STIME,TTY,TIME,ARGS=CMD)\n-l Long listing (-o F,S,UID,PID,PPID,C,PRI,NI,ADDR,SZ,WCHAN,TTY,TIME,CMD)\n-o Output FIELDs instead of defaults, each with optional :size and =title\n-O Add FIELDS to defaults\n-Z Include LABEL"
+#define HELP_pgrep "usage: pgrep [-clfnovx] [-d DELIM] [-L SIGNAL] [PATTERN] [-G GID,] [-g PGRP,] [-P PPID,] [-s SID,] [-t TERM,] [-U UID,] [-u EUID,]\n\nSearch for process(es). PATTERN is an extended regular expression checked\nagainst command names.\n\n-c Show only count of matches\n-d Use DELIM instead of newline\n-L Send SIGNAL instead of printing name\n-l Show command name\n-f Check full command line for PATTERN\n-G Match real Group ID(s)\n-g Match Process Group(s) (0 is current user)\n-n Newest match only\n-o Oldest match only\n-P Match Parent Process ID(s)\n-s Match Session ID(s) (0 for current)\n-t Match Terminal(s)\n-U Match real User ID(s)\n-u Match effective User ID(s)\n-v Negate the match\n-x Match whole command (not substring)\n\n"
-#define HELP_printf "usage: printf FORMAT [ARGUMENT...]\n\nFormat and print ARGUMENT(s) according to FORMAT, using C printf syntax\n(% escapes for cdeEfgGiosuxX, \\ escapes for abefnrtv0 or \\OCTAL or \\xHEX)."
+#define HELP_iotop "usage: iotop [-AaKObq] [-n NUMBER] [-d SECONDS] [-p PID,] [-u USER,]\n\nRank processes by I/O.\n\n-A All I/O, not just disk\n-a Accumulated I/O (not percentage)\n-H Show threads\n-K Kilobytes\n-k Fallback sort FIELDS (default -[D]IO,-ETIME,-PID)\n-m Maximum number of tasks to show\n-O Only show processes doing I/O\n-o Show FIELDS (default PID,PR,USER,[D]READ,[D]WRITE,SWAP,[D]IO,COMM)\n-s Sort by field number (0-X, default 6)\n-b Batch mode (no tty)\n-d Delay SECONDS between each cycle (default 3)\n-n Exit after NUMBER iterations\n-p Show these PIDs\n-u Show these USERs\n-q Quiet (no header lines)\n\nCursor LEFT/RIGHT to change sort, UP/DOWN move list, space to force\nupdate, R to reverse sort, Q to exit.\n\n"
-#define HELP_patch "usage: patch [-d DIR] [-i file] [-p depth] [-Rlsu] [--dry-run]\n\nApply a unified diff to one or more files.\n\n-d Modify files in DIR\n-i Input file (default=stdin)\n-l Loose match (ignore whitespace)\n-p Number of '/' to strip from start of file paths (default=all)\n-R Reverse patch\n-s Silent except for errors\n-u Ignored (only handles \"unified\" diffs)\n--dry-run Don't change files, just confirm patch applies\n\nThis version of patch only handles unified diffs, and only modifies\na file when all hunks to that file apply. Patch prints failed hunks\nto stderr, and exits with nonzero status if any hunks fail.\n\nA file compared against /dev/null (or with a date <= the epoch) is\ncreated/deleted as appropriate."
+#define HELP_top "usage: top [-Hbq] [-k FIELD,] [-o FIELD,] [-s SORT] [-n NUMBER] [-m LINES] [-d SECONDS] [-p PID,] [-u USER,]\n\nShow process activity in real time.\n\n-H Show threads\n-k Fallback sort FIELDS (default -S,-%CPU,-ETIME,-PID)\n-o Show FIELDS (def PID,USER,PR,NI,VIRT,RES,SHR,S,%CPU,%MEM,TIME+,CMDLINE)\n-O Add FIELDS (replacing PR,NI,VIRT,RES,SHR,S from default)\n-s Sort by field number (1-X, default 9)\n-b Batch mode (no tty)\n-d Delay SECONDS between each cycle (default 3)\n-m Maximum number of tasks to show\n-n Exit after NUMBER iterations\n-p Show these PIDs\n-u Show these USERs\n-q Quiet (no header lines)\n\nCursor LEFT/RIGHT to change sort, UP/DOWN move list, space to force\nupdate, R to reverse sort, Q to exit.\n\n"
-#define HELP_paste "usage: paste [-s] [-d DELIMITERS] [FILE...]\n\nMerge corresponding lines from each input file.\n\n-d List of delimiter characters to separate fields with (default is \\t)\n-s Sequential mode: turn each input file into one line of output"
+#define HELP_ps "usage: ps [-AadefLlnwZ] [-gG GROUP,] [-k FIELD,] [-o FIELD,] [-p PID,] [-t TTY,] [-uU USER,]\n\nList processes.\n\nWhich processes to show (-gGuUpPt selections may be comma separated lists):\n\n-A All -a Has terminal not session leader\n-d All but session leaders -e Synonym for -A\n-g In GROUPs -G In real GROUPs (before sgid)\n-p PIDs (--pid) -P Parent PIDs (--ppid)\n-s In session IDs -t Attached to selected TTYs\n-T Show threads also -u Owned by selected USERs\n-U Real USERs (before suid)\n\nOutput modifiers:\n\n-k Sort FIELDs (-FIELD to reverse) -M Measure/pad future field widths\n-n Show numeric USER and GROUP -w Wide output (don't truncate fields)\n\nWhich FIELDs to show. (-o HELP for list, default = -o PID,TTY,TIME,CMD)\n\n-f Full listing (-o USER:12=UID,PID,PPID,C,STIME,TTY,TIME,ARGS=CMD)\n-l Long listing (-o F,S,UID,PID,PPID,C,PRI,NI,ADDR,SZ,WCHAN,TTY,TIME,CMD)\n-o Output FIELDs instead of defaults, each with optional :size and =title\n-O Add FIELDS to defaults\n-Z Include LABEL\n\n"
-#define HELP_od "usage: od [-bcdosxv] [-j #] [-N #] [-w #] [-A doxn] [-t acdfoux[#]]\n\nDump data in octal/hex.\n\n-A Address base (decimal, octal, hexadecimal, none)\n-j Skip this many bytes of input\n-N Stop dumping after this many bytes\n-t Output type a(scii) c(har) d(ecimal) f(loat) o(ctal) u(nsigned) (he)x\n plus optional size in bytes\n aliases: -b=-t o1, -c=-t c, -d=-t u2, -o=-t o2, -s=-t d2, -x=-t x2\n-v Don't collapse repeated lines together\n-w Total line width in bytes (default 16)"
+#define HELP_printf "usage: printf FORMAT [ARGUMENT...]\n\nFormat and print ARGUMENT(s) according to FORMAT, using C printf syntax\n(% escapes for cdeEfgGiosuxX, \\ escapes for abefnrtv0 or \\OCTAL or \\xHEX).\n\n"
-#define HELP_nohup "usage: nohup COMMAND [ARG...]\n\nRun a command that survives the end of its terminal.\n\nRedirect tty on stdin to /dev/null, tty on stdout to \"nohup.out\"."
+#define HELP_patch "usage: patch [-d DIR] [-i file] [-p depth] [-Rlsu] [--dry-run]\n\nApply a unified diff to one or more files.\n\n-d Modify files in DIR\n-i Input file (default=stdin)\n-l Loose match (ignore whitespace)\n-p Number of '/' to strip from start of file paths (default=all)\n-R Reverse patch\n-s Silent except for errors\n-u Ignored (only handles \"unified\" diffs)\n--dry-run Don't change files, just confirm patch applies\n\nThis version of patch only handles unified diffs, and only modifies\na file when all hunks to that file apply. Patch prints failed hunks\nto stderr, and exits with nonzero status if any hunks fail.\n\nA file compared against /dev/null (or with a date <= the epoch) is\ncreated/deleted as appropriate.\n\n"
-#define HELP_nl "usage: nl [-E] [-l #] [-b MODE] [-n STYLE] [-s SEPARATOR] [-v #] [-w WIDTH] [FILE...]\n\nNumber lines of input.\n\n-E Use extended regex syntax (when doing -b pREGEX)\n-b Which lines to number: a (all) t (non-empty, default) pREGEX (pattern)\n-l Only count last of this many consecutive blank lines\n-n Number STYLE: ln (left justified) rn (right justified) rz (zero pad)\n-s Separator to use between number and line (instead of TAB)\n-v Starting line number for each section (default 1)\n-w Width of line numbers (default 6)"
+#define HELP_paste "usage: paste [-s] [-d DELIMITERS] [FILE...]\n\nMerge corresponding lines from each input file.\n\n-d List of delimiter characters to separate fields with (default is \\t)\n-s Sequential mode: turn each input file into one line of output\n\n"
-#define HELP_nice "usage: nice [-n PRIORITY] COMMAND [ARG...]\n\nRun a command line at an increased or decreased scheduling priority.\n\nHigher numbers make a program yield more CPU time, from -20 (highest\npriority) to 19 (lowest). By default processes inherit their parent's\nniceness (usually 0). By default this command adds 10 to the parent's\npriority. Only root can set a negative niceness level."
+#define HELP_od "usage: od [-bcdosxv] [-j #] [-N #] [-w #] [-A doxn] [-t acdfoux[#]]\n\nDump data in octal/hex.\n\n-A Address base (decimal, octal, hexadecimal, none)\n-j Skip this many bytes of input\n-N Stop dumping after this many bytes\n-t Output type a(scii) c(har) d(ecimal) f(loat) o(ctal) u(nsigned) (he)x\n plus optional size in bytes\n aliases: -b=-t o1, -c=-t c, -d=-t u2, -o=-t o2, -s=-t d2, -x=-t x2\n-v Don't collapse repeated lines together\n-w Total line width in bytes (default 16)\n\n"
-#define HELP_mkfifo "usage: mkfifo [-Z CONTEXT] [NAME...]\n\nCreate FIFOs (named pipes).\n\n-Z Security context"
+#define HELP_nohup "usage: nohup COMMAND [ARG...]\n\nRun a command that survives the end of its terminal.\n\nRedirect tty on stdin to /dev/null, tty on stdout to \"nohup.out\".\n\n"
-#define HELP_mkdir_z "usage: [-Z context]\n\n-Z Set security context"
+#define HELP_nl "usage: nl [-E] [-l #] [-b MODE] [-n STYLE] [-s SEPARATOR] [-w WIDTH] [FILE...]\n\nNumber lines of input.\n\n-E Use extended regex syntax (when doing -b pREGEX)\n-b Which lines to number: a (all) t (non-empty, default) pREGEX (pattern)\n-l Only count last of this many consecutive blank lines\n-n Number STYLE: ln (left justified) rn (right justified) rz (zero pad)\n-s Separator to use between number and line (instead of TAB)\n-w Width of line numbers (default 6)\n\n"
-#define HELP_mkdir "usage: mkdir [-vp] [-m mode] [dirname...]\n\nCreate one or more directories.\n\n-m Set permissions of directory to mode\n-p Make parent directories as needed\n-v Verbose"
+#define HELP_nice "usage: nice [-n PRIORITY] COMMAND [ARG...]\n\nRun a command line at an increased or decreased scheduling priority.\n\nHigher numbers make a program yield more CPU time, from -20 (highest\npriority) to 19 (lowest). By default processes inherit their parent's\nniceness (usually 0). By default this command adds 10 to the parent's\npriority. Only root can set a negative niceness level.\n\n"
-#define HELP_ls "usage: ls [-ACFHLRSZacdfhiklmnpqrstux1] [--color[=auto]] [directory...]\n\nList files.\n\nwhat to show:\n-a all files including .hidden -b escape nongraphic chars\n-c use ctime for timestamps -d directory, not contents\n-i inode number -p put a '/' after dir names\n-q unprintable chars as '?' -s storage used (1024 byte units)\n-u use access time for timestamps -A list all files but . and ..\n-H follow command line symlinks -L follow symlinks\n-R recursively list in subdirs -F append /dir *exe @sym |FIFO\n-Z security context\n\noutput formats:\n-1 list one file per line -C columns (sorted vertically)\n-g like -l but no owner -h human readable sizes\n-l long (show full details) -m comma separated\n-n like -l but numeric uid/gid -o like -l but no group\n-x columns (horizontal sort) -ll long with nanoseconds (--full-time)\n--color device=yellow symlink=turquoise/red dir=blue socket=purple\n files: exe=green suid=red suidfile=redback stickydir=greenback\n =auto means detect if output is a tty.\n\nsorting (default is alphabetical):\n-f unsorted -r reverse -t timestamp -S size"
+#define HELP_mkfifo "usage: mkfifo [-Z CONTEXT] [NAME...]\n\nCreate FIFOs (named pipes).\n\n-Z Security context\n"
-#define HELP_logger "usage: logger [-s] [-t TAG] [-p [FACILITY.]PRIORITY] [message...]\n\nLog message (or stdin) to syslog.\n\n-s Also write message to stderr\n-t Use TAG instead of username to identify message source\n-p Specify PRIORITY with optional FACILITY. Default is \"user.notice\""
+#define HELP_mkdir_z "usage: [-Z context]\n\n-Z Set security context\n\n"
-#define HELP_ln "usage: ln [-sfnv] [-t DIR] [FROM...] TO\n\nCreate a link between FROM and TO.\nOne/two/many arguments work like \"mv\" or \"cp\".\n\n-s Create a symbolic link\n-f Force the creation of the link, even if TO already exists\n-n Symlink at TO treated as file\n-t Create links in DIR\n-T TO always treated as file, max 2 arguments\n-v Verbose"
+#define HELP_mkdir "usage: mkdir [-vp] [-m mode] [dirname...]\n\nCreate one or more directories.\n\n-m Set permissions of directory to mode\n-p Make parent directories as needed\n-v Verbose\n\n"
-#define HELP_link "usage: link FILE NEWLINK\n\nCreate hardlink to a file."
+#define HELP_ls "usage: ls [-ACFHLRSZacdfhiklmnpqrstux1] [--color[=auto]] [directory...]\n\nList files.\n\nwhat to show:\n-a all files including .hidden -b escape nongraphic chars\n-c use ctime for timestamps -d directory, not contents\n-i inode number -p put a '/' after dir names\n-q unprintable chars as '?' -s storage used (1024 byte units)\n-u use access time for timestamps -A list all files but . and ..\n-H follow command line symlinks -L follow symlinks\n-R recursively list in subdirs -F append /dir *exe @sym |FIFO\n-Z security context\n\noutput formats:\n-1 list one file per line -C columns (sorted vertically)\n-g like -l but no owner -h human readable sizes\n-l long (show full details) -m comma separated\n-n like -l but numeric uid/gid -o like -l but no group\n-x columns (horizontal sort) -ll long with nanoseconds (--full-time)\n--color device=yellow symlink=turquoise/red dir=blue socket=purple\n files: exe=green suid=red suidfile=redback stickydir=greenback\n =auto means detect if output is a tty.\n\nsorting (default is alphabetical):\n-f unsorted -r reverse -t timestamp -S size\n\n"
-#define HELP_killall5 "usage: killall5 [-l [SIGNAL]] [-SIGNAL|-s SIGNAL] [-o PID]...\n\nSend a signal to all processes outside current session.\n\n-l List signal name(s) and number(s)\n-o PID Omit PID\n-s Send SIGNAL (default SIGTERM)"
+#define HELP_logger "usage: logger [-s] [-t TAG] [-p [FACILITY.]PRIORITY] [message...]\n\nLog message (or stdin) to syslog.\n\n-s Also write message to stderr\n-t Use TAG instead of username to identify message source\n-p Specify PRIORITY with optional FACILITY. Default is \"user.notice\"\n\n"
-#define HELP_kill "usage: kill [-l [SIGNAL] | -s SIGNAL | -SIGNAL] pid...\n\nSend signal to process(es).\n\n-l List signal name(s) and number(s)\n-s Send SIGNAL (default SIGTERM)"
+#define HELP_ln "usage: ln [-sfnv] [FROM...] TO\n\nCreate a link between FROM and TO.\nWith only one argument, create link in current directory.\n\n-s Create a symbolic link\n-f Force the creation of the link, even if TO already exists\n-n Symlink at destination treated as file\n-v Verbose\n\n"
-#define HELP_whoami "usage: whoami\n\nPrint the current user name."
+#define HELP_link "usage: link FILE NEWLINK\n\nCreate hardlink to a file.\n\n"
-#define HELP_logname "usage: logname\n\nPrint the current user name."
+#define HELP_killall5 "usage: killall5 [-l [SIGNAL]] [-SIGNAL|-s SIGNAL] [-o PID]...\n\nSend a signal to all processes outside current session.\n\n-l List signal name(s) and number(s)\n-o PID Omit PID\n-s Send SIGNAL (default SIGTERM)\n\n"
-#define HELP_groups "usage: groups [user]\n\nPrint the groups a user is in."
+#define HELP_kill "usage: kill [-l [SIGNAL] | -s SIGNAL | -SIGNAL] pid...\n\nSend signal to process(es).\n\n-l List signal name(s) and number(s)\n-s Send SIGNAL (default SIGTERM)\n\n"
-#define HELP_id "usage: id [-GZgnru] [USER...]\n\nPrint user and group ID.\n-G Show only the group IDs\n-Z Show only security context\n-g Show only the effective group ID\n-n Print names instead of numeric IDs (to be used with -Ggu)\n-r Show real ID instead of effective ID\n-u Show only the effective user ID"
+#define HELP_whoami "usage: whoami\n\nPrint the current user name.\n\n"
-#define HELP_iconv "usage: iconv [-f FROM] [-t TO] [FILE...]\n\nConvert character encoding of files.\n\n-c Omit invalid chars\n-f Convert from (default utf8)\n-t Convert to (default utf8)"
+#define HELP_logname "usage: logname\n\nPrint the current user name.\n\n"
-#define HELP_head "usage: head [-n number] [file...]\n\nCopy first lines from files to stdout. If no files listed, copy from\nstdin. Filename \"-\" is a synonym for stdin.\n\n-n Number of lines to copy\n-c Number of bytes to copy\n-q Never print headers\n-v Always print headers"
+#define HELP_groups "usage: groups [user]\n\nPrint the groups a user is in.\n\n"
-#define HELP_grep "usage: grep [-EFrivwcloqsHbhn] [-ABC NUM] [-m MAX] [-e REGEX]... [-MS PATTERN]... [-f REGFILE] [FILE]...\n\nShow lines matching regular expressions. If no -e, first argument is\nregular expression to match. With no files (or \"-\" filename) read stdin.\nReturns 0 if matched, 1 if no match found, 2 for command errors.\n\n-e Regex to match. (May be repeated.)\n-f File listing regular expressions to match.\n\nfile search:\n-r Recurse into subdirectories (defaults FILE to \".\")\n-R Recurse into subdirectories and symlinks to directories\n-M Match filename pattern (--include)\n-S Skip filename pattern (--exclude)\n--exclude-dir=PATTERN Skip directory pattern\n-I Ignore binary files\n\nmatch type:\n-A Show NUM lines after -B Show NUM lines before match\n-C NUM lines context (A+B) -E extended regex syntax\n-F fixed (literal match) -a always text (not binary)\n-i case insensitive -m match MAX many lines\n-v invert match -w whole word (implies -E)\n-x whole line -z input NUL terminated\n\ndisplay modes: (default: matched line)\n-c count of matching lines -l show only matching filenames\n-o only matching part -q quiet (errors only)\n-s silent (no error msg) -Z output NUL terminated\n\noutput prefix (default: filename if checking more than 1 file)\n-H force filename -b byte offset of match\n-h hide filename -n line number of match"
+#define HELP_id "usage: id [-GZgnru] [USER...]\n\nPrint user and group ID.\n-G Show only the group IDs\n-Z Show only security context\n-g Show only the effective group ID\n-n Print names instead of numeric IDs (to be used with -Ggu)\n-r Show real ID instead of effective ID\n-u Show only the effective user ID\n"
-#define HELP_getconf "usage: getconf -a [PATH] | -l | NAME [PATH]\n\nGet system configuration values. Values from pathconf(3) require a path.\n\n-a Show all (defaults to \"/\" if no path given)\n-l List available value names (grouped by source)"
+#define HELP_iconv "usage: iconv [-f FROM] [-t TO] [FILE...]\n\nConvert character encoding of files.\n\n-c Omit invalid chars\n-f Convert from (default utf8)\n-t Convert to (default utf8)\n\n"
-#define HELP_find "usage: find [-HL] [DIR...] [<options>]\n\nSearch directories for matching files.\nDefault: search \".\", match all, -print matches.\n\n-H Follow command line symlinks -L Follow all symlinks\n\nMatch filters:\n-name PATTERN filename with wildcards (-iname case insensitive)\n-path PATTERN path name with wildcards (-ipath case insensitive)\n-user UNAME belongs to user UNAME -nouser user ID not known\n-group GROUP belongs to group GROUP -nogroup group ID not known\n-perm [-/]MODE permissions (-=min /=any) -prune ignore dir contents\n-size N[c] 512 byte blocks (c=bytes) -xdev only this filesystem\n-links N hardlink count -atime N[u] accessed N units ago\n-ctime N[u] created N units ago -mtime N[u] modified N units ago\n-newer FILE newer mtime than FILE -mindepth N at least N dirs down\n-depth ignore contents of dir -maxdepth N at most N dirs down\n-inum N inode number N -empty empty files and dirs\n-type [bcdflps] type is (block, char, dir, file, symlink, pipe, socket)\n-true always true -false always false\n-context PATTERN security context\n-newerXY FILE X=acm time > FILE's Y=acm time (Y=t: FILE is literal time)\n\nNumbers N may be prefixed by a - (less than) or + (greater than). Units for\n-Xtime are d (days, default), h (hours), m (minutes), or s (seconds).\n\nCombine matches with:\n!, -a, -o, ( ) not, and, or, group expressions\n\nActions:\n-print Print match with newline -print0 Print match with null\n-exec Run command with path -execdir Run command in file's dir\n-ok Ask before exec -okdir Ask before execdir\n-delete Remove matching file/dir -printf FORMAT Print using format string\n\nCommands substitute \"{}\" with matched file. End with \";\" to run each file,\nor \"+\" (next argument after \"{}\") to collect and run with multiple files.\n\n-printf FORMAT characters are \\ escapes and:\n%b 512 byte blocks used\n%f basename %g textual gid %G numeric gid\n%i decimal inode %l target of symlink %m octal mode\n%M ls format type/mode %p path to file %P path to file minus DIR\n%s size in bytes %T@ mod time as unixtime\n%u username %U numeric uid %Z security context"
+#define HELP_head "usage: head [-n number] [file...]\n\nCopy first lines from files to stdout. If no files listed, copy from\nstdin. Filename \"-\" is a synonym for stdin.\n\n-n Number of lines to copy\n-c Number of bytes to copy\n-q Never print headers\n-v Always print headers\n\n"
-#define HELP_file "usage: file [-bhLs] [file...]\n\nExamine the given files and describe their content types.\n\n-b Brief (no filename)\n-h Don't follow symlinks (default)\n-L Follow symlinks\n-s Show block/char device contents"
+#define HELP_grep "usage: grep [-EFrivwcloqsHbhn] [-ABC NUM] [-m MAX] [-e REGEX]... [-MS PATTERN]... [-f REGFILE] [FILE]...\n\nShow lines matching regular expressions. If no -e, first argument is\nregular expression to match. With no files (or \"-\" filename) read stdin.\nReturns 0 if matched, 1 if no match found, 2 for command errors.\n\n-e Regex to match. (May be repeated.)\n-f File listing regular expressions to match.\n\nfile search:\n-r Recurse into subdirectories (defaults FILE to \".\")\n-M Match filename pattern (--include)\n-S Skip filename pattern (--exclude)\n-I Ignore binary files\n\nmatch type:\n-A Show NUM lines after -B Show NUM lines before match\n-C NUM lines context (A+B) -E extended regex syntax\n-F fixed (literal match) -a always text (not binary)\n-i case insensitive -m match MAX many lines\n-v invert match -w whole word (implies -E)\n-x whole line -z input NUL terminated\n\ndisplay modes: (default: matched line)\n-c count of matching lines -l show only matching filenames\n-o only matching part -q quiet (errors only)\n-s silent (no error msg) -Z output NUL terminated\n\noutput prefix (default: filename if checking more than 1 file)\n-H force filename -b byte offset of match\n-h hide filename -n line number of match\n\n"
-#define HELP_false "Return nonzero."
+#define HELP_getconf "usage: getconf -a [PATH] | -l | NAME [PATH]\n\nGet system configuration values. Values from pathconf(3) require a path.\n\n-a Show all (defaults to \"/\" if no path given)\n-l List available value names (grouped by source)\n\n"
-#define HELP_expand "usage: expand [-t TABLIST] [FILE...]\n\nExpand tabs to spaces according to tabstops.\n\n-t TABLIST\n\nSpecify tab stops, either a single number instead of the default 8,\nor a comma separated list of increasing numbers representing tabstop\npositions (absolute, not increments) with each additional tab beyond\nthat becoming one space."
+#define HELP_find "usage: find [-HL] [DIR...] [<options>]\n\nSearch directories for matching files.\nDefault: search \".\" match all -print all matches.\n\n-H Follow command line symlinks -L Follow all symlinks\n\nMatch filters:\n-name PATTERN filename with wildcards -iname case insensitive -name\n-path PATTERN path name with wildcards -ipath case insensitive -path\n-user UNAME belongs to user UNAME -nouser user ID not known\n-group GROUP belongs to group GROUP -nogroup group ID not known\n-perm [-/]MODE permissions (-=min /=any) -prune ignore contents of dir\n-size N[c] 512 byte blocks (c=bytes) -xdev only this filesystem\n-links N hardlink count -atime N[u] accessed N units ago\n-ctime N[u] created N units ago -mtime N[u] modified N units ago\n-newer FILE newer mtime than FILE -mindepth # at least # dirs down\n-depth ignore contents of dir -maxdepth # at most # dirs down\n-inum N inode number N -empty empty files and dirs\n-type [bcdflps] (block, char, dir, file, symlink, pipe, socket)\n-context PATTERN security context\n\nNumbers N may be prefixed by a - (less than) or + (greater than). Units for\n-Xtime are d (days, default), h (hours), m (minutes), or s (seconds).\n\nCombine matches with:\n!, -a, -o, ( ) not, and, or, group expressions\n\nActions:\n-print Print match with newline -print0 Print match with null\n-exec Run command with path -execdir Run command in file's dir\n-ok Ask before exec -okdir Ask before execdir\n-delete Remove matching file/dir\n\nCommands substitute \"{}\" with matched file. End with \";\" to run each file,\nor \"+\" (next argument after \"{}\") to collect and run with multiple files.\n\n"
-#define HELP_env "usage: env [-i] [-u NAME] [NAME=VALUE...] [COMMAND [ARG...]]\n\nSet the environment for command invocation, or list environment variables.\n\n-i Clear existing environment\n-u NAME Remove NAME from the environment\n-0 Use null instead of newline in output"
+#define HELP_file "usage: file [-hL] [file...]\n\nExamine the given files and describe their content types.\n\n-h Don't follow symlinks (default)\n-L Follow symlinks\n\n"
-#define HELP_echo "usage: echo [-neE] [args...]\n\nWrite each argument to stdout, with one space between each, followed\nby a newline.\n\n-n No trailing newline\n-E Print escape sequences literally (default)\n-e Process the following escape sequences:\n \\\\ Backslash\n \\0NNN Octal values (1 to 3 digits)\n \\a Alert (beep/flash)\n \\b Backspace\n \\c Stop output here (avoids trailing newline)\n \\f Form feed\n \\n Newline\n \\r Carriage return\n \\t Horizontal tab\n \\v Vertical tab\n \\xHH Hexadecimal values (1 to 2 digits)"
+#define HELP_false "Return nonzero.\n\n"
-#define HELP_du "usage: du [-d N] [-askxHLlmc] [file...]\n\nShow disk usage, space consumed by files and directories.\n\nSize in:\n-k 1024 byte blocks (default)\n-K 512 byte blocks (posix)\n-m Megabytes\n-h Human readable (e.g., 1K 243M 2G)\n\nWhat to show:\n-a All files, not just directories\n-H Follow symlinks on cmdline\n-L Follow all symlinks\n-s Only total size of each argument\n-x Don't leave this filesystem\n-c Cumulative total\n-d N Only depth < N\n-l Disable hardlink filter"
+#define HELP_expand "usage: expand [-t TABLIST] [FILE...]\n\nExpand tabs to spaces according to tabstops.\n\n-t TABLIST\n\nSpecify tab stops, either a single number instead of the default 8,\nor a comma separated list of increasing numbers representing tabstop\npositions (absolute, not increments) with each additional tab beyond\nthat becoming one space.\n\n"
-#define HELP_dirname "usage: dirname PATH...\n\nShow directory portion of path."
+#define HELP_env "usage: env [-i] [-u NAME] [NAME=VALUE...] [COMMAND [ARG...]]\n\nSet the environment for command invocation, or list environment variables.\n\n-i Clear existing environment\n-u NAME Remove NAME from the environment\n-0 Use null instead of newline in output\n\n"
-#define HELP_df "usage: df [-HPkhi] [-t type] [FILESYSTEM ...]\n\nThe \"disk free\" command shows total/used/available disk space for\neach filesystem listed on the command line, or all currently mounted\nfilesystems.\n\n-a Show all (including /proc and friends)\n-P The SUSv3 \"Pedantic\" option\n-k Sets units back to 1024 bytes (the default without -P)\n-h Human readable (K=1024)\n-H Human readable (k=1000)\n-i Show inodes instead of blocks\n-t type Display only filesystems of this type\n\nPedantic provides a slightly less useful output format dictated by Posix,\nand sets the units to 512 bytes instead of the default 1024 bytes."
+#define HELP_echo "usage: echo [-ne] [args...]\n\nWrite each argument to stdout, with one space between each, followed\nby a newline.\n\n-n No trailing newline\n-e Process the following escape sequences:\n \\\\ Backslash\n \\0NNN Octal values (1 to 3 digits)\n \\a Alert (beep/flash)\n \\b Backspace\n \\c Stop output here (avoids trailing newline)\n \\f Form feed\n \\n Newline\n \\r Carriage return\n \\t Horizontal tab\n \\v Vertical tab\n \\xHH Hexadecimal values (1 to 2 digits)\n\n"
-#define HELP_date "usage: date [-u] [-r FILE] [-d DATE] [+DISPLAY_FORMAT] [-D SET_FORMAT] [SET]\n\nSet/get the current date/time. With no SET shows the current date.\n\n-d Show DATE instead of current time (convert date format)\n-D +FORMAT for SET or -d (instead of MMDDhhmm[[CC]YY][.ss])\n-r Use modification time of FILE instead of current date\n-u Use UTC instead of current timezone\n\nSupported input formats:\n\nMMDDhhmm[[CC]YY][.ss] POSIX\n@UNIXTIME[.FRACTION] seconds since midnight 1970-01-01\nYYYY-MM-DD [hh:mm[:ss]] ISO 8601\nhh:mm[:ss] 24-hour time today\n\nAll input formats can be preceded by TZ=\"id\" to set the input time zone\nseparately from the output time zone. Otherwise $TZ sets both.\n\n+FORMAT specifies display format string using strftime(3) syntax:\n\n%% literal % %n newline %t tab\n%S seconds (00-60) %M minute (00-59) %m month (01-12)\n%H hour (0-23) %I hour (01-12) %p AM/PM\n%y short year (00-99) %Y year %C century\n%a short weekday name %A weekday name %u day of week (1-7, 1=mon)\n%b short month name %B month name %Z timezone name\n%j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)\n%N nanosec (output only)\n\n%U Week of year (0-53 start sunday) %W Week of year (0-53 start monday)\n%V Week of year (1-53 start monday, week < 4 days not part of this year)\n\n%D = \"%m/%d/%y\" %r = \"%I : %M : %S %p\" %T = \"%H:%M:%S\" %h = \"%b\"\n%x locale date %X locale time %c locale date/time"
+#define HELP_du "usage: du [-d N] [-askxHLlmc] [file...]\n\nShow disk usage, space consumed by files and directories.\n\nSize in:\n-k 1024 byte blocks (default)\n-K 512 byte blocks (posix)\n-m Megabytes\n-h Human readable (e.g., 1K 243M 2G)\n\nWhat to show:\n-a All files, not just directories\n-H Follow symlinks on cmdline\n-L Follow all symlinks\n-s Only total size of each argument\n-x Don't leave this filesystem\n-c Cumulative total\n-d N Only depth < N\n-l Disable hardlink filter\n\n"
-#define HELP_cut "usage: cut [-Ds] [-bcfF LIST] [-dO DELIM] [FILE...]\n\nPrint selected parts of lines from each FILE to standard output.\n\nEach selection LIST is comma separated, either numbers (counting from 1)\nor dash separated ranges (inclusive, with X- meaning to end of line and -X\nfrom start). By default selection ranges are sorted and collated, use -D\nto prevent that.\n\n-b Select bytes\n-c Select UTF-8 characters\n-C Select unicode columns\n-d Use DELIM (default is TAB for -f, run of whitespace for -F)\n-D Don't sort/collate selections or match -fF lines without delimiter\n-f Select fields (words) separated by single DELIM character\n-F Select fields separated by DELIM regex\n-O Output delimiter (default one space for -F, input delim for -f)\n-s Skip lines without delimiters"
+#define HELP_dirname "usage: dirname PATH...\n\nShow directory portion of path.\n\n"
-#define HELP_cpio "usage: cpio -{o|t|i|p DEST} [-v] [--verbose] [-F FILE] [--no-preserve-owner]\n [ignored: -mdu -H newc]\n\nCopy files into and out of a \"newc\" format cpio archive.\n\n-F FILE Use archive FILE instead of stdin/stdout\n-p DEST Copy-pass mode, copy stdin file list to directory DEST\n-i Extract from archive into file system (stdin=archive)\n-o Create archive (stdin=list of files, stdout=archive)\n-t Test files (list only, stdin=archive, stdout=list of files)\n-v Verbose\n--no-preserve-owner (don't set ownership during extract)\n--trailer Add legacy trailer (prevents concatenation)"
+#define HELP_df "usage: df [-HPkhi] [-t type] [FILESYSTEM ...]\n\nThe \"disk free\" command shows total/used/available disk space for\neach filesystem listed on the command line, or all currently mounted\nfilesystems.\n\n-a Show all (including /proc and friends)\n-P The SUSv3 \"Pedantic\" option\n-k Sets units back to 1024 bytes (the default without -P)\n-h Human readable (K=1024)\n-H Human readable (k=1000)\n-i Show inodes instead of blocks\n-t type Display only filesystems of this type\n\nPedantic provides a slightly less useful output format dictated by Posix,\nand sets the units to 512 bytes instead of the default 1024 bytes.\n\n"
-#define HELP_install "usage: install [-dDpsv] [-o USER] [-g GROUP] [-m MODE] [SOURCE...] DEST\n\nCopy files and set attributes.\n\n-d Act like mkdir -p\n-D Create leading directories for DEST\n-g Make copy belong to GROUP\n-m Set permissions to MODE\n-o Make copy belong to USER\n-p Preserve timestamps\n-s Call \"strip -p\"\n-v Verbose"
+#define HELP_date "usage: date [-u] [-r FILE] [-d DATE] [+DISPLAY_FORMAT] [-D SET_FORMAT] [SET]\n\nSet/get the current date/time. With no SET shows the current date.\n\n-d Show DATE instead of current time (convert date format)\n-D +FORMAT for SET or -d (instead of MMDDhhmm[[CC]YY][.ss])\n-r Use modification time of FILE instead of current date\n-u Use UTC instead of current timezone\n\nSupported input formats:\n\nMMDDhhmm[[CC]YY][.ss] POSIX\n@UNIXTIME[.FRACTION] seconds since midnight 1970-01-01\nYYYY-MM-DD [hh:mm[:ss]] ISO 8601\nhh:mm[:ss] 24-hour time today\n\nAll input formats can be preceded by TZ=\"id\" to set the input time zone\nseparately from the output time zone. Otherwise $TZ sets both.\n\n+FORMAT specifies display format string using strftime(3) syntax:\n\n%% literal % %n newline %t tab\n%S seconds (00-60) %M minute (00-59) %m month (01-12)\n%H hour (0-23) %I hour (01-12) %p AM/PM\n%y short year (00-99) %Y year %C century\n%a short weekday name %A weekday name %u day of week (1-7, 1=mon)\n%b short month name %B month name %Z timezone name\n%j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)\n%N nanosec (output only)\n\n%U Week of year (0-53 start sunday) %W Week of year (0-53 start monday)\n%V Week of year (1-53 start monday, week < 4 days not part of this year)\n\n%D = \"%m/%d/%y\" %r = \"%I : %M : %S %p\" %T = \"%H:%M:%S\" %h = \"%b\"\n%x locale date %X locale time %c locale date/time\n\n"
-#define HELP_mv "usage: mv [-fivn] SOURCE... DEST\n\n-f Force copy by deleting destination file\n-i Interactive, prompt before overwriting existing DEST\n-v Verbose\n-n No clobber (don't overwrite DEST)"
+#define HELP_cut "usage: cut [-Ds] [-bcfF LIST] [-dO DELIM] [FILE...]\n\nPrint selected parts of lines from each FILE to standard output.\n\nEach selection LIST is comma separated, either numbers (counting from 1)\nor dash separated ranges (inclusive, with X- meaning to end of line and -X\nfrom start). By default selection ranges are sorted and collated, use -D\nto prevent that.\n\n-b Select bytes\n-c Select UTF-8 characters\n-C Select unicode columns\n-d Use DELIM (default is TAB for -f, run of whitespace for -F)\n-D Don't sort/collate selections or match -fF lines without delimiter\n-f Select fields (words) separated by single DELIM character\n-F Select fields separated by DELIM regex\n-O Output delimiter (default one space for -F, input delim for -f)\n-s Skip lines without delimiters\n\n"
-#define HELP_cp_preserve "--preserve takes either a comma separated list of attributes, or the first\nletter(s) of:\n\n mode - permissions (ignore umask for rwx, copy suid and sticky bit)\n ownership - user and group\n timestamps - file creation, modification, and access times.\n context - security context\n xattr - extended attributes\n all - all of the above\n\nusage: cp [--preserve=motcxa] [-adlnrsvfipRHLP] SOURCE... DEST\n\nCopy files from SOURCE to DEST. If more than one SOURCE, DEST must\nbe a directory.\n-v Verbose\n-s Symlink instead of copy\n-r Synonym for -R\n-n No clobber (don't overwrite DEST)\n-l Hard link instead of copy\n-d Don't dereference symlinks\n-a Same as -dpr\n-P Do not follow symlinks [default]\n-L Follow all symlinks\n-H Follow symlinks listed on command line\n-R Recurse into subdirectories (DEST must be a directory)\n-p Preserve timestamps, ownership, and mode\n-i Interactive, prompt before overwriting existing DEST\n-F Delete any existing destination file first (--remove-destination)\n-f Delete destination files we can't write to\n-D Create leading dirs under DEST (--parents)"
+#define HELP_cpio "usage: cpio -{o|t|i|p DEST} [-v] [--verbose] [-F FILE] [--no-preserve-owner]\n [ignored: -mdu -H newc]\n\nCopy files into and out of a \"newc\" format cpio archive.\n\n-F FILE Use archive FILE instead of stdin/stdout\n-p DEST Copy-pass mode, copy stdin file list to directory DEST\n-i Extract from archive into file system (stdin=archive)\n-o Create archive (stdin=list of files, stdout=archive)\n-t Test files (list only, stdin=archive, stdout=list of files)\n-v Verbose\n--no-preserve-owner (don't set ownership during extract)\n--trailer Add legacy trailer (prevents concatenation)\n\n"
-#define HELP_cp "usage: cp [--preserve=motcxa] [-adlnrsvfipRHLP] SOURCE... DEST\n\nCopy files from SOURCE to DEST. If more than one SOURCE, DEST must\nbe a directory.\n-v Verbose\n-s Symlink instead of copy\n-r Synonym for -R\n-n No clobber (don't overwrite DEST)\n-l Hard link instead of copy\n-d Don't dereference symlinks\n-a Same as -dpr\n-P Do not follow symlinks [default]\n-L Follow all symlinks\n-H Follow symlinks listed on command line\n-R Recurse into subdirectories (DEST must be a directory)\n-p Preserve timestamps, ownership, and mode\n-i Interactive, prompt before overwriting existing DEST\n-F Delete any existing destination file first (--remove-destination)\n-f Delete destination files we can't write to\n-D Create leading dirs under DEST (--parents)\n--preserve takes either a comma separated list of attributes, or the first\nletter(s) of:\n\n mode - permissions (ignore umask for rwx, copy suid and sticky bit)\n ownership - user and group\n timestamps - file creation, modification, and access times.\n context - security context\n xattr - extended attributes\n all - all of the above"
+#define HELP_install "usage: install [-dDpsv] [-o USER] [-g GROUP] [-m MODE] [SOURCE...] DEST\n\nCopy files and set attributes.\n\n-d Act like mkdir -p\n-D Create leading directories for DEST\n-g Make copy belong to GROUP\n-m Set permissions to MODE\n-o Make copy belong to USER\n-p Preserve timestamps\n-s Call \"strip -p\"\n-v Verbose\n\n"
-#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_mv "usage: mv [-fivn] SOURCE... DEST\n\n-f Force copy by deleting destination file\n-i Interactive, prompt before overwriting existing DEST\n-v Verbose\n-n No clobber (don't overwrite DEST)\n\n"
-#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_cp_preserve "--preserve takes either a comma separated list of attributes, or the first\nletter(s) of:\n\n mode - permissions (ignore umask for rwx, copy suid and sticky bit)\n ownership - user and group\n timestamps - file creation, modification, and access times.\n context - security context\n xattr - extended attributes\n all - all of the above\n\nusage: cp [--preserve=motcxa] [-adlnrsvfipRHLP] SOURCE... DEST\n\nCopy files from SOURCE to DEST. If more than one SOURCE, DEST must\nbe a directory.\n-v Verbose\n-s Symlink instead of copy\n-r Synonym for -R\n-n No clobber (don't overwrite DEST)\n-l Hard link instead of copy\n-d Don't dereference symlinks\n-a Same as -dpr\n-P Do not follow symlinks [default]\n-L Follow all symlinks\n-H Follow symlinks listed on command line\n-R Recurse into subdirectories (DEST must be a directory)\n-p Preserve timestamps, ownership, and mode\n-i Interactive, prompt before overwriting existing DEST\n-F Delete any existing destination file first (--remove-destination)\n-f Delete destination files we can't write to\n-D Create leading dirs under DEST (--parents)\n"
-#define HELP_crc32 "usage: crc32 [file...]\n\nOutput crc32 checksum for each file."
+#define HELP_cp "usage: cp [--preserve=motcxa] [-adlnrsvfipRHLP] SOURCE... DEST\n\nCopy files from SOURCE to DEST. If more than one SOURCE, DEST must\nbe a directory.\n-v Verbose\n-s Symlink instead of copy\n-r Synonym for -R\n-n No clobber (don't overwrite DEST)\n-l Hard link instead of copy\n-d Don't dereference symlinks\n-a Same as -dpr\n-P Do not follow symlinks [default]\n-L Follow all symlinks\n-H Follow symlinks listed on command line\n-R Recurse into subdirectories (DEST must be a directory)\n-p Preserve timestamps, ownership, and mode\n-i Interactive, prompt before overwriting existing DEST\n-F Delete any existing destination file first (--remove-destination)\n-f Delete destination files we can't write to\n-D Create leading dirs under DEST (--parents)\n--preserve takes either a comma separated list of attributes, or the first\nletter(s) of:\n\n mode - permissions (ignore umask for rwx, copy suid and sticky bit)\n ownership - user and group\n timestamps - file creation, modification, and access times.\n context - security context\n xattr - extended attributes\n all - all of the above\n\n"
-#define HELP_cksum "usage: cksum [-IPLN] [file...]\n\nFor each file, output crc32 checksum value, length and name of file.\nIf no files listed, copy from stdin. Filename \"-\" is a synonym for stdin.\n\n-H Hexadecimal checksum (defaults to decimal)\n-L Little endian (defaults to big endian)\n-P Pre-inversion\n-I Skip post-inversion\n-N Do not include length in CRC calculation (or output)"
+#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\n\n"
-#define HELP_chmod "usage: chmod [-R] MODE FILE...\n\nChange mode of listed file[s] (recursively with -R).\n\nMODE can be (comma-separated) stanzas: [ugoa][+-=][rwxstXugo]\n\nStanzas are applied in order: For each category (u = user,\ng = group, o = other, a = all three, if none specified default is a),\nset (+), clear (-), or copy (=), r = read, w = write, x = execute.\ns = u+s = suid, g+s = sgid, o+s = sticky. (+t is an alias for o+s).\nsuid/sgid: execute as the user/group who owns the file.\nsticky: can't delete files you don't own out of this directory\nX = x for directories or if any category already has x set.\n\nOr MODE can be an octal value up to 7777 ug uuugggooo top +\nbit 1 = o+x, bit 1<<8 = u+w, 1<<11 = g+1 sstrwxrwxrwx bottom\n\nExamples:\nchmod u+w file - allow owner of \"file\" to write to it.\nchmod 744 file - user can read/write/execute, everyone else read only"
+#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\n\n"
-#define HELP_chown "see: chgrp"
+#define HELP_crc32 "usage: crc32 [file...]\n\nOutput crc32 checksum for each file.\n\n"
-#define HELP_chgrp "usage: chgrp/chown [-RHLP] [-fvh] group file...\n\nChange group of one or more files.\n\n-f Suppress most error messages\n-h Change symlinks instead of what they point to\n-R Recurse into subdirectories (implies -h)\n-H With -R change target of symlink, follow command line symlinks\n-L With -R change target of symlink, follow all symlinks\n-P With -R change symlink, do not follow symlinks (default)\n-v Verbose"
+#define HELP_cksum "usage: cksum [-IPLN] [file...]\n\nFor each file, output crc32 checksum value, length and name of file.\nIf no files listed, copy from stdin. Filename \"-\" is a synonym for stdin.\n\n-H Hexadecimal checksum (defaults to decimal)\n-L Little endian (defaults to big endian)\n-P Pre-inversion\n-I Skip post-inversion\n-N Do not include length in CRC calculation (or output)\n\n"
-#define HELP_catv "usage: catv [-evt] [filename...]\n\nDisplay nonprinting characters as escape sequences. Use M-x for\nhigh ascii characters (>127), and ^x for other nonprinting chars.\n\n-e Mark each newline with $\n-t Show tabs as ^I\n-v Don't use ^x or M-x escapes"
+#define HELP_chmod "usage: chmod [-R] MODE FILE...\n\nChange mode of listed file[s] (recursively with -R).\n\nMODE can be (comma-separated) stanzas: [ugoa][+-=][rwxstXugo]\n\nStanzas are applied in order: For each category (u = user,\ng = group, o = other, a = all three, if none specified default is a),\nset (+), clear (-), or copy (=), r = read, w = write, x = execute.\ns = u+s = suid, g+s = sgid, o+s = sticky. (+t is an alias for o+s).\nsuid/sgid: execute as the user/group who owns the file.\nsticky: can't delete files you don't own out of this directory\nX = x for directories or if any category already has x set.\n\nOr MODE can be an octal value up to 7777 ug uuugggooo top +\nbit 1 = o+x, bit 1<<8 = u+w, 1<<11 = g+1 sstrwxrwxrwx bottom\n\nExamples:\nchmod u+w file - allow owner of \"file\" to write to it.\nchmod 744 file - user can read/write/execute, everyone else read only\n\n"
-#define HELP_cat "usage: cat [-etuv] [file...]\n\nCopy (concatenate) files to stdout. If no files listed, copy from stdin.\nFilename \"-\" is a synonym for stdin.\n\n-e Mark each newline with $\n-t Show tabs as ^I\n-u Copy one byte at a time (slow)\n-v Display nonprinting characters as escape sequences with M-x for\n high ascii characters (>127), and ^x for other nonprinting chars"
+#define HELP_chown "see: chgrp\n\n"
-#define HELP_cal "usage: cal [[month] year]\n\nPrint a calendar.\n\nWith one argument, prints all months of the specified year.\nWith two arguments, prints calendar for month and year."
+#define HELP_chgrp "usage: chgrp/chown [-RHLP] [-fvh] group file...\n\nChange group of one or more files.\n\n-f Suppress most error messages\n-h Change symlinks instead of what they point to\n-R Recurse into subdirectories (implies -h)\n-H With -R change target of symlink, follow command line symlinks\n-L With -R change target of symlink, follow all symlinks\n-P With -R change symlink, do not follow symlinks (default)\n-v Verbose\n\n"
-#define HELP_basename "usage: basename [-a] [-s SUFFIX] NAME... | NAME [SUFFIX]\n\nReturn non-directory portion of a pathname removing suffix.\n\n-a All arguments are names\n-s SUFFIX Remove suffix (implies -a)"
+#define HELP_catv "usage: catv [-evt] [filename...]\n\nDisplay nonprinting characters as escape sequences. Use M-x for\nhigh ascii characters (>127), and ^x for other nonprinting chars.\n\n-e Mark each newline with $\n-t Show tabs as ^I\n-v Don't use ^x or M-x escapes\n\n"
+
+#define HELP_cat "usage: cat [-etuv] [file...]\n\nCopy (concatenate) files to stdout. If no files listed, copy from stdin.\nFilename \"-\" is a synonym for stdin.\n\n-e Mark each newline with $\n-t Show tabs as ^I\n-u Copy one byte at a time (slow)\n-v Display nonprinting characters as escape sequences with M-x for\n high ascii characters (>127), and ^x for other nonprinting chars\n"
+
+#define HELP_cal "usage: cal [[month] year]\n\nPrint a calendar.\n\nWith one argument, prints all months of the specified year.\nWith two arguments, prints calendar for month and year.\n\n"
+
+#define HELP_basename "usage: basename [-a] [-s SUFFIX] NAME... | NAME [SUFFIX]\n\nReturn non-directory portion of a pathname removing suffix.\n\n-a All arguments are names\n-s SUFFIX Remove suffix (implies -a)\n\n"
diff --git a/android/linux/generated/newtoys.h b/generated/newtoys.h
index 62b1d24a..fd6e7163 100644
--- a/android/linux/generated/newtoys.h
+++ b/generated/newtoys.h
@@ -1,21 +1,17 @@
USE_TOYBOX(NEWTOY(toybox, NULL, TOYFLAG_STAYROOT))
-USE_SH(OLDTOY(-bash, sh, 0))
USE_SH(OLDTOY(-sh, sh, 0))
USE_SH(OLDTOY(-toysh, sh, 0))
USE_TRUE(OLDTOY(:, true, TOYFLAG_NOFORK|TOYFLAG_NOHELP))
-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))
USE_BASE64(NEWTOY(base64, "diw#<0=76[!dw]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_BASENAME(NEWTOY(basename, "^<1as:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SH(OLDTOY(bash, sh, TOYFLAG_BIN))
+USE_BASENAME(NEWTOY(basename, "<1as:", TOYFLAG_USR|TOYFLAG_BIN))
USE_BC(NEWTOY(bc, "i(interactive)l(mathlib)q(quiet)s(standard)w(warn)", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_BLKID(NEWTOY(blkid, "ULs*[!LU]", TOYFLAG_BIN))
+USE_BLKID(NEWTOY(blkid, "UL[!LU]", TOYFLAG_BIN))
USE_BLOCKDEV(NEWTOY(blockdev, "<1>1(setro)(setrw)(getro)(getss)(getbsz)(setbsz)#<0(getsz)(getsize)(getsize64)(getra)(setra)#<0(flushbufs)(rereadpt)",TOYFLAG_SBIN))
USE_BOOTCHARTD(NEWTOY(bootchartd, 0, TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
USE_BRCTL(NEWTOY(brctl, "<1", TOYFLAG_USR|TOYFLAG_SBIN))
@@ -35,7 +31,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, "<1>2ls(silent)(quiet)[!ls]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
+USE_CMP(NEWTOY(cmp, "<2>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))
@@ -50,7 +46,7 @@ USE_DEALLOCVT(NEWTOY(deallocvt, ">1", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_NEEDROOT))
USE_GROUPDEL(OLDTOY(delgroup, groupdel, TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
USE_USERDEL(OLDTOY(deluser, userdel, TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
USE_DEMO_MANY_OPTIONS(NEWTOY(demo_many_options, "ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba", TOYFLAG_BIN))
-USE_DEMO_NUMBER(NEWTOY(demo_number, "D#=3<3hdbs", TOYFLAG_BIN))
+USE_DEMO_NUMBER(NEWTOY(demo_number, "hdbs", TOYFLAG_BIN))
USE_DEMO_SCANKEY(NEWTOY(demo_scankey, 0, TOYFLAG_BIN))
USE_DEMO_UTF8TOWC(NEWTOY(demo_utf8towc, 0, TOYFLAG_USR|TOYFLAG_BIN))
USE_DEVMEM(NEWTOY(devmem, "<1>3", TOYFLAG_USR|TOYFLAG_BIN))
@@ -58,14 +54,13 @@ USE_DF(NEWTOY(df, "HPkhit*a[-HPkh]", TOYFLAG_SBIN))
USE_DHCP(NEWTOY(dhcp, "V:H:F:x*r:O*A#<0=20T#<0=3t#<0=3s:p:i:SBRCaovqnbf", TOYFLAG_SBIN|TOYFLAG_ROOTONLY))
USE_DHCP6(NEWTOY(dhcp6, "r:A#<0T#<0t#<0s:p:i:SRvqnbf", TOYFLAG_SBIN|TOYFLAG_ROOTONLY))
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_DIFF(NEWTOY(diff, "<2>2(color)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))
-USE_ECHO(NEWTOY(echo, "^?Een[-eE]", TOYFLAG_BIN|TOYFLAG_MAYFORK))
+USE_ECHO(NEWTOY(echo, "^?en", TOYFLAG_BIN))
USE_EGREP(OLDTOY(egrep, grep, TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
USE_EJECT(NEWTOY(eject, ">1stT[!tT]", TOYFLAG_USR|TOYFLAG_BIN))
USE_ENV(NEWTOY(env, "^0iu*", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(125)))
@@ -77,7 +72,7 @@ USE_FALLOCATE(NEWTOY(fallocate, ">1l#|o#", TOYFLAG_USR|TOYFLAG_BIN))
USE_FALSE(NEWTOY(false, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP))
USE_FDISK(NEWTOY(fdisk, "C#<0H#<0S#<0b#<512ul", TOYFLAG_SBIN))
USE_FGREP(OLDTOY(fgrep, grep, TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
-USE_FILE(NEWTOY(file, "<1bhLs[!hL]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_FILE(NEWTOY(file, "<1hL[!hL]", TOYFLAG_USR|TOYFLAG_BIN))
USE_FIND(NEWTOY(find, "?^HL[-HL]", TOYFLAG_USR|TOYFLAG_BIN))
USE_FLOCK(NEWTOY(flock, "<1>1nsux[-sux]", TOYFLAG_USR|TOYFLAG_BIN))
USE_FMT(NEWTOY(fmt, "w#<0=75", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
@@ -93,13 +88,14 @@ USE_FTPPUT(OLDTOY(ftpput, ftpget, TOYFLAG_USR|TOYFLAG_BIN))
USE_GETCONF(NEWTOY(getconf, ">2al", TOYFLAG_USR|TOYFLAG_BIN))
USE_GETENFORCE(NEWTOY(getenforce, ">0", TOYFLAG_USR|TOYFLAG_SBIN))
USE_GETFATTR(NEWTOY(getfattr, "(only-values)dhn:", TOYFLAG_USR|TOYFLAG_BIN))
+USE_GETPROP(NEWTOY(getprop, ">2Z", TOYFLAG_USR|TOYFLAG_SBIN))
USE_GETTY(NEWTOY(getty, "<2t#<0H:I:l:f:iwnmLh",TOYFLAG_SBIN))
-USE_GREP(NEWTOY(grep, "(line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]", TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
+USE_GREP(NEWTOY(grep, "(color):;S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]", TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
USE_GROUPADD(NEWTOY(groupadd, "<1>2g#<0S", TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
USE_GROUPDEL(NEWTOY(groupdel, "<1>2", TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
USE_GROUPS(NEWTOY(groups, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_GUNZIP(NEWTOY(gunzip, "cdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_GZIP(NEWTOY(gzip, "ncdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_GZIP(NEWTOY(gzip, "cdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
USE_REBOOT(OLDTOY(halt, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
USE_HEAD(NEWTOY(head, "?n(lines)#<0=10c(bytes)#<0qv[-nc]", TOYFLAG_USR|TOYFLAG_BIN))
USE_HELLO(NEWTOY(hello, 0, TOYFLAG_USR|TOYFLAG_BIN))
@@ -132,19 +128,19 @@ USE_IP(OLDTOY(iproute, ip, TOYFLAG_SBIN))
USE_IP(OLDTOY(iprule, ip, TOYFLAG_SBIN))
USE_IP(OLDTOY(iptunnel, ip, TOYFLAG_SBIN))
USE_KILL(NEWTOY(kill, "?ls: ", TOYFLAG_BIN))
-USE_KILLALL(NEWTOY(killall, "?s:ilqvw", TOYFLAG_USR|TOYFLAG_BIN))
+USE_KILLALL(NEWTOY(killall, "?s:lqvi", TOYFLAG_USR|TOYFLAG_BIN))
USE_KILLALL5(NEWTOY(killall5, "?o*ls: [!lo][!ls]", TOYFLAG_SBIN))
USE_KLOGD(NEWTOY(klogd, "c#<1>8n", TOYFLAG_SBIN))
USE_LAST(NEWTOY(last, "f:W", TOYFLAG_BIN))
USE_LINK(NEWTOY(link, "<2>2", TOYFLAG_USR|TOYFLAG_BIN))
-USE_LN(NEWTOY(ln, "<1t:Tvnfs", TOYFLAG_BIN))
+USE_LN(NEWTOY(ln, "<1vnfs", TOYFLAG_BIN))
USE_LOAD_POLICY(NEWTOY(load_policy, "<1>1", TOYFLAG_USR|TOYFLAG_SBIN))
USE_LOG(NEWTOY(log, "<1p:t:", TOYFLAG_USR|TOYFLAG_SBIN))
USE_LOGGER(NEWTOY(logger, "st:p:", TOYFLAG_USR|TOYFLAG_BIN))
USE_LOGIN(NEWTOY(login, ">1f:ph:", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
USE_LOGNAME(NEWTOY(logname, ">0", TOYFLAG_USR|TOYFLAG_BIN))
USE_LOGWRAPPER(NEWTOY(logwrapper, 0, TOYFLAG_NOHELP|TOYFLAG_USR|TOYFLAG_BIN))
-USE_LOSETUP(NEWTOY(losetup, ">2S(sizelimit)#s(show)ro#j:fdcaD[!afj]", TOYFLAG_SBIN))
+USE_LOSETUP(NEWTOY(losetup, ">2S(sizelimit)#s(show)ro#j:fdca[!afj]", TOYFLAG_SBIN))
USE_LS(NEWTOY(ls, "(color):;(full-time)(show-control-chars)ZgoACFHLRSabcdfhikl@mnpqrstux1[-Cxm1][-Cxml][-Cxmo][-Cxmg][-cu][-ftS][-HL][!qb]", TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_LSATTR(NEWTOY(lsattr, "vldaR", TOYFLAG_BIN))
USE_LSMOD(NEWTOY(lsmod, NULL, TOYFLAG_SBIN))
@@ -152,7 +148,6 @@ USE_LSOF(NEWTOY(lsof, "lp*t", TOYFLAG_USR|TOYFLAG_BIN))
USE_LSPCI(NEWTOY(lspci, "emkn"USE_LSPCI_TEXT("@i:"), TOYFLAG_USR|TOYFLAG_BIN))
USE_LSUSB(NEWTOY(lsusb, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_MAKEDEVS(NEWTOY(makedevs, "<1>1d:", TOYFLAG_USR|TOYFLAG_BIN))
-USE_MAN(NEWTOY(man, "k:M:", TOYFLAG_USR|TOYFLAG_BIN))
USE_MCOOKIE(NEWTOY(mcookie, "v(verbose)V(version)", TOYFLAG_USR|TOYFLAG_BIN))
USE_MD5SUM(NEWTOY(md5sum, "bc(check)s(status)[!bc]", TOYFLAG_USR|TOYFLAG_BIN))
USE_MDEV(NEWTOY(mdev, "s", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_UMASK))
@@ -164,7 +159,7 @@ USE_MKFIFO(NEWTOY(mkfifo, "<1"USE_MKFIFO_Z("Z:")"m:", TOYFLAG_USR|TOYFLAG_BIN))
USE_MKNOD(NEWTOY(mknod, "<2>4m(mode):"USE_MKNOD_Z("Z:"), TOYFLAG_BIN|TOYFLAG_UMASK))
USE_MKPASSWD(NEWTOY(mkpasswd, ">2S:m:P#=0<0", TOYFLAG_USR|TOYFLAG_BIN))
USE_MKSWAP(NEWTOY(mkswap, "<1>1L:", TOYFLAG_SBIN))
-USE_MKTEMP(NEWTOY(mktemp, ">1(tmpdir);:uqd(directory)p:t", TOYFLAG_BIN))
+USE_MKTEMP(NEWTOY(mktemp, ">1uqd(directory)p(tmpdir):t", TOYFLAG_BIN))
USE_MODINFO(NEWTOY(modinfo, "<1b:k:F:0", TOYFLAG_SBIN))
USE_MODPROBE(NEWTOY(modprobe, "alrqvsDbd*", TOYFLAG_SBIN))
USE_MORE(NEWTOY(more, 0, TOYFLAG_USR|TOYFLAG_BIN))
@@ -174,10 +169,10 @@ USE_MV(NEWTOY(mv, "<2vnF(remove-destination)fi[-ni]", TOYFLAG_BIN))
USE_NBD_CLIENT(OLDTOY(nbd-client, nbd_client, TOYFLAG_USR|TOYFLAG_BIN))
USE_NBD_CLIENT(NEWTOY(nbd_client, "<3>3ns", 0))
USE_NETCAT(OLDTOY(nc, netcat, TOYFLAG_USR|TOYFLAG_BIN))
-USE_NETCAT(NEWTOY(netcat, USE_NETCAT_LISTEN("^tlL")"w#<1W#<1p#<1>65535q#<1s:f:46uU"USE_NETCAT_LISTEN("[!tlL][!Lw]")"[!46U]", TOYFLAG_BIN))
+USE_NETCAT(NEWTOY(netcat, USE_NETCAT_LISTEN("^tlL")"w#<1W#<1p#<1>65535q#<1s:f:46u"USE_NETCAT_LISTEN("[!tlL][!Lw]")"[!46]", TOYFLAG_BIN))
USE_NETSTAT(NEWTOY(netstat, "pWrxwutneal", TOYFLAG_BIN))
USE_NICE(NEWTOY(nice, "^<1n#", TOYFLAG_BIN))
-USE_NL(NEWTOY(nl, "v#=1l#w#<0=6Eb:n:s:", TOYFLAG_USR|TOYFLAG_BIN))
+USE_NL(NEWTOY(nl, "v#<1=1l#w#<0=6Eb:n:s:", TOYFLAG_USR|TOYFLAG_BIN))
USE_NOHUP(NEWTOY(nohup, "<1^", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(125)))
USE_NPROC(NEWTOY(nproc, "(all)", TOYFLAG_USR|TOYFLAG_BIN))
USE_NSENTER(NEWTOY(nsenter, "<1F(no-fork)t#<1(target)i:(ipc);m:(mount);n:(net);p:(pid);u:(uts);U:(user);", TOYFLAG_USR|TOYFLAG_BIN))
@@ -187,9 +182,9 @@ USE_OPENVT(NEWTOY(openvt, "c#<1>63sw", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
USE_PARTPROBE(NEWTOY(partprobe, "<1", TOYFLAG_SBIN))
USE_PASSWD(NEWTOY(passwd, ">1a:dlu", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
USE_PASTE(NEWTOY(paste, "d:s", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_PATCH(NEWTOY(patch, "(no-backup-if-mismatch)(dry-run)"USE_TOYBOX_DEBUG("x")"g#fulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
+USE_PATCH(NEWTOY(patch, "(dry-run)"USE_TOYBOX_DEBUG("x")"ulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
USE_PGREP(NEWTOY(pgrep, "?cld:u*U*t*s*P*g*G*fnovxL:[-no]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_PIDOF(NEWTOY(pidof, "<1so:x", TOYFLAG_BIN))
+USE_PIDOF(NEWTOY(pidof, "<1so:", TOYFLAG_BIN))
USE_PING(NEWTOY(ping, "<1>1m#t#<0>255=64c#<0=3s#<0>4088=56i%W#<0=3w#<0qf46I:[-46]", TOYFLAG_USR|TOYFLAG_BIN))
USE_PING(OLDTOY(ping6, ping, TOYFLAG_USR|TOYFLAG_BIN))
USE_PIVOT_ROOT(NEWTOY(pivot_root, "<2>2", TOYFLAG_SBIN))
@@ -203,7 +198,7 @@ USE_PS(NEWTOY(ps, "k(sort)*P(ppid)*aAdeflMno*O*p(pid)*s*t*Tu*U*g*G*wZ[!ol][+Ae][
USE_PWD(NEWTOY(pwd, ">0LP[-LP]", TOYFLAG_BIN))
USE_PWDX(NEWTOY(pwdx, "<1a", TOYFLAG_USR|TOYFLAG_BIN))
USE_READAHEAD(NEWTOY(readahead, NULL, TOYFLAG_BIN))
-USE_READLINK(NEWTOY(readlink, "<1nqmef(canonicalize)[-mef]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_READLINK(NEWTOY(readlink, "<1>1nqmef(canonicalize)[-mef]", TOYFLAG_USR|TOYFLAG_BIN))
USE_REALPATH(NEWTOY(realpath, "<1", TOYFLAG_USR|TOYFLAG_BIN))
USE_REBOOT(NEWTOY(reboot, "fn", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
USE_RENICE(NEWTOY(renice, "<1gpun#|", TOYFLAG_USR|TOYFLAG_BIN))
@@ -212,7 +207,7 @@ USE_RESTORECON(NEWTOY(restorecon, "<1DFnRrv", TOYFLAG_USR|TOYFLAG_SBIN))
USE_REV(NEWTOY(rev, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_RFKILL(NEWTOY(rfkill, "<1>2", TOYFLAG_USR|TOYFLAG_SBIN))
USE_RM(NEWTOY(rm, "fiRrv[-fi]", TOYFLAG_BIN))
-USE_RMDIR(NEWTOY(rmdir, "<1(ignore-fail-on-non-empty)p", TOYFLAG_BIN))
+USE_RMDIR(NEWTOY(rmdir, "<1p", TOYFLAG_BIN))
USE_RMMOD(NEWTOY(rmmod, "<1wf", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
USE_ROUTE(NEWTOY(route, "?neA:", TOYFLAG_BIN))
USE_RUNCON(NEWTOY(runcon, "<2", TOYFLAG_USR|TOYFLAG_SBIN))
@@ -221,21 +216,24 @@ USE_SENDEVENT(NEWTOY(sendevent, "<4>4", TOYFLAG_USR|TOYFLAG_SBIN))
USE_SEQ(NEWTOY(seq, "<1>3?f:s:w[!fw]", TOYFLAG_USR|TOYFLAG_BIN))
USE_SETENFORCE(NEWTOY(setenforce, "<1>1", TOYFLAG_USR|TOYFLAG_SBIN))
USE_SETFATTR(NEWTOY(setfattr, "hn:|v:x:|[!xv]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_SETPROP(NEWTOY(setprop, "<2>2", TOYFLAG_USR|TOYFLAG_SBIN))
USE_SETSID(NEWTOY(setsid, "^<1t", TOYFLAG_USR|TOYFLAG_BIN))
USE_SH(NEWTOY(sh, "c:i", TOYFLAG_BIN))
USE_SHA1SUM(NEWTOY(sha1sum, "bc(check)s(status)[!bc]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TOYBOX_LIBCRYPTO(USE_SHA224SUM(OLDTOY(sha224sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_TOYBOX_LIBCRYPTO(USE_SHA256SUM(OLDTOY(sha256sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_TOYBOX_LIBCRYPTO(USE_SHA384SUM(OLDTOY(sha384sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_TOYBOX_LIBCRYPTO(USE_SHA512SUM(OLDTOY(sha512sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
+USE_SHA224SUM(OLDTOY(sha224sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN))
+USE_SHA256SUM(OLDTOY(sha256sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN))
+USE_SHA384SUM(OLDTOY(sha384sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN))
+USE_SHA512SUM(OLDTOY(sha512sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN))
USE_SHRED(NEWTOY(shred, "<1zxus#<1n#<1o#<0f", TOYFLAG_USR|TOYFLAG_BIN))
USE_SKELETON(NEWTOY(skeleton, "(walrus)(blubber):;(also):e@d*c#b:a", TOYFLAG_USR|TOYFLAG_BIN))
USE_SKELETON_ALIAS(NEWTOY(skeleton_alias, "b#dq", TOYFLAG_USR|TOYFLAG_BIN))
USE_SLEEP(NEWTOY(sleep, "<1", TOYFLAG_BIN))
-USE_SNTP(NEWTOY(sntp, ">1M :m :Sp:t#<0=1>16asdDqr#<4>17=10[!as]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_SNTP(NEWTOY(sntp, "M:m:Sp:asdDqr#<4>17=10[!as]", TOYFLAG_USR|TOYFLAG_BIN))
USE_SORT(NEWTOY(sort, USE_SORT_FLOAT("g")"S:T:m" "o:k*t:" "xVbMcszdfirun", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
USE_SPLIT(NEWTOY(split, ">2a#<1=2>9b#<1l#<1[!bl]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_START(NEWTOY(start, "", TOYFLAG_USR|TOYFLAG_SBIN))
USE_STAT(NEWTOY(stat, "<1c:(format)fLt", TOYFLAG_BIN))
+USE_STOP(NEWTOY(stop, "", TOYFLAG_USR|TOYFLAG_SBIN))
USE_STRINGS(NEWTOY(strings, "t:an#=4<1fo", TOYFLAG_USR|TOYFLAG_BIN))
USE_STTY(NEWTOY(stty, "?aF:g[!ag]", TOYFLAG_BIN))
USE_SU(NEWTOY(su, "^lmpu:g:c:s:[!lmp]", TOYFLAG_BIN|TOYFLAG_ROOTONLY))
@@ -248,13 +246,13 @@ USE_SYSCTL(NEWTOY(sysctl, "^neNqwpaA[!ap][!aq][!aw][+aA]", TOYFLAG_SBIN))
USE_SYSLOGD(NEWTOY(syslogd,">0l#<1>8=8R:b#<0>99=1s#<0=200m#<0>71582787=20O:p:f:a:nSKLD", TOYFLAG_SBIN|TOYFLAG_STAYROOT))
USE_TAC(NEWTOY(tac, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_TAIL(NEWTOY(tail, "?fc-n-[-cn]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TAR(NEWTOY(tar, "&(restrict)(full-time)(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(mode):(mtime):(group):(owner):(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):a[!txc][!jzJa]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_TAR(NEWTOY(tar, "&(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)j(bzip2)z(gzip)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):[!txc][!jz]", TOYFLAG_USR|TOYFLAG_BIN))
USE_TASKSET(NEWTOY(taskset, "<1^pa", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_STAYROOT))
USE_TCPSVD(NEWTOY(tcpsvd, "^<3c#=30<1C:b#=20<0u:l:hEv", TOYFLAG_USR|TOYFLAG_BIN))
USE_TEE(NEWTOY(tee, "ia", TOYFLAG_USR|TOYFLAG_BIN))
USE_TELNET(NEWTOY(telnet, "<1>2", TOYFLAG_BIN))
USE_TELNETD(NEWTOY(telnetd, "w#<0b:p#<0>65535=23f:l:FSKi[!wi]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TEST(NEWTOY(test, 0, TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
+USE_TEST(NEWTOY(test, 0, TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_NOHELP))
USE_TFTP(NEWTOY(tftp, "<1b#<8>65464r:l:g|p|[!gp]", TOYFLAG_USR|TOYFLAG_BIN))
USE_TFTPD(NEWTOY(tftpd, "rcu:l", TOYFLAG_BIN))
USE_TIME(NEWTOY(time, "<1^pv", TOYFLAG_USR|TOYFLAG_BIN))
@@ -290,11 +288,11 @@ USE_VMSTAT(NEWTOY(vmstat, ">2n", TOYFLAG_BIN))
USE_W(NEWTOY(w, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_WATCH(NEWTOY(watch, "^<1n%<100=2000tebx", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_WC(NEWTOY(wc, "mcwl", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_WGET(NEWTOY(wget, "(no-check-certificate)O:", TOYFLAG_USR|TOYFLAG_BIN))
+USE_WGET(NEWTOY(wget, "f:", 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:P#optrn#<1(max-args)s#0[!0E]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_XARGS(NEWTOY(xargs, "^I:E:ptrn#<1s#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/tags.h b/generated/tags.h
index e1e4d314..31e77736 100644
--- a/android/linux/generated/tags.h
+++ b/generated/tags.h
@@ -1,17 +1,3 @@
-#define DD_conv_fsync 0
-#define _DD_conv_fsync (1<<0)
-#define DD_conv_noerror 1
-#define _DD_conv_noerror (1<<1)
-#define DD_conv_notrunc 2
-#define _DD_conv_notrunc (1<<2)
-#define DD_conv_sync 3
-#define _DD_conv_sync (1<<3)
-#define DD_iflag_count_bytes 0
-#define _DD_iflag_count_bytes (1<<0)
-#define DD_iflag_skip_bytes 1
-#define _DD_iflag_skip_bytes (1<<1)
-#define DD_oflag_seek_bytes 0
-#define _DD_oflag_seek_bytes (1<<0)
#define CP_mode 0
#define _CP_mode (1<<0)
#define CP_ownership 1
@@ -138,3 +124,69 @@
#define _PS_STAT (1LL<<56)
#define PS_PCY 57
#define _PS_PCY (1LL<<57)
+#define KEY_UP 0
+#define _KEY_UP (1<<0)
+#define KEY_DOWN 1
+#define _KEY_DOWN (1<<1)
+#define KEY_RIGHT 2
+#define _KEY_RIGHT (1<<2)
+#define KEY_LEFT 3
+#define _KEY_LEFT (1<<3)
+#define KEY_PGUP 4
+#define _KEY_PGUP (1<<4)
+#define KEY_PGDN 5
+#define _KEY_PGDN (1<<5)
+#define KEY_HOME 6
+#define _KEY_HOME (1<<6)
+#define KEY_END 7
+#define _KEY_END (1<<7)
+#define KEY_INSERT 8
+#define _KEY_INSERT (1<<8)
+#define KEY_F1 9
+#define _KEY_F1 (1<<9)
+#define KEY_F2 10
+#define _KEY_F2 (1<<10)
+#define KEY_F3 11
+#define _KEY_F3 (1<<11)
+#define KEY_F4 12
+#define _KEY_F4 (1<<12)
+#define KEY_F5 13
+#define _KEY_F5 (1<<13)
+#define KEY_F6 14
+#define _KEY_F6 (1<<14)
+#define KEY_F7 15
+#define _KEY_F7 (1<<15)
+#define KEY_F8 16
+#define _KEY_F8 (1<<16)
+#define KEY_F9 17
+#define _KEY_F9 (1<<17)
+#define KEY_SUP 18
+#define _KEY_SUP (1<<18)
+#define KEY_AUP 19
+#define _KEY_AUP (1<<19)
+#define KEY_CUP 20
+#define _KEY_CUP (1<<20)
+#define KEY_SDOWN 21
+#define _KEY_SDOWN (1<<21)
+#define KEY_ADOWN 22
+#define _KEY_ADOWN (1<<22)
+#define KEY_CDOWN 23
+#define _KEY_CDOWN (1<<23)
+#define KEY_SRIGHT 24
+#define _KEY_SRIGHT (1<<24)
+#define KEY_ARIGHT 25
+#define _KEY_ARIGHT (1<<25)
+#define KEY_CRIGHT 26
+#define _KEY_CRIGHT (1<<26)
+#define KEY_SLEFT 27
+#define _KEY_SLEFT (1<<27)
+#define KEY_ALEFT 28
+#define _KEY_ALEFT (1<<28)
+#define KEY_CLEFT 29
+#define _KEY_CLEFT (1<<29)
+#define KEY_SF1 30
+#define _KEY_SF1 (1<<30)
+#define KEY_AF1 31
+#define _KEY_AF1 (1<<31)
+#define KEY_CF1 32
+#define _KEY_CF1 (1LL<<32)
diff --git a/kconfig/Makefile b/kconfig/Makefile
index 90a8148e..f18938c9 100644
--- a/kconfig/Makefile
+++ b/kconfig/Makefile
@@ -74,4 +74,4 @@ kconfig/conf: $(SHIPPED)
-DPROJECT_NAME=\"$(KCONFIG_PROJECT)\"
clean::
- @rm -f $(wildcard kconfig/*zconf*.c) kconfig/conf kconfig/mconf
+ rm -f $(wildcard kconfig/*zconf*.c) kconfig/conf kconfig/mconf
diff --git a/kconfig/macos_miniconfig b/kconfig/macos_miniconfig
index 3f782b45..82f3ac54 100644
--- a/kconfig/macos_miniconfig
+++ b/kconfig/macos_miniconfig
@@ -53,9 +53,7 @@ CONFIG_SLEEP=y
CONFIG_SORT=y
CONFIG_SPLIT=y
CONFIG_STRINGS=y
-CONFIG_TAR=y
CONFIG_TEE=y
-CONFIG_TEST=y
CONFIG_TIME=y
CONFIG_TOUCH=y
CONFIG_TRUE=y
@@ -68,6 +66,7 @@ CONFIG_UUENCODE=y
CONFIG_WC=y
CONFIG_WHO=y
CONFIG_XARGS=y
+CONFIG_TR=y
CONFIG_ASCII=y
CONFIG_BASE64=y
CONFIG_CLEAR=y
@@ -105,7 +104,6 @@ CONFIG_HOSTNAME=y
CONFIG_MD5SUM=y
CONFIG_SHA1SUM=y
CONFIG_SEQ=y
-CONFIG_TAIL=y
CONFIG_TOYBOX_SUID=y
CONFIG_TOYBOX_FLOAT=y
CONFIG_TOYBOX_HELP=y
diff --git a/kconfig/symbol.c b/kconfig/symbol.c
index 6dbed0e5..ee225ced 100644
--- a/kconfig/symbol.c
+++ b/kconfig/symbol.c
@@ -55,14 +55,12 @@ void sym_init(void)
uname(&uts);
-/*
sym = sym_lookup("ARCH", 0);
sym->type = S_STRING;
sym->flags |= SYMBOL_AUTO;
p = getenv("ARCH");
if (p)
sym_add_default(sym, p);
-*/
sym = sym_lookup("KERNELVERSION", 0);
sym->type = S_STRING;
diff --git a/lib/args.c b/lib/args.c
index 89c82ca7..1ebc4f2d 100644
--- a/lib/args.c
+++ b/lib/args.c
@@ -3,9 +3,11 @@
* Copyright 2006 Rob Landley <rob@landley.net>
*/
-// NOTE: If option parsing segfaults, switch on TOYBOX_DEBUG in menuconfig to
-// add syntax checks to option string parsing which aren't needed in the final
-// code (since get_opt string is hardwired and should be correct when you ship)
+// NOTE: If option parsing segfaults, switch on TOYBOX_DEBUG in menuconfig.
+
+// Enabling TOYBOX_DEBUG in .config adds syntax checks to option string parsing
+// which aren't needed in the final code (your option string is hardwired and
+// should be correct when you ship), but are useful for development.
#include "toys.h"
@@ -137,7 +139,7 @@ static int gotflag(struct getoptflagstate *gof, struct opts *opt)
// Did we recognize this option?
if (!opt) {
if (gof->noerror) return 1;
- help_exit("Unknown option '%s'", gof->arg);
+ help_exit("Unknown option %s", gof->arg);
}
// Might enabling this switch off something else?
diff --git a/lib/commas.c b/lib/commas.c
index 22676847..03b2e345 100644
--- a/lib/commas.c
+++ b/lib/commas.c
@@ -59,7 +59,7 @@ char *comma_iterate(char **list, int *len)
return start;
}
-// Check all instances of opt and "no"opt in optlist, return true if opt
+// check all instances of opt and "no"opt in optlist, return true if opt
// found and last instance wasn't no. If clean, remove each instance from list.
int comma_scan(char *optlist, char *opt, int clean)
{
@@ -97,23 +97,3 @@ int comma_scanall(char *optlist, char *scanlist)
return i;
}
-
-// Returns true and removes `opt` from `optlist` if present, false otherwise.
-// Doesn't have the magic "no" behavior of comma_scan.
-int comma_remove(char *optlist, char *opt)
-{
- int optlen = strlen(opt), len, got = 0;
-
- if (optlist) for (;;) {
- char *s = comma_iterate(&optlist, &len);
-
- if (!s) break;
- if (optlen == len && !strncmp(opt, s, optlen)) {
- got = 1;
- if (optlist) memmove(s, optlist, strlen(optlist)+1);
- else *s = 0;
- }
- }
-
- return got;
-}
diff --git a/lib/deflate.c b/lib/deflate.c
index eebcd3de..2a6274e7 100644
--- a/lib/deflate.c
+++ b/lib/deflate.c
@@ -232,7 +232,7 @@ static void inflate(struct deflate *dd, struct bitbuf *bb)
// Dynamic huffman codes?
if (type == 2) {
- struct huff *h2 = ((struct huff *)libbuf)+1;
+ struct huff *h2 = ((struct huff *)toybuf)+1;
int i, litlen, distlen, hufflen;
char *hufflen_order = "\x10\x11\x12\0\x08\x07\x09\x06\x0a\x05\x0b"
"\x04\x0c\x03\x0d\x02\x0e\x01\x0f", *bits;
@@ -246,7 +246,7 @@ static void inflate(struct deflate *dd, struct bitbuf *bb)
// a complicated way: an array of bit lengths (hufflen many
// entries, each 3 bits) is used to fill out an array of 19 entries
// in a magic order, leaving the rest 0. Then make a tree out of it:
- memset(bits = libbuf+1, 0, 19);
+ memset(bits = toybuf+1, 0, 19);
for (i=0; i<hufflen; i++) bits[hufflen_order[i]] = bitbuf_get(bb, 3);
len2huff(h2, bits, 19);
@@ -268,7 +268,7 @@ static void inflate(struct deflate *dd, struct bitbuf *bb)
if (i > litlen+distlen) error_exit("bad tree");
len2huff(lithuff = h2, bits, litlen);
- len2huff(disthuff = ((struct huff *)libbuf)+2, bits+litlen, distlen);
+ len2huff(disthuff = ((struct huff *)toybuf)+2, bits+litlen, distlen);
// Static huffman codes
} else {
@@ -354,7 +354,7 @@ static struct deflate *init_deflate(int compress)
int i, n = 1;
struct deflate *dd = xmalloc(sizeof(struct deflate)+32768*(compress ? 4 : 1));
- memset(dd, 0, sizeof(struct deflate));
+// TODO sizeof and order of these?
// decompress needs 32k history, compress adds 64k hashhead and 32k hashchain
if (compress) {
dd->hashhead = (unsigned short *)(dd->data+65536);
@@ -384,10 +384,10 @@ static struct deflate *init_deflate(int compress)
// TODO layout and lifetime of this?
// Init fixed huffman tables
- for (i=0; i<288; i++) libbuf[i] = 8 + (i>143) - ((i>255)<<1) + (i>279);
- len2huff(dd->fixlithuff = ((struct huff *)libbuf)+3, libbuf, 288);
- memset(libbuf, 5, 30);
- len2huff(dd->fixdisthuff = ((struct huff *)libbuf)+4, libbuf, 30);
+ for (i=0; i<288; i++) toybuf[i] = 8 + (i>143) - ((i>255)<<1) + (i>279);
+ len2huff(dd->fixlithuff = ((struct huff *)toybuf)+3, toybuf, 288);
+ memset(toybuf, 5, 30);
+ len2huff(dd->fixdisthuff = ((struct huff *)toybuf)+4, toybuf, 30);
return dd;
}
diff --git a/lib/dirtree.c b/lib/dirtree.c
index df38b257..b11cdacc 100644
--- a/lib/dirtree.c
+++ b/lib/dirtree.c
@@ -27,34 +27,30 @@ int dirtree_notdotdot(struct dirtree *catch)
struct dirtree *dirtree_add_node(struct dirtree *parent, char *name, int flags)
{
- struct dirtree *dt = 0;
+ struct dirtree *dt = NULL;
struct stat st;
- int len = 0, linklen = 0, statless = 0;
+ int len = 0, linklen = 0;
if (name) {
// open code this because haven't got node to call dirtree_parentfd() on yet
int fd = parent ? parent->dirfd : AT_FDCWD;
- if (fstatat(fd, name, &st,AT_SYMLINK_NOFOLLOW*!(flags&DIRTREE_SYMFOLLOW))) {
- if (flags&DIRTREE_STATLESS) statless++;
- else goto error;
- }
+ if (fstatat(fd, name, &st, AT_SYMLINK_NOFOLLOW*!(flags&DIRTREE_SYMFOLLOW)))
+ goto error;
if (S_ISLNK(st.st_mode)) {
if (0>(linklen = readlinkat(fd, name, libbuf, 4095))) goto error;
libbuf[linklen++]=0;
}
len = strlen(name);
}
-
- // Allocate/populate return structure
- dt = xmalloc((len = sizeof(struct dirtree)+len+1)+linklen);
- memset(dt, 0, statless ? offsetof(struct dirtree, again)
- : offsetof(struct dirtree, st));
+ dt = xzalloc((len = sizeof(struct dirtree)+len+1)+linklen);
dt->parent = parent;
- dt->again = statless ? 2 : 0;
- if (!statless) memcpy(&dt->st, &st, sizeof(struct stat));
- strcpy(dt->name, name ? name : "");
- if (linklen) dt->symlink = memcpy(len+(char *)dt, libbuf, linklen);
+ if (name) {
+ memcpy(&(dt->st), &st, sizeof(struct stat));
+ strcpy(dt->name, name);
+
+ if (linklen) dt->symlink = memcpy(len+(char *)dt, libbuf, linklen);
+ }
return dt;
@@ -90,7 +86,7 @@ char *dirtree_path(struct dirtree *node, int *plen)
len = (plen ? *plen : 0)+strlen(node->name)+1;
path = dirtree_path(node->parent, &len);
if (len && path[len-1] != '/') path[len++]='/';
- len = stpcpy(path+len, node->name) - path;
+ len = (stpcpy(path+len, node->name) - path);
if (plen) *plen = len;
return path;
@@ -122,7 +118,7 @@ struct dirtree *dirtree_handle_callback(struct dirtree *new,
// If this had children, it was callback's job to free them already.
if (!(flags & DIRTREE_SAVE)) {
free(new);
- new = 0;
+ new = NULL;
}
return (flags & DIRTREE_ABORT)==DIRTREE_ABORT ? DIRTREE_ABORTVAL : new;
@@ -157,8 +153,6 @@ int dirtree_recurse(struct dirtree *node,
while ((entry = readdir(dir))) {
if ((flags&DIRTREE_PROC) && !isdigit(*entry->d_name)) continue;
if (!(new = dirtree_add_node(node, entry->d_name, flags))) continue;
- if (!new->st.st_blksize && !new->st.st_mode)
- new->st.st_mode = entry->d_type<<12;
new = dirtree_handle_callback(new, callback);
if (new == DIRTREE_ABORTVAL) break;
if (new) {
@@ -168,7 +162,7 @@ int dirtree_recurse(struct dirtree *node,
}
if (flags & DIRTREE_COMEAGAIN) {
- node->again |= 1;
+ node->again++;
flags = callback(node);
}
diff --git a/lib/env.c b/lib/env.c
deleted file mode 100644
index 3e05f4e4..00000000
--- a/lib/env.c
+++ /dev/null
@@ -1,120 +0,0 @@
-// Can't trust libc not to leak enviornment variable memory, so...
-
-#include "toys.h"
-
-// In libc, populated by start code,used by getenv() and exec() and friends.
-extern char **environ;
-
-// Returns the number of bytes taken by the environment variables. For use
-// when calculating the maximum bytes of environment+argument data that can
-// be passed to exec for find(1) and xargs(1).
-long environ_bytes()
-{
- long bytes = sizeof(char *);
- char **ev;
-
- for (ev = environ; *ev; ev++) bytes += sizeof(char *) + strlen(*ev) + 1;
-
- return bytes;
-}
-
-// This will clear the inherited environment if called first thing.
-// Use this instead of envc so we keep track of what needs to be freed.
-void xclearenv(void)
-{
- toys.envc = 0;
- *environ = 0;
-}
-
-// Frees entries we set earlier. Use with libc getenv but not setenv/putenv.
-// if name has an equals and !val, act like putenv (name=val must be malloced!)
-// if !val unset name. (Name with = and val is an error)
-void xsetenv(char *name, char *val)
-{
- unsigned i, len, envc;
- char *new;
-
- // If we haven't snapshot initial environment state yet, do so now.
- if (!toys.envc) {
- // envc is size +1 so even if env empty it's nonzero after initialization
- while (environ[toys.envc++]);
- memcpy(new = xmalloc(((toys.envc|0xff)+1)*sizeof(char *)),
- environ, toys.envc*sizeof(char *));
- environ = (void *)new;
- }
-
- new = strchr(name, '=');
- if (new) {
- len = new-name;
- if (val) error_exit("xsetenv %s to %s", name, val);
- new = name;
- } else {
- len = strlen(name);
- if (val) new = xmprintf("%s=%s", name, val);
- }
-
- envc = toys.envc-1; // compensate for size +1 above
- for (i = 0; environ[i]; i++) {
- // Drop old entry, freeing as appropriate. Assumes no duplicates.
- if (!memcmp(name, environ[i], len) && environ[i][len]=='=') {
- if (i>=envc) free(environ[i]);
- else {
- // move old entries down, add at end of old data
- toys.envc = envc--;
- for (; new ? i<envc : !!environ[i]; i++) environ[i] = environ[i+1];
- i = envc;
- }
- break;
- }
- }
-
- if (!new) return;
-
- // resize and null terminate if expanding
- if (!environ[i]) {
- len = i+1;
- if (!(len&255)) environ = xrealloc(environ, len*sizeof(char *));
- environ[len] = 0;
- }
- environ[i] = new;
-}
-
-void xunsetenv(char *name)
-{
- if (strchr(name, '=')) error_exit("xunsetenv %s name has =", name);
- xsetenv(name, 0);
-}
-
-// reset environment for a user, optionally clearing most of it
-void reset_env(struct passwd *p, int clear)
-{
- int i;
-
- if (clear) {
- char *s, *stuff[] = {"TERM", "DISPLAY", "COLORTERM", "XAUTHORITY"};
-
- for (i=0; i<ARRAY_LEN(stuff); i++)
- stuff[i] = (s = getenv(stuff[i])) ? xmprintf("%s=%s", stuff[i], s) : 0;
- xclearenv();
- for (i=0; i < ARRAY_LEN(stuff); i++) if (stuff[i]) xsetenv(stuff[i], 0);
- if (chdir(p->pw_dir)) {
- perror_msg("chdir %s", p->pw_dir);
- xchdir("/");
- }
- } else {
- char **ev1, **ev2;
-
- // remove LD_*, IFS, ENV, and BASH_ENV from environment
- for (ev1 = ev2 = environ;;) {
- while (*ev2 && (strstart(ev2, "LD_") || strstart(ev2, "IFS=") ||
- strstart(ev2, "ENV=") || strstart(ev2, "BASH_ENV="))) ev2++;
- if (!(*ev1++ = *ev2++)) break;
- }
- }
-
- setenv("PATH", _PATH_DEFPATH, 1);
- setenv("HOME", p->pw_dir, 1);
- setenv("SHELL", p->pw_shell, 1);
- setenv("USER", p->pw_name, 1);
- setenv("LOGNAME", p->pw_name, 1);
-}
diff --git a/lib/help.c b/lib/help.c
index 7b97e8b9..d0185678 100644
--- a/lib/help.c
+++ b/lib/help.c
@@ -30,6 +30,6 @@ void show_help(FILE *out)
i = toy_find(++s)-toy_list;
}
- fprintf(out, "%s\n", s);
+ fprintf(out, "%s", s);
}
}
diff --git a/lib/lib.c b/lib/lib.c
index 03c1db69..c4d871c2 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -162,10 +162,9 @@ off_t lskip(int fd, off_t offset)
return offset;
}
-// flags:
-// MKPATHAT_MKLAST make last dir (with mode lastmode, else skips last part)
-// MKPATHAT_MAKE make leading dirs (it's ok if they already exist)
-// MKPATHAT_VERBOSE Print what got created to stderr
+// flags: 1=make last dir (with mode lastmode, otherwise skips last component)
+// 2=make path (already exists is ok)
+// 4=verbose
// returns 0 = path ok, 1 = error
int mkpathat(int atfd, char *dir, mode_t lastmode, int flags)
{
@@ -187,20 +186,20 @@ int mkpathat(int atfd, char *dir, mode_t lastmode, int flags)
mode_t mode = (0777&~toys.old_umask)|0300;
// find next '/', but don't try to mkdir "" at start of absolute path
- if (*s == '/' && (flags&MKPATHAT_MAKE) && s != dir) {
+ if (*s == '/' && (flags&2) && s != dir) {
save = *s;
*s = 0;
} else if (*s) continue;
// Use the mode from the -m option only for the last directory.
if (!save) {
- if (flags&MKPATHAT_MKLAST) mode = lastmode;
+ if (flags&1) mode = lastmode;
else break;
}
if (mkdirat(atfd, dir, mode)) {
- if (!(flags&MKPATHAT_MAKE) || errno != EEXIST) return 1;
- } else if (flags&MKPATHAT_VERBOSE)
+ if (!(flags&2) || errno != EEXIST) return 1;
+ } else if (flags&4)
fprintf(stderr, "%s: created directory '%s'\n", toys.which->name, dir);
if (!(*s = save)) break;
@@ -448,18 +447,7 @@ char *strend(char *str, char *suffix)
// If *a starts with b, advance *a past it and return 1, else return 0;
int strstart(char **a, char *b)
{
- char *c = *a;
-
- while (*b && *c == *b) b++, c++;
- if (!*b) *a = c;
-
- return !*b;
-}
-
-// If *a starts with b, advance *a past it and return 1, else return 0;
-int strcasestart(char **a, char *b)
-{
- int len = strlen(b), i = !strncasecmp(*a, b, len);
+ int len = strlen(b), i = !strncmp(*a, b, len);
if (i) *a += len;
@@ -696,12 +684,12 @@ static void loopfile_lines_bridge(int fd, char *name)
void loopfiles_lines(char **argv, void (*function)(char **pline, long len))
{
do_lines_bridge = function;
- // No O_CLOEXEC because we need to call fclose.
- loopfiles_rw(argv, O_RDONLY|WARN_ONLY, 0, loopfile_lines_bridge);
+ loopfiles(argv, loopfile_lines_bridge);
}
// Slow, but small.
-char *get_line(int fd)
+
+char *get_rawline(int fd, long *plen, char end)
{
char c, *buf = NULL;
long len = 0;
@@ -709,12 +697,20 @@ char *get_line(int fd)
for (;;) {
if (1>read(fd, &c, 1)) break;
if (!(len & 63)) buf=xrealloc(buf, len+65);
- if ((buf[len++]=c) == '\n') break;
- }
- if (buf) {
- buf[len]=0;
- if (buf[--len]=='\n') buf[len]=0;
+ if ((buf[len++]=c) == end) break;
}
+ if (buf) buf[len]=0;
+ if (plen) *plen = len;
+
+ return buf;
+}
+
+char *get_line(int fd)
+{
+ long len;
+ char *buf = get_rawline(fd, &len, '\n');
+
+ if (buf && buf[--len]=='\n') buf[len]=0;
return buf;
}
@@ -821,16 +817,11 @@ void base64_init(char *p)
int yesno(int def)
{
- return fyesno(stdin, def);
-}
-
-int fyesno(FILE *in, int def)
-{
char buf;
fprintf(stderr, " (%c/%c):", def ? 'Y' : 'y', def ? 'n' : 'N');
fflush(stderr);
- while (fread(&buf, 1, 1, in)) {
+ while (fread(&buf, 1, 1, stdin)) {
int new;
// The letter changes the value, the newline (or space) returns it.
@@ -841,6 +832,32 @@ int fyesno(FILE *in, int def)
return def;
}
+struct signame {
+ int num;
+ char *name;
+};
+
+// Signals required by POSIX 2008:
+// http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html
+
+#define SIGNIFY(x) {SIG##x, #x}
+
+static struct signame signames[] = {
+ SIGNIFY(ABRT), SIGNIFY(ALRM), SIGNIFY(BUS),
+ SIGNIFY(FPE), SIGNIFY(HUP), SIGNIFY(ILL), SIGNIFY(INT), SIGNIFY(KILL),
+ SIGNIFY(PIPE), SIGNIFY(QUIT), SIGNIFY(SEGV), SIGNIFY(TERM),
+ SIGNIFY(USR1), SIGNIFY(USR2), SIGNIFY(SYS), SIGNIFY(TRAP),
+ SIGNIFY(VTALRM), SIGNIFY(XCPU), SIGNIFY(XFSZ),
+
+ // Start of non-terminal signals
+
+ SIGNIFY(CHLD), SIGNIFY(CONT), SIGNIFY(STOP), SIGNIFY(TSTP),
+ SIGNIFY(TTIN), SIGNIFY(TTOU), SIGNIFY(URG)
+};
+
+// not in posix: SIGNIFY(STKFLT), SIGNIFY(WINCH), SIGNIFY(IO), SIGNIFY(PWR)
+// obsolete: SIGNIFY(PROF) SIGNIFY(POLL)
+
// Handler that sets toys.signal, and writes to toys.signalfd if set
void generic_signal(int sig)
{
@@ -863,11 +880,15 @@ void exit_signal(int sig)
// adds the handlers to a list, to be called in order.
void sigatexit(void *handler)
{
- xsignal_all_killers(handler ? exit_signal : SIG_DFL);
+ struct arg_list *al;
+ int i;
- if (handler) {
- struct arg_list *al = xmalloc(sizeof(struct arg_list));
+ for (i=0; signames[i].num != SIGCHLD; i++)
+ if (signames[i].num != SIGKILL)
+ xsignal(signames[i].num, handler ? exit_signal : SIG_DFL);
+ if (handler) {
+ al = xmalloc(sizeof(struct arg_list));
al->next = toys.xexit;
al->arg = handler;
toys.xexit = al;
@@ -877,19 +898,33 @@ void sigatexit(void *handler)
}
}
-// Output a nicely formatted 80-column table of all the signals.
-void list_signals()
+// Convert name to signal number. If name == NULL print names.
+int sig_to_num(char *pidstr)
{
- int i = 0, count = 0;
- char *name;
+ int i;
- for (; i<=NSIG; i++) {
- if ((name = num_to_sig(i))) {
- printf("%2d) SIG%-9s", i, name);
- if (++count % 5 == 0) putchar('\n');
- }
+ if (pidstr) {
+ char *s;
+
+ i = estrtol(pidstr, &s, 10);
+ if (!errno && !*s) return i;
+
+ if (!strncasecmp(pidstr, "sig", 3)) pidstr+=3;
}
- putchar('\n');
+ for (i=0; i<ARRAY_LEN(signames); i++)
+ if (!pidstr) xputs(signames[i].name);
+ else if (!strcasecmp(pidstr, signames[i].name)) return signames[i].num;
+
+ return -1;
+}
+
+char *num_to_sig(int sig)
+{
+ int i;
+
+ for (i=0; i<ARRAY_LEN(signames); i++)
+ if (signames[i].num == sig) return signames[i].name;
+ return NULL;
}
// premute mode bits based on posix mode strings.
@@ -1005,6 +1040,17 @@ void mode_to_string(mode_t mode, char *buf)
*buf = c;
}
+// dirname() can modify its argument or return a pointer to a constant string
+// This always returns a malloc() copy of everyting before last (run of ) '/'.
+char *getdirname(char *name)
+{
+ char *s = xstrdup(name), *ss = strrchr(s, '/');
+
+ while (*ss && *ss == '/' && s != ss) *ss-- = 0;
+
+ return s;
+}
+
// basename() can modify its argument or return a pointer to a constant string
// This just gives after the last '/' or the whole stirng if no /
char *getbasename(char *name)
@@ -1029,8 +1075,7 @@ char *fileunderdir(char *file, char *dir)
}
// Execute a callback for each PID that matches a process name from a list.
-void names_to_pid(char **names, int (*callback)(pid_t pid, char *name),
- int scripts)
+void names_to_pid(char **names, int (*callback)(pid_t pid, char *name))
{
DIR *dp;
struct dirent *entry;
@@ -1039,20 +1084,18 @@ void names_to_pid(char **names, int (*callback)(pid_t pid, char *name),
while ((entry = readdir(dp))) {
unsigned u = atoi(entry->d_name);
- char *cmd = 0, *comm = 0, **cur;
+ char *cmd = 0, *comm, **cur;
off_t len;
if (!u) continue;
// Comm is original name of executable (argv[0] could be #! interpreter)
// but it's limited to 15 characters
- if (scripts) {
- sprintf(libbuf, "/proc/%u/comm", u);
- len = sizeof(libbuf);
- if (!(comm = readfileat(AT_FDCWD, libbuf, libbuf, &len)) || !len)
- continue;
- if (libbuf[len-1] == '\n') libbuf[--len] = 0;
- }
+ sprintf(libbuf, "/proc/%u/comm", u);
+ len = sizeof(libbuf);
+ if (!(comm = readfileat(AT_FDCWD, libbuf, libbuf, &len)) || !len)
+ continue;
+ if (libbuf[len-1] == '\n') libbuf[--len] = 0;
for (cur = names; *cur; cur++) {
struct stat st1, st2;
@@ -1062,7 +1105,7 @@ void names_to_pid(char **names, int (*callback)(pid_t pid, char *name),
// Fast path: only matching a filename (no path) that fits in comm.
// `len` must be 14 or less because with a full 15 bytes we don't
// know whether the name fit or was truncated.
- if (scripts && len<=14 && bb==*cur && !strcmp(comm, bb)) goto match;
+ if (len<=14 && bb==*cur && !strcmp(comm, bb)) goto match;
// If we have a path to existing file only match if same inode
if (bb!=*cur && !stat(*cur, &st1)) {
@@ -1084,7 +1127,7 @@ void names_to_pid(char **names, int (*callback)(pid_t pid, char *name),
cmd[len] = 0;
}
if (!strcmp(bb, getbasename(cmd))) goto match;
- if (scripts && !strcmp(bb, getbasename(cmd+strlen(cmd)+1))) goto match;
+ if (bb!=*cur && !strcmp(bb, getbasename(cmd+strlen(cmd)+1))) goto match;
continue;
match:
if (callback(u, *cur)) break;
@@ -1093,17 +1136,17 @@ match:
closedir(dp);
}
-// display first "dgt" many digits of number plus unit (kilo-exabytes)
-int human_readable_long(char *buf, unsigned long long num, int dgt, int style)
+// display first few digits of number with power of two units
+int human_readable(char *buf, unsigned long long num, int style)
{
unsigned long long snap = 0;
int len, unit, divisor = (style&HR_1000) ? 1000 : 1024;
// Divide rounding up until we have 3 or fewer digits. Since the part we
// print is decimal, the test is 999 even when we divide by 1024.
- // We can't run out of units because 1<<64 is 18 exabytes.
- for (unit = 0; snprintf(0, 0, "%llu", num)>dgt; unit++)
- num = ((snap = num)+(divisor/2))/divisor;
+ // We can't run out of units because 2<<64 is 18 exabytes.
+ // test 5675 is 5.5k not 5.6k.
+ for (unit = 0; num > 999; unit++) num = ((snap = num)+(divisor/2))/divisor;
len = sprintf(buf, "%llu", num);
if (unit && len == 1) {
// Redo rounding for 1.2M case, this works with and without HR_1000.
@@ -1125,12 +1168,6 @@ int human_readable_long(char *buf, unsigned long long num, int dgt, int style)
return len;
}
-// Give 3 digit estimate + units ala 999M or 1.7T
-int human_readable(char *buf, unsigned long long num, int style)
-{
- return human_readable_long(buf, num, 3, style);
-}
-
// The qsort man page says you can use alphasort, the posix committee
// disagreed, and doubled down: http://austingroupbugs.net/view.php?id=142
// So just do our own. (The const is entirely to humor the stupid compiler.)
@@ -1269,7 +1306,7 @@ int readlinkat0(int dirfd, char *path, char *buf, int len)
if (!len) return 0;
len = readlinkat(dirfd, path, buf, len-1);
- if (len<0) len = 0;
+ if (len<1) return 0;
buf[len] = 0;
return len;
@@ -1280,16 +1317,39 @@ int readlink0(char *path, char *buf, int len)
return readlinkat0(AT_FDCWD, path, buf, len);
}
-// Do regex matching with len argument to handle embedded NUL bytes in string
+// Do regex matching handling embedded NUL bytes in string (hence extra len
+// argument). Note that neither the pattern nor the match can currently include
+// NUL bytes (even with wildcards) and string must be null terminated at
+// string[len]. But this can find a match after the first NUL.
int regexec0(regex_t *preg, char *string, long len, int nmatch,
- regmatch_t *pmatch, int eflags)
+ regmatch_t pmatch[], int eflags)
{
- regmatch_t backup;
+ char *s = string;
- if (!nmatch) pmatch = &backup;
- pmatch->rm_so = 0;
- pmatch->rm_eo = len;
- return regexec(preg, string, nmatch, pmatch, eflags|REG_STARTEND);
+ for (;;) {
+ long ll = 0;
+ int rc;
+
+ while (len && !*s) {
+ s++;
+ len--;
+ }
+ while (s[ll] && ll<len) ll++;
+
+ rc = regexec(preg, s, nmatch, pmatch, eflags);
+ if (!rc) {
+ for (rc = 0; rc<nmatch && pmatch[rc].rm_so!=-1; rc++) {
+ pmatch[rc].rm_so += s-string;
+ pmatch[rc].rm_eo += s-string;
+ }
+
+ return 0;
+ }
+ if (ll==len) return rc;
+
+ s += ll;
+ len -= ll;
+ }
}
// Return user name or string representation of number, returned buffer
@@ -1338,6 +1398,19 @@ void do_lines(int fd, char delim, void (*call)(char **pline, long len))
if (fd) fclose(fp);
}
+// Returns the number of bytes taken by the environment variables. For use
+// when calculating the maximum bytes of environment+argument data that can
+// be passed to exec for find(1) and xargs(1).
+long environ_bytes()
+{
+ long bytes = sizeof(char *);
+ char **ev;
+
+ for (ev = environ; *ev; ev++) bytes += sizeof(char *) + strlen(*ev) + 1;
+
+ return bytes;
+}
+
// Return unix time in milliseconds
long long millitime(void)
{
@@ -1359,6 +1432,40 @@ char *format_iso_time(char *buf, size_t len, struct timespec *ts)
return buf;
}
+// reset environment for a user, optionally clearing most of it
+void reset_env(struct passwd *p, int clear)
+{
+ int i;
+
+ if (clear) {
+ char *s, *stuff[] = {"TERM", "DISPLAY", "COLORTERM", "XAUTHORITY"};
+
+ for (i=0; i<ARRAY_LEN(stuff); i++)
+ stuff[i] = (s = getenv(stuff[i])) ? xmprintf("%s=%s", stuff[i], s) : 0;
+ clearenv();
+ for (i=0; i < ARRAY_LEN(stuff); i++) if (stuff[i]) putenv(stuff[i]);
+ if (chdir(p->pw_dir)) {
+ perror_msg("chdir %s", p->pw_dir);
+ xchdir("/");
+ }
+ } else {
+ char **ev1, **ev2;
+
+ // remove LD_*, IFS, ENV, and BASH_ENV from environment
+ for (ev1 = ev2 = environ;;) {
+ while (*ev2 && (strstart(ev2, "LD_") || strstart(ev2, "IFS=") ||
+ strstart(ev2, "ENV=") || strstart(ev2, "BASH_ENV="))) ev2++;
+ if (!(*ev1++ = *ev2++)) break;
+ }
+ }
+
+ setenv("PATH", _PATH_DEFPATH, 1);
+ setenv("HOME", p->pw_dir, 1);
+ setenv("SHELL", p->pw_shell, 1);
+ setenv("USER", p->pw_name, 1);
+ setenv("LOGNAME", p->pw_name, 1);
+}
+
// Syslog with the openlog/closelog, autodetecting daemon status via no tty
void loggit(int priority, char *format, ...)
@@ -1373,26 +1480,3 @@ void loggit(int priority, char *format, ...)
va_end(va);
closelog();
}
-
-// Calculate tar packet checksum, with cksum field treated as 8 spaces
-unsigned tar_cksum(void *data)
-{
- unsigned i, cksum = 8*' ';
-
- for (i = 0; i<500; i += (i==147) ? 9 : 1) cksum += ((char *)data)[i];
-
- return cksum;
-}
-
-// is this a valid tar header?
-int is_tar_header(void *pkt)
-{
- char *p = pkt;
- int i = 0;
-
- if (p[257] && memcmp("ustar", p+257, 5)) return 0;
- if (p[148] != '0' && p[148] != ' ') return 0;
- sscanf(p+148, "%8o", &i);
-
- return i && tar_cksum(pkt) == i;
-}
diff --git a/lib/lib.h b/lib/lib.h
index b48d320e..e220962c 100644
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -45,7 +45,6 @@ void llist_free_double(void *node);
void llist_traverse(void *list, void (*using)(void *node));
void *llist_pop(void *list); // actually void **list
void *dlist_pop(void *list); // actually struct double_list **list
-void *dlist_lpop(void *list); // also struct double_list **list
void dlist_add_nomalloc(struct double_list **list, struct double_list *new);
struct double_list *dlist_add(struct double_list **list, char *data);
void *dlist_terminate(void *list);
@@ -77,8 +76,6 @@ void get_optflags(void);
#define DIRTREE_BREADTH 32
// skip non-numeric entries
#define DIRTREE_PROC 64
-// Return files we can't stat
-#define DIRTREE_STATLESS 128
// Don't look at any more files in this directory.
#define DIRTREE_ABORT 256
@@ -87,9 +84,9 @@ void get_optflags(void);
struct dirtree {
struct dirtree *next, *parent, *child;
long extra; // place for user to store their stuff (can be pointer)
+ struct stat st;
char *symlink;
int dirfd;
- struct stat st;
char again;
char name[];
};
@@ -132,7 +129,7 @@ void xputsl(char *s, int len);
void xputsn(char *s);
void xputs(char *s);
void xputc(char c);
-void xflush(int flush);
+void xflush(void);
void xexec(char **argv);
pid_t xpopen_both(char **argv, int *pipes);
int xwaitpid(pid_t pid);
@@ -186,7 +183,6 @@ void xsignal_flags(int signal, void *handler, int flags);
void xsignal(int signal, void *handler);
time_t xvali_date(struct tm *tm, char *str);
void xparsedate(char *str, time_t *t, unsigned *nano, int endian);
-char *xgetline(FILE *fp, int *len);
// lib.c
void verror_msg(char *msg, int err, va_list va);
@@ -233,13 +229,12 @@ char *chomp(char *s);
int unescape(char c);
char *strend(char *str, char *suffix);
int strstart(char **a, char *b);
-int strcasestart(char **a, char *b);
off_t fdlength(int fd);
void loopfiles_rw(char **argv, int flags, int permissions,
void (*function)(int fd, char *name));
void loopfiles(char **argv, void (*function)(int fd, char *name));
void loopfiles_lines(char **argv, void (*function)(char **pline, long len));
-long long sendfile_len(int in, int out, long long len, long long *consumed);
+long long sendfile_len(int in, int out, long long len);
long long xsendfile_len(int in, int out, long long len);
void xsendfile_pad(int in, int out, long long len);
long long xsendfile(int in, int out);
@@ -250,7 +245,6 @@ void replace_tempfile(int fdin, int fdout, char **tempname);
void crc_init(unsigned int *crc_table, int little_endian);
void base64_init(char *p);
int yesno(int def);
-int fyesno(FILE *fp, int def);
int qstrcmp(const void *a, const void *b);
void create_uuid(char *uuid);
char *show_uuid(char *uuid);
@@ -267,26 +261,17 @@ int regexec0(regex_t *preg, char *string, long len, int nmatch,
char *getusername(uid_t uid);
char *getgroupname(gid_t gid);
void do_lines(int fd, char delim, void (*call)(char **pline, long len));
+long environ_bytes();
long long millitime(void);
char *format_iso_time(char *buf, size_t len, struct timespec *ts);
void reset_env(struct passwd *p, int clear);
void loggit(int priority, char *format, ...);
-unsigned tar_cksum(void *data);
-int is_tar_header(void *pkt);
#define HR_SPACE 1 // Space between number and units
#define HR_B 2 // Use "B" for single byte units
#define HR_1000 4 // Use decimal instead of binary units
-int human_readable_long(char *buf, unsigned long long num, int dgt, int style);
int human_readable(char *buf, unsigned long long num, int style);
-// env.c
-
-long environ_bytes();
-void xsetenv(char *name, char *val);
-void xunsetenv(char *name);
-void xclearenv(void);
-
// linestack.c
struct linestack {
@@ -310,28 +295,14 @@ int draw_trim_esc(char *str, int padto, int width, char *escmore,
int (*escout)(FILE *out, int cols,int wc));
int draw_trim(char *str, int padto, int width);
-// tty.c
+// interestingtimes.c
int tty_fd(void);
int terminal_size(unsigned *xx, unsigned *yy);
int terminal_probesize(unsigned *xx, unsigned *yy);
-#define KEY_UP 0
-#define KEY_DOWN 1
-#define KEY_RIGHT 2
-#define KEY_LEFT 3
-#define KEY_PGUP 4
-#define KEY_PGDN 5
-#define KEY_HOME 6
-#define KEY_END 7
-#define KEY_INSERT 8
-#define KEY_DELETE 9
-#define KEY_FN 10 // F1 = KEY_FN+1, F2 = KEY_FN+2, ...
-#define KEY_SHIFT (1<<16)
-#define KEY_CTRL (1<<17)
-#define KEY_ALT (1<<18)
-int scan_key(char *scratch, int timeout_ms);
int scan_key_getsize(char *scratch, int timeout_ms, unsigned *xx, unsigned *yy);
int set_terminal(int fd, int raw, int speed, struct termios *old);
void xset_terminal(int fd, int raw, int speed, struct termios *old);
+int scan_key(char *scratch, int timeout_ms);
void tty_esc(char *s);
void tty_jump(int x, int y);
void tty_reset(void);
@@ -350,10 +321,8 @@ int xsocket(int domain, int type, int protocol);
void xsetsockopt(int fd, int level, int opt, void *val, socklen_t len);
struct addrinfo *xgetaddrinfo(char *host, char *port, int family, int socktype,
int protocol, int flags);
-void xbind(int fd, const struct sockaddr *sa, socklen_t len);
-void xconnect(int fd, const struct sockaddr *sa, socklen_t len);
-int xconnectany(struct addrinfo *ai);
-int xbindany(struct addrinfo *ai);
+int xconnect(struct addrinfo *ai);
+int xbind(struct addrinfo *ai);
int xpoll(struct pollfd *fds, int nfds, int timeout);
int pollinate(int in1, int in2, int out1, int out2, int timeout, int shutdown_timeout);
char *ntop(struct sockaddr *sa);
@@ -370,7 +339,6 @@ void comma_collate(char **old, char *new);
char *comma_iterate(char **list, int *len);
int comma_scan(char *optlist, char *opt, int clean);
int comma_scanall(char *optlist, char *scanlist);
-int comma_remove(char *optlist, char *opt);
// deflate.c
@@ -396,14 +364,15 @@ struct mtab_list *xgetmountlist(char *path);
void generic_signal(int signal);
void exit_signal(int signal);
void sigatexit(void *handler);
-void list_signals();
+int sig_to_num(char *pidstr);
+char *num_to_sig(int sig);
mode_t string_to_mode(char *mode_str, mode_t base);
void mode_to_string(mode_t mode, char *buf);
+char *getdirname(char *name);
char *getbasename(char *name);
char *fileunderdir(char *file, char *dir);
-void names_to_pid(char **names, int (*callback)(pid_t pid, char *name),
- int scripts);
+void names_to_pid(char **names, int (*callback)(pid_t pid, char *name));
pid_t __attribute__((returns_twice)) xvforkwrap(pid_t pid);
#define XVFORK() xvforkwrap(vfork())
diff --git a/lib/linestack.c b/lib/linestack.c
index 0fc83e6b..fb6cc1e4 100644
--- a/lib/linestack.c
+++ b/lib/linestack.c
@@ -125,7 +125,7 @@ int crunch_str(char **str, int width, FILE *out, char *escmore,
// standard escapes: ^X if <32, <XX> if invalid UTF8, U+XXXX if UTF8 !iswprint()
int crunch_escape(FILE *out, int cols, int wc)
{
- char buf[11];
+ char buf[8];
int rc;
if (wc<' ') rc = sprintf(buf, "^%c", '@'+wc);
diff --git a/lib/llist.c b/lib/llist.c
index e1e6a564..dbb5352a 100644
--- a/lib/llist.c
+++ b/lib/llist.c
@@ -51,37 +51,19 @@ void *llist_pop(void *list)
return (void *)next;
}
-// Remove first item from &list and return it
void *dlist_pop(void *list)
{
struct double_list **pdlist = (struct double_list **)list, *dlist = *pdlist;
- if (!dlist) return 0;
if (dlist->next == dlist) *pdlist = 0;
else {
- if (dlist->next) dlist->next->prev = dlist->prev;
- if (dlist->prev) dlist->prev->next = dlist->next;
- *pdlist = dlist->next;
+ dlist->next->prev = dlist->prev;
+ dlist->prev->next = *pdlist = dlist->next;
}
return dlist;
}
-// remove last item from &list and return it (stack pop)
-void *dlist_lpop(void *list)
-{
- struct double_list *dl = *(struct double_list **)list;
- void *v = 0;
-
- if (dl) {
- dl = dl->prev;
- v = dlist_pop(&dl);
- if (!dl) *(void **)list = 0;
- }
-
- return v;
-}
-
void dlist_add_nomalloc(struct double_list **list, struct double_list *new)
{
if (*list) {
diff --git a/lib/lsm.h b/lib/lsm.h
index 88bf3470..556700ce 100644
--- a/lib/lsm.h
+++ b/lib/lsm.h
@@ -24,6 +24,7 @@
#ifndef XATTR_NAME_SMACK
#define XATTR_NAME_SMACK 0
#endif
+//ssize_t fgetxattr (int fd, char *name, void *value, size_t size);
#define smack_smackfs_path(...) (-1)
#define smack_new_label_from_self(...) (-1)
#define smack_new_label_from_path(...) (-1)
diff --git a/lib/net.c b/lib/net.c
index 02354444..2bb720a4 100644
--- a/lib/net.c
+++ b/lib/net.c
@@ -37,7 +37,7 @@ struct addrinfo *xgetaddrinfo(char *host, char *port, int family, int socktype,
return ai;
}
-static int xconnbind(struct addrinfo *ai_arg, int dobind)
+int xconnbind(struct addrinfo *ai_arg, int dobind)
{
struct addrinfo *ai;
int fd = -1, one = 1;
@@ -56,27 +56,17 @@ static int xconnbind(struct addrinfo *ai_arg, int dobind)
return fd;
}
-int xconnectany(struct addrinfo *ai)
+int xconnect(struct addrinfo *ai)
{
return xconnbind(ai, 0);
}
-int xbindany(struct addrinfo *ai)
+int xbind(struct addrinfo *ai)
{
return xconnbind(ai, 1);
}
-void xbind(int fd, const struct sockaddr *sa, socklen_t len)
-{
- if (bind(fd, sa, len)) perror_exit("bind");
-}
-
-void xconnect(int fd, const struct sockaddr *sa, socklen_t len)
-{
- if (connect(fd, sa, len)) perror_exit("connect");
-}
-
int xpoll(struct pollfd *fds, int nfds, int timeout)
{
int i;
diff --git a/lib/password.c b/lib/password.c
index 432905cc..b9cc1346 100644
--- a/lib/password.c
+++ b/lib/password.c
@@ -110,9 +110,8 @@ int update_password(char *filename, char* username, char* entry)
char *filenamesfx = NULL, *namesfx = NULL, *shadow = NULL,
*sfx = NULL, *line = NULL;
FILE *exfp, *newfp;
- int ret = -1, found = 0, n;
+ int ret = -1, found = 0;
struct flock lock;
- size_t allocated_length;
shadow = strstr(filename, "shadow");
filenamesfx = xmprintf("%s+", filename);
@@ -150,8 +149,8 @@ int update_password(char *filename, char* username, char* entry)
ret = 0;
namesfx = xmprintf("%s:",username);
- while ((n = getline(&line, &allocated_length, exfp)) > 0) {
- line[n-1] = 0;
+ while ((line = get_line(fileno(exfp))) != NULL)
+ {
if (strncmp(line, namesfx, strlen(namesfx)))
fprintf(newfp, "%s\n", line);
else if (entry) {
@@ -176,8 +175,8 @@ int update_password(char *filename, char* username, char* entry)
fprintf(newfp, "%s\n", entry);
}
}
+ free(line);
}
- free(line);
free(namesfx);
if (!found && entry) fprintf(newfp, "%s\n", entry);
fcntl(fileno(exfp), F_SETLK, &lock);
diff --git a/lib/pending.h b/lib/pending.h
index 3c563947..fbcc47c8 100644
--- a/lib/pending.h
+++ b/lib/pending.h
@@ -6,7 +6,8 @@ int read_password(char * buff, int buflen, char* mesg);
int update_password(char *filename, char* username, char* encrypted);
// lib.c
-// This should be switched to posix-2008 getline()
+// These should be switched to posix-2008 getline() and getdelim()
+char *get_rawline(int fd, long *plen, char end);
char *get_line(int fd);
diff --git a/lib/portability.c b/lib/portability.c
index d48a3b4d..194d844b 100644
--- a/lib/portability.c
+++ b/lib/portability.c
@@ -46,47 +46,21 @@ int xgetrandom(void *buf, unsigned buflen, unsigned flags)
return 1;
}
-// Get list of mounted filesystems, including stat and statvfs info.
-// Returns a reversed list, which is good for finding overmounts and such.
-
-#if defined(__APPLE__) || defined(__FreeBSD__)
-
-#include <sys/mount.h>
+#if defined(__APPLE__)
+extern char **environ;
-struct mtab_list *xgetmountlist(char *path)
+int clearenv(void)
{
- struct mtab_list *mtlist = 0, *mt;
- struct statfs *entries;
- int i, count;
-
- if (path) error_exit("xgetmountlist");
- if ((count = getmntinfo(&entries, 0)) == 0) perror_exit("getmntinfo");
-
- // The "test" part of the loop is done before the first time through and
- // again after each "increment", so putting the actual load there avoids
- // duplicating it. If the load was NULL, the loop stops.
-
- for (i = 0; i < count; ++i) {
- struct statfs *me = &entries[i];
-
- mt = xzalloc(sizeof(struct mtab_list) + strlen(me->f_fstypename) +
- strlen(me->f_mntonname) + strlen(me->f_mntfromname) + strlen("") + 4);
- dlist_add_nomalloc((void *)&mtlist, (void *)mt);
-
- // Collect details about mounted filesystem.
- // Don't report errors, just leave data zeroed.
- stat(me->f_mntonname, &(mt->stat));
- statvfs(me->f_mntonname, &(mt->statvfs));
+ *environ = NULL;
+ return 0;
+}
+#endif
- // Remember information from struct statfs.
- mt->dir = stpcpy(mt->type, me->f_fstypename)+1;
- mt->device = stpcpy(mt->dir, me->f_mntonname)+1;
- mt->opts = stpcpy(mt->device, me->f_mntfromname)+1;
- strcpy(mt->opts, ""); /* TODO: reverse from f_flags? */
- }
+// Get a linked list of mount points, with stat information.
+#if defined(__APPLE__) || defined(__FreeBSD__)
- return mtlist;
-}
+// Not implemented for macOS.
+// See <sys/mount.h>'s getmntinfo(3) for the BSD API.
#else
@@ -146,6 +120,9 @@ int mountlist_istype(struct mtab_list *ml, char *typelist)
return !skip;
}
+// Get list of mounted filesystems, including stat and statvfs info.
+// Returns a reversed list, which is good for finding overmounts and such.
+
struct mtab_list *xgetmountlist(char *path)
{
struct mtab_list *mtlist = 0, *mt;
@@ -186,315 +163,3 @@ struct mtab_list *xgetmountlist(char *path)
}
#endif
-
-#ifdef __APPLE__
-
-#include <sys/event.h>
-
-struct xnotify *xnotify_init(int max)
-{
- struct xnotify *not = xzalloc(sizeof(struct xnotify));
-
- not->max = max;
- if ((not->kq = kqueue()) == -1) perror_exit("kqueue");
- not->paths = xmalloc(max * sizeof(char *));
- not->fds = xmalloc(max * sizeof(int));
-
- return not;
-}
-
-int xnotify_add(struct xnotify *not, int fd, char *path)
-{
- struct kevent event;
-
- if (not->count == not->max) error_exit("xnotify_add overflow");
- EV_SET(&event, fd, EVFILT_VNODE, EV_ADD|EV_CLEAR, NOTE_WRITE, 0, NULL);
- if (kevent(not->kq, &event, 1, NULL, 0, NULL) == -1 || event.flags & EV_ERROR)
- return -1;
- not->paths[not->count] = path;
- not->fds[not->count++] = fd;
-
- return 0;
-}
-
-int xnotify_wait(struct xnotify *not, char **path)
-{
- struct kevent event;
- int i;
-
- for (;;) {
- if (kevent(not->kq, NULL, 0, &event, 1, NULL) != -1) {
- // We get the fd for free, but still have to search for the path.
- for (i = 0; i<not->count; i++) if (not->fds[i]==event.ident) {
- *path = not->paths[i];
-
- return event.ident;
- }
- }
- }
-}
-
-#else
-
-#include <sys/inotify.h>
-
-struct xnotify *xnotify_init(int max)
-{
- struct xnotify *not = xzalloc(sizeof(struct xnotify));
-
- not->max = max;
- if ((not->kq = inotify_init()) < 0) perror_exit("inotify_init");
- not->paths = xmalloc(max * sizeof(char *));
- not->fds = xmalloc(max * 2 * sizeof(int));
-
- return not;
-}
-
-int xnotify_add(struct xnotify *not, int fd, char *path)
-{
- int i = 2*not->count;
-
- if (not->max == not->count) error_exit("xnotify_add overflow");
- if ((not->fds[i] = inotify_add_watch(not->kq, path, IN_MODIFY))==-1)
- return -1;
- not->fds[i+1] = fd;
- not->paths[not->count++] = path;
-
- return 0;
-}
-
-int xnotify_wait(struct xnotify *not, char **path)
-{
- struct inotify_event ev;
- int i;
-
- for (;;) {
- if (sizeof(ev)!=read(not->kq, &ev, sizeof(ev))) perror_exit("inotify");
-
- for (i = 0; i<not->count; i++) if (ev.wd==not->fds[2*i]) {
- *path = not->paths[i];
-
- return not->fds[2*i+1];
- }
- }
-}
-
-#endif
-
-#ifdef __APPLE__
-
-ssize_t xattr_get(const char *path, const char *name, void *value, size_t size)
-{
- return getxattr(path, name, value, size, 0, 0);
-}
-
-ssize_t xattr_lget(const char *path, const char *name, void *value, size_t size)
-{
- return getxattr(path, name, value, size, 0, XATTR_NOFOLLOW);
-}
-
-ssize_t xattr_fget(int fd, const char *name, void *value, size_t size)
-{
- return fgetxattr(fd, name, value, size, 0, 0);
-}
-
-ssize_t xattr_list(const char *path, char *list, size_t size)
-{
- return listxattr(path, list, size, 0);
-}
-
-ssize_t xattr_llist(const char *path, char *list, size_t size)
-{
- return listxattr(path, list, size, XATTR_NOFOLLOW);
-}
-
-ssize_t xattr_flist(int fd, char *list, size_t size)
-{
- return flistxattr(fd, list, size, 0);
-}
-
-ssize_t xattr_set(const char* path, const char* name,
- const void* value, size_t size, int flags)
-{
- return setxattr(path, name, value, size, 0, flags);
-}
-
-ssize_t xattr_lset(const char* path, const char* name,
- const void* value, size_t size, int flags)
-{
- return setxattr(path, name, value, size, 0, flags | XATTR_NOFOLLOW);
-}
-
-ssize_t xattr_fset(int fd, const char* name,
- const void* value, size_t size, int flags)
-{
- return fsetxattr(fd, name, value, size, 0, flags);
-}
-
-#else
-
-ssize_t xattr_get(const char *path, const char *name, void *value, size_t size)
-{
- return getxattr(path, name, value, size);
-}
-
-ssize_t xattr_lget(const char *path, const char *name, void *value, size_t size)
-{
- return lgetxattr(path, name, value, size);
-}
-
-ssize_t xattr_fget(int fd, const char *name, void *value, size_t size)
-{
- return fgetxattr(fd, name, value, size);
-}
-
-ssize_t xattr_list(const char *path, char *list, size_t size)
-{
- return listxattr(path, list, size);
-}
-
-ssize_t xattr_llist(const char *path, char *list, size_t size)
-{
- return llistxattr(path, list, size);
-}
-
-ssize_t xattr_flist(int fd, char *list, size_t size)
-{
- return flistxattr(fd, list, size);
-}
-
-ssize_t xattr_set(const char* path, const char* name,
- const void* value, size_t size, int flags)
-{
- return setxattr(path, name, value, size, flags);
-}
-
-ssize_t xattr_lset(const char* path, const char* name,
- const void* value, size_t size, int flags)
-{
- return lsetxattr(path, name, value, size, flags);
-}
-
-ssize_t xattr_fset(int fd, const char* name,
- const void* value, size_t size, int flags)
-{
- return fsetxattr(fd, name, value, size, flags);
-}
-
-
-#endif
-
-#ifdef __APPLE__
-// In the absence of a mknodat system call, fchdir to dirfd and back
-// around a regular mknod call...
-int mknodat(int dirfd, const char *path, mode_t mode, dev_t dev)
-{
- int old_dirfd = open(".", O_RDONLY), result;
-
- if (old_dirfd == -1 || fchdir(dirfd) == -1) return -1;
- result = mknod(path, mode, dev);
- if (fchdir(old_dirfd) == -1) perror_exit("mknodat couldn't return");
- return result;
-}
-#endif
-
-// Signals required by POSIX 2008:
-// http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html
-
-#define SIGNIFY(x) {SIG##x, #x}
-
-static const struct signame signames[] = {
- // POSIX
- SIGNIFY(ABRT), SIGNIFY(ALRM), SIGNIFY(BUS),
- SIGNIFY(FPE), SIGNIFY(HUP), SIGNIFY(ILL), SIGNIFY(INT), SIGNIFY(KILL),
- SIGNIFY(PIPE), SIGNIFY(QUIT), SIGNIFY(SEGV), SIGNIFY(TERM),
- SIGNIFY(USR1), SIGNIFY(USR2), SIGNIFY(SYS), SIGNIFY(TRAP),
- SIGNIFY(VTALRM), SIGNIFY(XCPU), SIGNIFY(XFSZ),
- // Non-POSIX signals that cause termination
- SIGNIFY(PROF), SIGNIFY(IO),
-#ifdef __linux__
- SIGNIFY(STKFLT), SIGNIFY(POLL), SIGNIFY(PWR),
-#elif defined(__APPLE__)
- SIGNIFY(EMT), SIGNIFY(INFO),
-#endif
-
- // Note: sigatexit relies on all the signals with a default disposition that
- // terminates the process coming *before* SIGCHLD.
-
- // POSIX signals that don't cause termination
- SIGNIFY(CHLD), SIGNIFY(CONT), SIGNIFY(STOP), SIGNIFY(TSTP),
- SIGNIFY(TTIN), SIGNIFY(TTOU), SIGNIFY(URG),
- // Non-POSIX signals that don't cause termination
- SIGNIFY(WINCH),
-};
-int signames_len = ARRAY_LEN(signames);
-
-#undef SIGNIFY
-
-void xsignal_all_killers(void *handler)
-{
- int i;
-
- for (i=0; signames[i].num != SIGCHLD; i++)
- if (signames[i].num != SIGKILL)
- xsignal(signames[i].num, handler ? exit_signal : SIG_DFL);
-}
-
-// Convert a string like "9", "KILL", "SIGHUP", or "SIGRTMIN+2" to a number.
-int sig_to_num(char *sigstr)
-{
- int i, offset;
- char *s;
-
- // Numeric?
- i = estrtol(sigstr, &s, 10);
- if (!errno && !*s) return i;
-
- // Skip leading "SIG".
- strcasestart(&sigstr, "sig");
-
- // Named signal?
- for (i=0; i<ARRAY_LEN(signames); i++)
- if (!strcasecmp(sigstr, signames[i].name)) return signames[i].num;
-
- // Real-time signal?
-#ifdef SIGRTMIN
- if (strcasestart(&sigstr, "rtmin")) i = SIGRTMIN;
- else if (strcasestart(&sigstr, "rtmax")) i = SIGRTMAX;
- else return -1;
-
- // No offset?
- if (!*sigstr) return i;
-
- // We allow any offset that's still a real-time signal: SIGRTMIN+20 is fine.
- // Others are more restrictive, only accepting what they show with -l.
- offset = estrtol(sigstr, &s, 10);
- if (errno || *s) return -1;
- i += offset;
- if (i >= SIGRTMIN && i <= SIGRTMAX) return i;
-#endif
-
- return -1;
-}
-
-char *num_to_sig(int sig)
-{
- int i;
-
- // A named signal?
- for (i=0; i<signames_len; i++)
- if (signames[i].num == sig) return signames[i].name;
-
- // A real-time signal?
-#ifdef SIGRTMIN
- if (sig == SIGRTMIN) return "RTMIN";
- if (sig == SIGRTMAX) return "RTMAX";
- if (sig > SIGRTMIN && sig < SIGRTMAX) {
- if (sig-SIGRTMIN <= SIGRTMAX-sig) sprintf(libbuf, "RTMIN+%d", sig-SIGRTMIN);
- else sprintf(libbuf, "RTMAX-%d", SIGRTMAX-sig);
- return libbuf;
- }
-#endif
-
- return NULL;
-}
diff --git a/lib/portability.h b/lib/portability.h
index fb4e0383..6e923611 100644
--- a/lib/portability.h
+++ b/lib/portability.h
@@ -6,9 +6,6 @@
// For musl
#define _ALL_SOURCE
-#ifndef REG_STARTEND
-#define REG_STARTEND 0
-#endif
#ifdef __APPLE__
// macOS 10.13 doesn't have the POSIX 2008 direct access to timespec in
@@ -126,6 +123,8 @@ char *strcasestr(const char *haystack, const char *needle);
#define bswap_32(x) OSSwapInt32(x)
#define bswap_64(x) OSSwapInt64(x)
+int clearenv(void);
+
#elif defined(__FreeBSD__)
#include <sys/endian.h>
@@ -186,24 +185,8 @@ char *strcasestr(const char *haystack, const char *needle);
#endif
#endif
-#if defined(__APPLE__) || defined(__linux__)
-// Linux and macOS has both have getxattr and friends in <sys/xattr.h>, but
-// they aren't compatible.
+#ifndef __FreeBSD__
#include <sys/xattr.h>
-ssize_t xattr_get(const char *, const char *, void *, size_t);
-ssize_t xattr_lget(const char *, const char *, void *, size_t);
-ssize_t xattr_fget(int fd, const char *, void *, size_t);
-ssize_t xattr_list(const char *, char *, size_t);
-ssize_t xattr_llist(const char *, char *, size_t);
-ssize_t xattr_flist(int, char *, size_t);
-ssize_t xattr_set(const char*, const char*, const void*, size_t, int);
-ssize_t xattr_lset(const char*, const char*, const void*, size_t, int);
-ssize_t xattr_fset(int, const char*, const void*, size_t, int);
-#endif
-
-// macOS doesn't have mknodat, but we can fake it.
-#ifdef __APPLE__
-int mknodat(int, const char*, mode_t, dev_t);
#endif
// Android is missing some headers and functions
@@ -267,6 +250,7 @@ pid_t xfork(void);
// use toybox before they're ready to switch to host bionic.
#ifdef __BIONIC__
#include <android/log.h>
+#include <sys/system_properties.h>
#else
typedef enum android_LogPriority {
ANDROID_LOG_UNKNOWN = 0,
@@ -283,11 +267,16 @@ static inline int __android_log_write(int pri, const char *tag, const char *msg)
{
return -1;
}
+#define PROP_VALUE_MAX 92
+static inline int __system_property_set(const char *key, const char *value)
+{
+ return -1;
+}
#endif
-// libprocessgroup is an Android platform library not included in the NDK.
-#if defined(__BIONIC__) && __has_include(<processgroup/sched_policy.h>)
-#include <processgroup/sched_policy.h>
+// libcutils is in AOSP but not Android NDK r18
+#if defined(__BIONIC__) && !defined(__ANDROID_NDK__)
+#include <cutils/sched_policy.h>
#else
static inline int get_sched_policy(int tid, void *policy) {return 0;}
static inline char *get_sched_policy_name(int policy) {return "unknown";}
@@ -297,6 +286,7 @@ static inline char *get_sched_policy_name(int policy) {return "unknown";}
// stub it out for now.
#ifdef __ANDROID_NDK__
#define __android_log_write(a, b, c) (0)
+#define adjtime(x, y) (0)
#endif
#ifndef SYSLOG_NAMES
@@ -316,27 +306,3 @@ int xgetrandom(void *buf, unsigned len, unsigned flags);
#include <string.h>
static inline void confstr(int a, char *b, int c) {strcpy(b, a ? "POSIXLY_CORRECT=1" : "/bin:/usr/bin");}
#endif
-
-// Paper over the differences between BSD kqueue and Linux inotify for tail.
-
-struct xnotify {
- char **paths;
- int max, *fds, count, kq;
-};
-
-struct xnotify *xnotify_init(int max);
-int xnotify_add(struct xnotify *not, int fd, char *path);
-int xnotify_wait(struct xnotify *not, char **path);
-
-#ifdef __APPLE__
-#define f_frsize f_iosize
-#endif
-
-int sig_to_num(char *s);
-char *num_to_sig(int sig);
-
-struct signame {
- int num;
- char *name;
-};
-void xsignal_all_killers(void *handler);
diff --git a/lib/toyflags.h b/lib/toyflags.h
index b158ba88..408c3ec6 100644
--- a/lib/toyflags.h
+++ b/lib/toyflags.h
@@ -15,22 +15,21 @@
// This is a shell built-in function, running in the same process context.
#define TOYFLAG_NOFORK (1<<4)
-#define TOYFLAG_MAYFORK (1<<5)
// Start command with a umask of 0 (saves old umask in this.old_umask)
-#define TOYFLAG_UMASK (1<<6)
+#define TOYFLAG_UMASK (1<<5)
// This command runs as root.
-#define TOYFLAG_STAYROOT (1<<7) // Don't drop suid root before running cmd_main
-#define TOYFLAG_NEEDROOT (1<<8) // Refuse to run if real uid != 0
+#define TOYFLAG_STAYROOT (1<<6) // Don't drop suid root before running cmd_main
+#define TOYFLAG_NEEDROOT (1<<7) // Refuse to run if real uid != 0
#define TOYFLAG_ROOTONLY (TOYFLAG_STAYROOT|TOYFLAG_NEEDROOT)
// Call setlocale to listen to environment variables.
// This invalidates sprintf("%.*s", size, string) as a valid length constraint.
-#define TOYFLAG_LOCALE (1<<9)
+#define TOYFLAG_LOCALE (1<<8)
// Suppress default --help processing
-#define TOYFLAG_NOHELP (1<<10)
+#define TOYFLAG_NOHELP (1<<9)
// Error code to return if argument parsing fails (default 1)
#define TOYFLAG_ARGFAIL(x) (x<<24)
diff --git a/lib/tty.c b/lib/tty.c
index a6b4576a..cb613adc 100644
--- a/lib/tty.c
+++ b/lib/tty.c
@@ -61,6 +61,24 @@ int terminal_probesize(unsigned *xx, unsigned *yy)
return 0;
}
+// Wrapper that parses results from ANSI probe to update screensize.
+// Otherwise acts like scan_key()
+int scan_key_getsize(char *scratch, int timeout_ms, unsigned *xx, unsigned *yy)
+{
+ int key;
+
+ if (512&(key = scan_key(scratch, timeout_ms))) {
+ if (key>0) {
+ if (xx) *xx = (key>>10)&1023;
+ if (yy) *yy = (key>>20)&1023;
+
+ return -3;
+ }
+ }
+
+ return key;
+}
+
// Reset terminal to known state, saving copy of old state if old != NULL.
int set_terminal(int fd, int raw, int speed, struct termios *old)
{
@@ -119,47 +137,33 @@ void xset_terminal(int fd, int raw, int speed, struct termios *old)
}
struct scan_key_list {
- int key;
- char *seq;
-} static const scan_key_list[] = {
- {KEY_UP, "\033[A"}, {KEY_DOWN, "\033[B"},
- {KEY_RIGHT, "\033[C"}, {KEY_LEFT, "\033[D"},
-
- {KEY_UP|KEY_SHIFT, "\033[1;2A"}, {KEY_DOWN|KEY_SHIFT, "\033[1;2B"},
- {KEY_RIGHT|KEY_SHIFT, "\033[1;2C"}, {KEY_LEFT|KEY_SHIFT, "\033[1;2D"},
-
- {KEY_UP|KEY_ALT, "\033[1;3A"}, {KEY_DOWN|KEY_ALT, "\033[1;3B"},
- {KEY_RIGHT|KEY_ALT, "\033[1;3C"}, {KEY_LEFT|KEY_ALT, "\033[1;3D"},
-
- {KEY_UP|KEY_CTRL, "\033[1;5A"}, {KEY_DOWN|KEY_CTRL, "\033[1;5B"},
- {KEY_RIGHT|KEY_CTRL, "\033[1;5C"}, {KEY_LEFT|KEY_CTRL, "\033[1;5D"},
-
- // VT102/VT220 escapes.
- {KEY_HOME, "\033[1~"},
- {KEY_INSERT, "\033[2~"},
- {KEY_DELETE, "\033[3~"},
- {KEY_END, "\033[4~"},
- {KEY_PGUP, "\033[5~"},
- {KEY_PGDN, "\033[6~"},
- // "Normal" "PC" escapes (xterm).
- {KEY_HOME, "\033OH"},
- {KEY_END, "\033OF"},
- // "Application" "PC" escapes (gnome-terminal).
- {KEY_HOME, "\033[H"},
- {KEY_END, "\033[F"},
-
- {KEY_FN+1, "\033OP"}, {KEY_FN+2, "\033OQ"}, {KEY_FN+3, "\033OR"},
- {KEY_FN+4, "\033OS"}, {KEY_FN+5, "\033[15~"}, {KEY_FN+6, "\033[17~"},
- {KEY_FN+7, "\033[18~"}, {KEY_FN+8, "\033[19~"}, {KEY_FN+9, "\033[20~"},
-};
-
-// Scan stdin for a keypress, parsing known escape sequences, including
-// responses to screen size queries.
-// Blocks for timeout_ms milliseconds, 0=return immediately, -1=wait forever.
-// Returns 0-255=literal, -1=EOF, -2=TIMEOUT, -3=RESIZE, 256+= a KEY_ constant.
-// Scratch space is necessary because last char of !seq could start new seq.
-// Zero out first byte of scratch before first call to scan_key.
-int scan_key_getsize(char *scratch, int timeout_ms, unsigned *xx, unsigned *yy)
+ char *name, *seq;
+} static const scan_key_list[] = TAGGED_ARRAY(KEY,
+ // up down right left pgup pgdn home end ins
+ {"UP", "\033[A"}, {"DOWN", "\033[B"}, {"RIGHT", "\033[C"}, {"LEFT", "\033[D"},
+ {"PGUP", "\033[5~"}, {"PGDN", "\033[6~"}, {"HOME", "\033OH"},
+ {"END", "\033OF"}, {"INSERT", "\033[2~"},
+
+ {"F1", "\033OP"}, {"F2", "\033OQ"}, {"F3", "\033OR"}, {"F4", "\033OS"},
+ {"F5", "\033[15~"}, {"F6", "\033[17~"}, {"F7", "\033[18~"},
+ {"F8", "\033[19~"}, {"F9", "\033[20~"},
+
+ {"SUP", "\033[1;2A"}, {"AUP", "\033[1;3A"}, {"CUP", "\033[1;5A"},
+ {"SDOWN", "\033[1;2B"}, {"ADOWN", "\033[1;3B"}, {"CDOWN", "\033[1;5B"},
+ {"SRIGHT", "\033[1;2C"}, {"ARIGHT", "\033[1;3C"}, {"CRIGHT", "\033[1;5C"},
+ {"SLEFT", "\033[1;2D"}, {"ALEFT", "\033[1;3D"}, {"CLEFT", "\033[1;5D"},
+
+ {"SF1", "\033O1;2P"}, {"AF1", "\033O1;3P"}, {"CF1", "\033[1;5P"}
+);
+
+// Scan stdin for a keypress, parsing known escape sequences
+// Blocks for timeout_ms milliseconds, none 0, forever if -1
+// Returns: 0-255=literal, -1=EOF, -2=TIMEOUT, 256-...=index into scan_key_list
+// >512 is x<<9+y<<21
+// scratch space is necessary because last char of !seq could start new seq
+// Zero out first byte of scratch before first call to scan_key
+// block=0 allows fetching multiple characters before updating display
+int scan_key(char *scratch, int timeout_ms)
{
struct pollfd pfd;
int maybe, i, j;
@@ -183,9 +187,7 @@ int scan_key_getsize(char *scratch, int timeout_ms, unsigned *xx, unsigned *yy)
if (pos[5]) {
// Recognized X/Y position, consume and return
*scratch = 0;
- if (xx) *xx = x;
- if (yy) *yy = y;
- return -3;
+ return 512+(x<<10)+(y<<20);
} else for (i=0; i<6; i++) if (pos[i]==*scratch) maybe = 1;
// Check sequences
@@ -197,7 +199,7 @@ int scan_key_getsize(char *scratch, int timeout_ms, unsigned *xx, unsigned *yy)
if (!test[j]) {
// We recognized current sequence: consume and return
*scratch = 0;
- return 256+scan_key_list[i].key;
+ return 256+i;
}
}
}
@@ -227,13 +229,6 @@ int scan_key_getsize(char *scratch, int timeout_ms, unsigned *xx, unsigned *yy)
return i;
}
-// Wrapper that ignores results from ANSI probe to update screensize.
-// Otherwise acts like scan_key_getsize().
-int scan_key(char *scratch, int timeout_ms)
-{
- return scan_key_getsize(scratch, timeout_ms, NULL, NULL);
-}
-
void tty_esc(char *s)
{
printf("\033[%s", s);
diff --git a/lib/xwrap.c b/lib/xwrap.c
index 1a3ef837..31843edf 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -54,7 +54,7 @@ void xexit(void)
free(al);
}
- xflush(1);
+ if (fflush(0) || ferror(stdout)) if (!toys.exitval) perror_msg("write");
_xexit();
}
@@ -139,11 +139,9 @@ char *xmprintf(char *format, ...)
return ret;
}
-// if !flush just check for error on stdout without flushing
-void xflush(int flush)
+void xflush(void)
{
- if ((flush && fflush(0)) || ferror(stdout))
- if (!toys.exitval) perror_msg("write");
+ if (fflush(stdout) || ferror(stdout)) perror_exit("write");
}
void xprintf(char *format, ...)
@@ -153,7 +151,7 @@ void xprintf(char *format, ...)
vprintf(format, va);
va_end(va);
- xflush(0);
+ xflush();
}
// Put string with length (does not append newline)
@@ -166,7 +164,7 @@ void xputsl(char *s, int len)
len -= out;
s += out;
}
- xflush(0);
+ xflush();
}
// xputs with no newline
@@ -179,13 +177,13 @@ void xputsn(char *s)
void xputs(char *s)
{
puts(s);
- xflush(0);
+ xflush();
}
void xputc(char c)
{
if (EOF == fputc(c, stdout)) perror_exit("write");
- xflush(0);
+ xflush();
}
// This is called through the XVFORK macro because parent/child of vfork
@@ -197,7 +195,7 @@ pid_t __attribute__((returns_twice)) xvforkwrap(pid_t pid)
if (pid == -1) perror_exit("vfork");
// Signal to xexec() and friends that we vforked so can't recurse
- if (!pid) toys.stacktop = 0;
+ toys.stacktop = 0;
return pid;
}
@@ -237,25 +235,20 @@ pid_t xpopen_both(char **argv, int *pipes)
if (!(pid = CFG_TOYBOX_FORK ? xfork() : XVFORK())) {
// Child process: Dance of the stdin/stdout redirection.
- // cestnepasun[1]->cestnepasun[0] and cestnepasun[3]->cestnepasun[2]
if (pipes) {
// if we had no stdin/out, pipe handles could overlap, so test for it
// and free up potentially overlapping pipe handles before reuse
-
- // in child, close read end of output pipe, use write end as new stdout
if (cestnepasun[2]) {
close(cestnepasun[2]);
pipes[1] = cestnepasun[3];
}
-
- // in child, close write end of input pipe, use read end as new stdin
if (cestnepasun[1]) {
close(cestnepasun[1]);
pipes[0] = cestnepasun[0];
}
- // If swapping stdin/stdout, dup a filehandle that gets closed before use
- if (!pipes[1]) pipes[1] = dup(0);
+ // If swapping stdin/stdout
+ if (!pipes[1]) pipes[1] = dup(pipes[1]);
// Are we redirecting stdin?
if (pipes[0]) {
@@ -266,7 +259,7 @@ pid_t xpopen_both(char **argv, int *pipes)
// Are we redirecting stdout?
if (pipes[1] != 1) {
dup2(pipes[1], 1);
- close(pipes[1]);
+ if (cestnepasun[2]) close(cestnepasun[2]);
}
}
if (argv) xexec(argv);
@@ -316,7 +309,7 @@ int xwaitpid(pid_t pid)
while (-1 == waitpid(pid, &status, 0) && errno == EINTR);
- return WIFEXITED(status) ? WEXITSTATUS(status) : WTERMSIG(status)+128;
+ return WIFEXITED(status) ? WEXITSTATUS(status) : WTERMSIG(status)+127;
}
int xpclose_both(pid_t pid, int *pipes)
@@ -805,22 +798,20 @@ void xpidfile(char *name)
}
// Return bytes copied from in to out. If bytes <0 copy all of in to out.
-// If consuemd isn't null, amount read saved there (return is written or error)
-long long sendfile_len(int in, int out, long long bytes, long long *consumed)
+long long sendfile_len(int in, int out, long long bytes)
{
- long long total = 0, len;
+ long long total = 0;
+ long len;
- if (consumed) *consumed = 0;
if (in<0) return 0;
- while (bytes != total) {
+ for (;;) {
+ if (bytes == total) break;
len = bytes-total;
if (bytes<0 || len>sizeof(libbuf)) len = sizeof(libbuf);
- len = read(in, libbuf, len);
- if (!len && errno==EAGAIN) continue;
+ len = xread(in, libbuf, len);
if (len<1) break;
- if (consumed) *consumed += len;
- if (writeall(out, libbuf, len) != len) return -1;
+ xwrite(out, libbuf, len);
total += len;
}
@@ -830,12 +821,9 @@ long long sendfile_len(int in, int out, long long bytes, long long *consumed)
// error_exit if we couldn't copy all bytes
long long xsendfile_len(int in, int out, long long bytes)
{
- long long len = sendfile_len(in, out, bytes, 0);
+ long long len = sendfile_len(in, out, bytes);
- if (bytes != -1 && bytes != len) {
- if (out == 1 && len<0) xexit();
- error_exit("short %s", (len<0) ? "write" : "read");
- }
+ if (bytes != -1 && bytes != len) error_exit("short file");
return len;
}
@@ -922,18 +910,11 @@ long long xparsemillitime(char *arg)
// Compile a regular expression into a regex_t
void xregcomp(regex_t *preg, char *regex, int cflags)
{
- int rc;
-
- // BSD regex implementations don't support the empty regex (which isn't
- // allowed in the POSIX grammar), but glibc does. Fake it for BSD.
- if (!*regex) {
- regex = "()";
- cflags |= REG_EXTENDED;
- }
+ int rc = regcomp(preg, regex, cflags);
- if ((rc = regcomp(preg, regex, cflags))) {
+ if (rc) {
regerror(rc, preg, libbuf, sizeof(libbuf));
- error_exit("bad regex: %s", libbuf);
+ error_exit("xregcomp: %s", libbuf);
}
}
@@ -1052,18 +1033,3 @@ void xparsedate(char *str, time_t *t, unsigned *nano, int endian)
if (oldtz) setenv("TZ", oldtz, 1);
free(oldtz);
}
-
-char *xgetline(FILE *fp, int *len)
-{
- char *new = 0;
- size_t linelen = 0;
-
- errno = 0;
- if (1>(linelen = getline(&new, &linelen, fp))) {
- if (errno) perror_msg("getline");
- new = 0;
- } else if (new[linelen-1] == '\n') new[--linelen] = 0;
- if (len) *len = linelen;
-
- return new;
-}
diff --git a/main.c b/main.c
index e13b5c29..fdd075d1 100644
--- a/main.c
+++ b/main.c
@@ -9,7 +9,7 @@
#ifndef TOYBOX_VENDOR
#define TOYBOX_VENDOR ""
#endif
-#define TOYBOX_VERSION "0.8.2"TOYBOX_VENDOR
+#define TOYBOX_VERSION "0.8.0"TOYBOX_VENDOR
#endif
// Populate toy_list[].
@@ -39,7 +39,7 @@ struct toy_list *toy_find(char *name)
// If the name starts with "toybox" accept that as a match. Otherwise
// skip the first entry, which is out of order.
- if (!strncmp(name, "toybox", 6)) return toy_list;
+ if (!strncmp(name,"toybox",6)) return toy_list;
bottom = 1;
// Binary search to find this command.
@@ -49,7 +49,7 @@ struct toy_list *toy_find(char *name)
int result;
middle = (top+bottom)/2;
- if (middle<bottom || middle>top) return 0;
+ if (middle<bottom || middle>top) return NULL;
result = strcmp(name,toy_list[middle].name);
if (!result) return toy_list+middle;
if (result<0) top = --middle;
@@ -84,7 +84,6 @@ static void toy_singleinit(struct toy_list *which, char *argv[])
toys.argv = argv;
if (CFG_TOYBOX_I18N) setlocale(LC_CTYPE, "C.UTF-8");
- setlinebuf(stdout);
// Parse --help and --version for (almost) all commands
if (CFG_TOYBOX_HELP_DASHDASH && !(which->flags & TOYFLAG_NOHELP) && argv[1]) {
@@ -189,12 +188,8 @@ void toybox_main(void)
// Try dereferencing one layer of symlink
if (toys.argv[1]) {
toy_exec(toys.argv+1);
- if (0<readlink(toys.argv[1], libbuf, sizeof(libbuf))) {
- struct toy_list *tl= toy_find(basename(libbuf));
-
- if (tl == toy_list) unknown(basename(toys.argv[1]));
- else toy_exec_which(tl, toys.argv+1);
- }
+ if (0<readlink(toys.argv[1], libbuf, sizeof(libbuf)))
+ toy_exec_which(toy_find(basename(libbuf)), toys.argv);
}
// For early error reporting
diff --git a/regenerate.sh b/regenerate.sh
deleted file mode 100755
index 689a482a..00000000
--- a/regenerate.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-set -e
-
-rm -rf .config generated/ android/
-
-function generate() {
- which=$1
- echo -e "\n-------- $1\n"
-
- # These are the only generated files we actually need.
- files="config.h flags.h globals.h help.h newtoys.h tags.h"
-
- cp .config-$which .config
- NOBUILD=1 scripts/make.sh
- out=android/$which/generated/
- mkdir -p $out
- for f in $files; do cp generated/$f $out/$f ; done
- rm -rf .config generated/
-}
-
-generate "device"
-generate "linux"
-generate "mac"
diff --git a/run-tests-on-android.sh b/run-tests-on-android.sh
index 9f9da7f3..aefbdc0b 100755
--- a/run-tests-on-android.sh
+++ b/run-tests-on-android.sh
@@ -1,29 +1,12 @@
#!/bin/bash
-#
-# Setup.
-#
-
# Copy the toybox tests across.
-adb shell rm -rf /data/local/tmp/toybox-tests/
adb shell mkdir /data/local/tmp/toybox-tests/
adb push tests/ /data/local/tmp/toybox-tests/
adb push scripts/runtest.sh /data/local/tmp/toybox-tests/
# Make a temporary directory on the device.
-tmp_dir=`adb shell mktemp --directory /data/local/tmp/toybox-tests-tmp.XXXXXXXXXX`
-
-if tty -s; then
- green="\033[1;32m"
- red="\033[1;31m"
- plain="\033[0m"
- dash_t="-t"
-else
- green=""
- red=""
- plain=""
- dash_t=""
-fi
+tmp_dir=`adb shell TMPDIR=/data/local/tmp mktemp --directory`
test_toy() {
toy=$1
@@ -31,7 +14,7 @@ test_toy() {
echo
location=$(adb shell "which $toy")
- if [ -z "$location" ]; then
+ if [ $? -ne 0 ]; then
echo "-- $toy not present"
return
fi
@@ -39,43 +22,20 @@ test_toy() {
echo "-- $toy"
implementation=$(adb shell "realpath $location")
- non_toy=false
if [ "$implementation" != "/system/bin/toybox" ]; then
echo "-- note: $toy is non-toybox implementation"
- non_toy=true
fi
- adb shell $dash_t "\
- export C=\"\$(which $toy)\"; \
- export CMDNAME=$toy; \
- export FILES=/data/local/tmp/toybox-tests/tests/files/ ; \
- export LANG=en_US.UTF-8; \
- export VERBOSE=1 ; \
- mkdir $tmp_dir/$toy && cd $tmp_dir/$toy ; \
- source /data/local/tmp/toybox-tests/runtest.sh ; \
- source /data/local/tmp/toybox-tests/tests/$toy.test ; \
- if [ "\$FAILCOUNT" -ne 0 ]; then exit 1; fi; \
- cd .. && rm -rf $toy"
- if [ $? -eq 0 ]; then
- pass_count=$(($pass_count+1))
- elif [ "$non_toy" = "true" ]; then
- non_toy_failures="$non_toy_failures $toy"
- else
- if [ "$toy" = "pidof" ]; then
- # cuttlefish is currently broken (http://b/142798587)
- non_toy_failures="$non_toy_failures $toy"
- else
- failures="$failures $toy"
- fi
- fi
+ adb shell -t "export FILES=/data/local/tmp/toybox-tests/tests/files/ ; \
+ export VERBOSE=1 ; \
+ export CMDNAME=$toy; \
+ export C=$toy; \
+ export LANG=en_US.UTF-8; \
+ cd $tmp_dir ; \
+ source /data/local/tmp/toybox-tests/runtest.sh ; \
+ source /data/local/tmp/toybox-tests/tests/$toy.test"
}
-#
-# Run the selected test or all tests.
-#
-
-failures=""
-pass_count=0
if [ "$#" -eq 0 ]; then
# Run all the tests.
for t in tests/*.test; do
@@ -88,24 +48,3 @@ else
test_toy $toy
done
fi
-
-#
-# Show a summary and return a meaningful exit status.
-#
-
-echo
-echo "_________________________________________________________________________"
-echo
-echo -e "${green}PASSED${plain}: $pass_count"
-for failure in $failures; do
- echo -e "${red}FAILED${plain}: $failure"
-done
-for failure in $non_toy_failures; do
- echo -e "${red}FAILED${plain}: $failure (ignoring)"
-done
-
-# We should have run *something*...
-if [ $pass_count -eq 0 ]; then exit 1; fi
-# And all failures are bad...
-if [ -n "$failures" ]; then exit 1; fi
-exit 0
diff --git a/scripts/config2help.c b/scripts/config2help.c
index 0eff7087..edb1caea 100644
--- a/scripts/config2help.c
+++ b/scripts/config2help.c
@@ -479,7 +479,7 @@ int main(int argc, char *argv[])
struct double_list *dd;
if (sym->help) {
- int i, blank;
+ int i;
char *s;
strcpy(s = xmalloc(strlen(sym->name)+1), sym->name);
@@ -489,28 +489,21 @@ int main(int argc, char *argv[])
free(s);
dd = sym->help;
- blank = 0;
for (;;) {
+ i = sym->help_indent;
// Trim leading whitespace
s = dd->data;
- i = sym->help_indent;
- while (isspace(*s) && i--) s++;
-
- // Only one blank line between nonblank lines, not at start or end.
- if (!*s) blank = 2;
- else {
- while (blank--) {
- putchar('\\');
- putchar('n');
- }
- blank = 1;
+ while (isspace(*s) && i) {
+ s++;
+ i--;
}
-
for (i=0; s[i]; i++) {
if (s[i] == '"' || s[i] == '\\') putchar('\\');
putchar(s[i]);
}
+ putchar('\\');
+ putchar('n');
dd = dd->next;
if (dd == sym->help) break;
}
diff --git a/scripts/cross.sh b/scripts/cross.sh
deleted file mode 100755
index 6dac8ec0..00000000
--- a/scripts/cross.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-
-# Convenience wrapper to set $CROSS_COMPILE from short name using "ccc"
-# symlink (Cross C Compiler) to a directory of cross compilers named
-# $TARGET-*-cross. Tested with scripts/mcm-buildall.sh output.
-
-# Usage: scripts/cross.sh $TARGET make distclean defconfig toybox
-# With no arguments, lists available targets. Use target "all" to iterate
-# through each $TARGET from the list.
-
-CCC="$(dirname "$(readlink -f "$0")")"/../ccc
-if [ ! -d "$CCC" ]
-then
- echo "Create symlink 'ccc' to cross compiler directory, ala:"
- echo " ln -s ~/musl-cross-make/ccc ccc"
- exit 1
-fi
-
-unset X Y
-
-# Display target list?
-list()
-{
- ls "$CCC" | sed 's/-.*//' | sort -u | xargs
-}
-[ $# -eq 0 ] && list && exit
-
-X="$1"
-shift
-
-# build all targets?
-if [ "$X" == all ]
-then
- for TARGET in $(list)
- do
- {
- export TARGET
- "$0" $TARGET "$@" 2>&1 || mv cross-log-$TARGET.{txt,failed}
- } | tee cross-log-$TARGET.txt
- done
-
- exit
-fi
-
-# Call command with CROSS_COMPILE= as its first argument
-
-Y=$(echo "$CCC/$X"-*cross)
-Z=$(basename "$Y")
-Y=$(readlink -f "$CCC"/$X-*cross)
-export TARGET="${Z/-*/}"
-X="$Y/bin/${Z/-cross/-}"
-[ ! -e "${X}cc" ] && echo "${X}cc not found" && exit 1
-
-CROSS_COMPILE="$X" "$@"
diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh
index 724888b3..21e6c7b7 100755
--- a/scripts/genconfig.sh
+++ b/scripts/genconfig.sh
@@ -33,12 +33,10 @@ probeconfig()
# Probe for container support on target
probesymbol TOYBOX_CONTAINER << EOF
- #include <stdio.h>
- #include <sys/syscall.h>
#include <linux/sched.h>
int x=CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET;
- int main(int argc, char *argv[]){printf("%d", x+SYS_unshare+ SYS_setns);}
+ int main(int argc, char *argv[]) { setns(0,0); return unshare(x); }
EOF
probesymbol TOYBOX_FIFREEZE -c << EOF
@@ -87,7 +85,7 @@ EOF
EOF
probesymbol TOYBOX_ANDROID_SCHEDPOLICY << EOF
- #include <processgroup/sched_policy.h>
+ #include <cutils/sched_policy.h>
int main(int argc,char *argv[]) { get_sched_policy_name(0); }
EOF
@@ -162,7 +160,7 @@ do
PENDING="$PENDING $NAME" ||
WORKING="$WORKING $NAME"
done &&
-echo -e "clean::\n\t@rm -f $WORKING $PENDING" &&
+echo -e "clean::\n\trm -f $WORKING $PENDING" &&
echo -e "list:\n\t@echo $(echo $WORKING | tr ' ' '\n' | sort | xargs)" &&
echo -e "list_pending:\n\t@echo $(echo $PENDING | tr ' ' '\n' | sort | xargs)" &&
echo -e ".PHONY: $WORKING $PENDING" | $SED 's/ \([^ ]\)/ test_\1/g'
diff --git a/scripts/install.sh b/scripts/install.sh
index 92d81574..96d5bbdf 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -106,10 +106,10 @@ done
# The following are commands toybox should provide, but doesn't yet.
# For now symlink the host version. This list must go away by 1.0.
-PENDING="dd diff expr ftpd less tr vi wget awk sh sha512sum sha256sum unxz xzcat bc bison flex make nm ar gzip"
+PENDING="bunzip2 bzcat dd diff expr ftpd ftpget ftpput gunzip less route tar tr vi wget zcat awk bzip2 fdisk gzip sh sha512sum sha256sum unxz xzcat bc bison flex"
# "gcc" should go away for llvm, but some things still hardwire it
-TOOLCHAIN="as cc ld gcc objdump"
+TOOLCHAIN="ar as nm cc make ld gcc objdump"
if [ ! -z "$AIRLOCK" ]
then
diff --git a/scripts/make.sh b/scripts/make.sh
index 538ba121..2fc94b4c 100755
--- a/scripts/make.sh
+++ b/scripts/make.sh
@@ -2,25 +2,17 @@
# Grab default values for $CFLAGS and such.
-if [ ! -z "$ASAN" ]; then
- # Turn ASan on.
- CFLAGS="-fsanitize=address $CFLAGS"
- # Optional, but effectively necessary if you want useful backtraces.
- CFLAGS="-O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls $CFLAGS"
-fi
-
export LANG=c
export LC_ALL=C
set -o pipefail
source scripts/portability.sh
[ -z "$KCONFIG_CONFIG" ] && KCONFIG_CONFIG=.config
-[ -z "$OUTNAME" ] && OUTNAME=toybox"${TARGET:+-$TARGET}"
+[ -z "$OUTNAME" ] && OUTNAME=toybox
UNSTRIPPED="generated/unstripped/$(basename "$OUTNAME")"
# Try to keep one more cc invocation going than we have processors
-[ -z "$CPUS" ] && \
- CPUS=$(($(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null)+1))
+[ -z "$CPUS" ] && CPUS=$(($(nproc 2>/dev/null)+1))
# Respond to V= by echoing command lines as well as running them
DOTPROG=
@@ -112,7 +104,7 @@ then
# for it.
> generated/optlibs.dat
- for i in util crypt m resolv selinux smack attr crypto z log iconv
+ for i in util crypt m resolv selinux smack attr rt crypto z log iconv
do
echo "int main(int argc, char *argv[]) {return 0;}" | \
${CROSS_COMPILE}${CC} $CFLAGS $LDFLAGS -xc - -o generated/libprobe $LDASNEEDED -l$i > /dev/null 2>/dev/null &&
@@ -159,7 +151,7 @@ then
$KCONFIG_CONFIG > generated/config.h || exit 1
fi
-if [ ! -f generated/mkflags ] || [ generated/mkflags -ot scripts/mkflags.c ]
+if [ generated/mkflags -ot scripts/mkflags.c ]
then
do_loudly $HOSTCC scripts/mkflags.c -o generated/mkflags || exit 1
fi
@@ -243,7 +235,7 @@ then
) > generated/globals.h
fi
-if [ ! -f generated/mktags ] || [ generated/mktags -ot scripts/mktags.c ]
+if [ generated/mktags -ot scripts/mktags.c ]
then
do_loudly $HOSTCC scripts/mktags.c -o generated/mktags || exit 1
fi
@@ -256,7 +248,7 @@ then
toys/*/*.c lib/*.c | generated/mktags > generated/tags.h
fi
-if [ ! -f generated/config2help ] || [ generated/config2help -ot scripts/config2help.c ]
+if [ generated/config2help -ot scripts/config2help.c ]
then
do_loudly $HOSTCC scripts/config2help.c -o generated/config2help || exit 1
fi
@@ -304,7 +296,7 @@ do
# $LIBFILES doesn't need to be rebuilt if older than .config, $TOYFILES does
# ($TOYFILES contents can depend on CONFIG symbols, lib/*.c never should.)
- [ "$OUT" -nt "$i" ] && [ -z "$CLICK" -o "$OUT" -nt "$KCONFIG_CONFIG" ] &&
+ [ "$OUT" -nt "$i" ] && [ -z "$CLICK" -o "$OUT" -ot "$KCONFIG_CONFIG" ] &&
continue
do_loudly $BUILD -c $i -o $OUT &
@@ -339,7 +331,7 @@ do_loudly $BUILD $LNKFILES $LINK || exit 1
if [ ! -z "$NOSTRIP" ] ||
! do_loudly ${CROSS_COMPILE}${STRIP} "$UNSTRIPPED" -o "$OUTNAME"
then
- [ -z "$NOSTRIP" ] && echo "strip failed, using unstripped"
+ echo "strip failed, using unstripped" &&
rm -f "$OUTNAME" &&
cp "$UNSTRIPPED" "$OUTNAME" ||
exit 1
diff --git a/scripts/mcm-buildall.sh b/scripts/mcm-buildall.sh
deleted file mode 100755
index 21e650e2..00000000
--- a/scripts/mcm-buildall.sh
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/bin/bash
-
-# Script to build all cross and native compilers supported by musl-libc.
-# This isn't directly used by toybox, but is useful for testing.
-
-if [ ! -d litecross ]
-then
- echo Run this script in musl-cross-make directory to make "ccc" directory.
- echo
- echo " "git clone https://github.com/richfelker/musl-cross-make
- echo " "cd musl-cross-make
- echo ' ~/toybox/scripts/mcm-buildall.sh'
- exit 1
-fi
-
-# All toolchains after the first are themselves cross compiled (so they
-# can be statically linked against musl on the host, for binary portability.)
-# static i686 binaries are basically "poor man's x32".
-BOOTSTRAP=i686-linux-musl
-
-[ -z "$OUTPUT" ] && OUTPUT="$PWD/ccc"
-
-if [ "$1" == clean ]
-then
- rm -rf "$OUTPUT" host-* *.log
- make clean
- exit
-fi
-
-make_toolchain()
-{
- # Set cross compiler path
- LP="$PATH"
- if [ -z "$TYPE" ]
- then
- OUTPUT="$PWD/host-$TARGET"
- EXTRASUB=y
- else
- if [ "$TYPE" == static ]
- then
- HOST=$BOOTSTRAP
- [ "$TARGET" = "$HOST" ] && LP="$PWD/host-$HOST/bin:$LP"
- TYPE=cross
- EXTRASUB=y
- LP="$OUTPUT/$HOST-cross/bin:$LP"
- else
- HOST="$TARGET"
- export NATIVE=y
- LP="$OUTPUT/${RENAME:-$TARGET}-cross/bin:$LP"
- fi
- COMMON_CONFIG="CC=\"$HOST-gcc -static --static\" CXX=\"$HOST-g++ -static --static\""
- export -n HOST
- OUTPUT="$OUTPUT/${RENAME:-$TARGET}-$TYPE"
- fi
-
- if [ -e "$OUTPUT.sqf" ] || [ -e "$OUTPUT/bin/$TARGET-ld" ] ||
- [ -e "$OUTPUT/bin/ld" ]
- then
- return
- fi
-
- # Change title bar to say what we're currently building
-
- echo === building $TARGET-$TYPE
- echo -en "\033]2;$TARGET-$TYPE\007"
-
- rm -rf build/"$TARGET" "$OUTPUT" &&
- if [ -z "$CPUS" ]
- then
- CPUS="$(nproc)"
- [ "$CPUS" != 1 ] && CPUS=$(($CPUS+1))
- fi
- set -x &&
- PATH="$LP" make OUTPUT="$OUTPUT" TARGET="$TARGET" \
- GCC_CONFIG="--disable-nls --disable-libquadmath --disable-decimal-float --disable-multilib --enable-languages=c,c++ $GCC_CONFIG" \
- COMMON_CONFIG="CFLAGS=\"$CFLAGS -g0 -Os\" CXXFLAGS=\"$CXXFLAGS -g0 -Os\" LDFLAGS=\"$LDFLAGS -s\" $COMMON_CONFIG" \
- install -j$CPUS || exit 1
- set +x
- echo -e '#ifndef __MUSL__\n#define __MUSL__ 1\n#endif' \
- >> "$OUTPUT/${EXTRASUB:+$TARGET/}include/features.h"
-
- if [ ! -z "$RENAME" ] && [ "$TYPE" == cross ]
- then
- CONTEXT="output/$RENAME-cross/bin"
- for i in "$CONTEXT/$TARGET-"*
- do
- X="$(echo $i | sed "s@.*/$TARGET-\([^-]*\)@\1@")"
- ln -sf "$TARGET-$X" "$CONTEXT/$RENAME-$X"
- done
- fi
-
- # Prevent cross compiler reusing dynamically linked host build files for
- # $BOOTSTRAP arch
- [ -z "$TYPE" ] && make clean
-
- if [ "$TYPE" == native ]
- then
- # gcc looks in "../usr/include" but not "/bin/../include" (relative to the
- # executable). That means /usr/bin/gcc looks in /usr/usr/include, so that's
- # not a fix either. So add a NOP symlink as a workaround for The Crazy.
- ln -s . "$OUTPUT/usr" || exit 1
- [ ! -z "$(which mksquashfs 2>/dev/null)" ] &&
- mksquashfs "$OUTPUT" "$OUTPUT.sqf" -all-root &&
- [ -z "$CLEANUP" ] && rm -rf "$OUTPUT"
- fi
-}
-
-# Expand compressed target into binutils/gcc "tuple" and call make_toolchain
-make_tuple()
-{
- PART1=${1/:*/}
- PART3=${1/*:/}
- PART2=${1:$((${#PART1}+1)):$((${#1}-${#PART3}-${#PART1}-2))}
-
- # Do we need to rename this toolchain after building it?
- RENAME=${PART1/*@/}
- [ "$RENAME" == "$PART1" ] && RENAME=
- PART1=${PART1/@*/}
- TARGET=${PART1}-linux-musl${PART2}
-
- [ -z "$NOCLEAN" ] && rm -rf build
-
- for TYPE in static native
- do
- TYPE=$TYPE TARGET=$TARGET GCC_CONFIG="$PART3" RENAME="$RENAME" \
- make_toolchain 2>&1 | tee "$OUTPUT"/log/${RENAME:-$PART1}-${TYPE}.log
- done
-}
-
-mkdir -p "$OUTPUT"/log
-
-# Make bootstrap compiler (no $TYPE, dynamically linked against host libc)
-# We build the rest of the cross compilers with this so they're linked against
-# musl-libc, because glibc doesn't fully support static linking and dynamic
-# binaries aren't really portable between distributions
-TARGET=$BOOTSTRAP make_toolchain 2>&1 | tee -a "$OUTPUT/log/$BOOTSTRAP"-host.log
-
-if [ $# -gt 0 ]
-then
- for i in "$@"
- do
- make_tuple "$i"
- done
-else
- # Here's the list of cross compilers supported by this build script.
-
- # First target builds a proper version of the $BOOTSTRAP compiler above,
- # which is used to build the rest (in alphabetical order)
- for i in i686:: \
- aarch64:eabi: armv4l:eabihf:"--with-arch=armv5t --with-float=soft" \
- armv5l:eabihf:--with-arch=armv5t armv7l:eabihf:--with-arch=armv7-a \
- "armv7m:eabi:--with-arch=armv7-m --with-mode=thumb --disable-libatomic --enable-default-pie" \
- armv7r:eabihf:"--with-arch=armv7-r --enable-default-pie" \
- i486:: m68k:: microblaze:: mips:: mips64:: mipsel:: powerpc:: \
- powerpc64:: powerpc64le:: s390x:: sh2eb:fdpic:--with-cpu=mj2 \
- sh4::--enable-incomplete-targets x86_64:: x86_64@x32:x32:
- do
- make_tuple "$i"
- done
-fi
diff --git a/scripts/mkroot.sh b/scripts/mkroot.sh
deleted file mode 100755
index fcc42741..00000000
--- a/scripts/mkroot.sh
+++ /dev/null
@@ -1,511 +0,0 @@
-#!/bin/bash
-
-# Clear environment variables by restarting script w/bare minimum passed through
-[ -z "$NOCLEAR" ] &&
- exec env -i NOCLEAR=1 HOME="$HOME" PATH="$PATH" LINUX="$LINUX" \
- CROSS_COMPILE="$CROSS_COMPILE" CROSS_SHORT="$CROSS_SHORT" "$0" "$@"
-
-# assign command line NAME=VALUE args to env vars
-while [ $# -ne 0 ]
-do
- X="${1/=*/}"
- Y="${1#*=}"
- [ "${1/=/}" != "$1" ] && eval "export $X=\"\$Y\"" || echo "unknown $i"
- shift
-done
-
-# If we're cross compiling, set appropriate environment variables.
-if [ -z "$CROSS_COMPILE" ]
-then
- echo "Building natively"
- if ! cc --static -xc - -o /dev/null <<< "int main(void) {return 0;}"
- then
- echo "Warning: host compiler can't create static binaries." >&2
- sleep 3
- fi
-else
- CROSS_PATH="$(dirname "$(which "${CROSS_COMPILE}cc")")"
- CROSS_BASE="$(basename "$CROSS_COMPILE")"
- [ -z "$CROSS_SHORT" ] && CROSS_SHORT="${CROSS_BASE/-*/}"
- echo "Cross compiling to $CROSS_SHORT"
- if [ -z "$CROSS_PATH" ]
- then
- echo "no ${CROSS_COMPILE}cc in path" >&2
- exit 1
- fi
-fi
-
-# set up directories (can override most of these paths on cmdline)
-TOP="$PWD/root"
-[ -z "$BUILD" ] && BUILD="$TOP/build"
-[ -z "$AIRLOCK" ] && AIRLOCK="$TOP/airlock"
-[ -z "$OUTPUT" ] && OUTPUT="$TOP/${CROSS_SHORT:-host}"
-[ -z "$ROOT" ] && ROOT="$OUTPUT/${CROSS_BASE}fs" && rm -rf "$ROOT"
-MYBUILD="$BUILD/${CROSS_BASE:-host-}tmp"
-rm -rf "$MYBUILD" && mkdir -p "$MYBUILD" || exit 1
-
-# Stabilize cross compiling by providing known $PATH contents
-if [ ! -z "$CROSS_COMPILE" ]
-then
- if [ ! -e "$AIRLOCK/toybox" ]
- then
- echo === Create airlock dir
-
- PREFIX="$AIRLOCK" KCONFIG_CONFIG="$TOP"/.airlock CROSS_COMPILE= \
- make clean defconfig toybox install_airlock &&
- rm "$TOP"/.airlock || exit 1
- fi
- export PATH="$CROSS_PATH:$AIRLOCK"
-fi
-
-### Create files and directories
-mkdir -p "$ROOT"/{etc,tmp,proc,sys,dev,home,mnt,root,usr/{bin,sbin,lib},var} &&
-chmod a+rwxt "$ROOT"/tmp && ln -s usr/{bin,sbin,lib} "$ROOT" || exit 1
-
-# init script. Runs as pid 1 from initramfs to set up and hand off system.
-cat > "$ROOT"/init << 'EOF' &&
-#!/bin/sh
-
-export HOME=/home
-export PATH=/bin:/sbin
-
-mountpoint -q proc || mount -t proc proc proc
-mountpoint -q sys || mount -t sysfs sys sys
-if ! mountpoint -q dev
-then
- mount -t devtmpfs dev dev || mdev -s
- mkdir -p dev/pts
- mountpoint -q dev/pts || mount -t devpts dev/pts dev/pts
-fi
-
-if [ $$ -eq 1 ]
-then
- # Setup networking for QEMU (needs /proc)
- ifconfig eth0 10.0.2.15
- route add default gw 10.0.2.2
- [ "$(date +%s)" -lt 1000 ] && rdate 10.0.2.2 # or time-b.nist.gov
- [ "$(date +%s)" -lt 10000000 ] && ntpd -nq -p north-america.pool.ntp.org
-
- [ -z "$CONSOLE" ] &&
- CONSOLE="$(sed -n 's@.* console=\(/dev/\)*\([^ ]*\).*@\2@p' /proc/cmdline)"
-
- [ -z "$HANDOFF" ] && HANDOFF=/bin/sh && echo Type exit when done.
- [ -z "$CONSOLE" ] && CONSOLE=console
- exec /sbin/oneit -c /dev/"$CONSOLE" $HANDOFF
-else
- /bin/sh
- umount /dev/pts /dev /sys /proc
-fi
-EOF
-chmod +x "$ROOT"/init &&
-
-# /etc/passwd with both kernel special accounts (root and nobody) + guest user
-cat > "$ROOT"/etc/passwd << 'EOF' &&
-root::0:0:root:/home/root:/bin/sh
-guest:x:500:500:guest:/home/guest:/bin/sh
-nobody:x:65534:65534:nobody:/proc/self:/dev/null
-EOF
-
-# /etc/group with groups corresponding to each /etc/passwd user
-cat > "$ROOT"/etc/group << 'EOF' &&
-root:x:0:
-guest:x:500:
-nobody:x:65534:
-EOF
-
-# /etc/resolv.conf using Google's public nameserver. (We could use QEMU's
-# 10.0.2.2 forwarder here, but this way works in both chroot and QEMU.)
-echo "nameserver 8.8.8.8" > "$ROOT"/etc/resolv.conf || exit 1
-
-# Build toybox
-
-make clean
-if [ -z .config ]
-then
- make defconfig
- # Work around musl-libc design flaw.
- [ "${CROSS_BASE/fdpic//}" != "$CROSS_BASE" ] &&
- sed -i 's/.*\(CONFIG_TOYBOX_MUSL_NOMMU_IS_BROKEN\).*/\1=y/' .config
-else
- make silentoldconfig
-fi
-LDFLAGS=--static PREFIX="$ROOT" make toybox install || exit 1
-
-# Abort early if no kernel source specified
-if [ -z "$LINUX" ] || [ ! -d "$LINUX/kernel" ]
-then
- echo 'No $LINUX directory, kernel build skipped.'
- rmdir "$MYBUILD" "$BUILD" 2>/dev/null
- exit 0
-fi
-
-# Which architecture are we building a kernel for?
-[ -z "$TARGET" ] && TARGET="${CROSS_BASE/-*/}"
-[ -z "$TARGET" ] && TARGET="$(uname -m)"
-
-# Target-specific info in an (alphabetical order) if/else staircase
-# Each target needs board config, serial console, RTC, ethernet, block device.
-
-if [ "$TARGET" == armv5l ]
-then
-
- # This could use the same VIRT board as armv7, but let's demonstrate a
- # different one requiring a separate device tree binary.
- QEMU="qemu-system-arm -M versatilepb -net nic,model=rtl8139 -net user"
- KARCH=arm
- KARGS="console=ttyAMA0"
- VMLINUX=arch/arm/boot/zImage
- KERNEL_CONFIG="
-CONFIG_CPU_ARM926T=y
-CONFIG_MMU=y
-CONFIG_VFP=y
-CONFIG_ARM_THUMB=y
-CONFIG_AEABI=y
-CONFIG_ARCH_VERSATILE=y
-
-# The switch to device-tree-only added this mess
-CONFIG_ATAGS=y
-CONFIG_DEPRECATED_PARAM_STRUCT=y
-CONFIG_ARM_ATAG_DTB_COMPAT=y
-CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND=y
-
-CONFIG_SERIAL_AMBA_PL011=y
-CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
-
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_DRV_PL031=y
-CONFIG_RTC_HCTOSYS=y
-
-CONFIG_PCI=y
-CONFIG_PCI_VERSATILE=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_SCSI=y
-CONFIG_SCSI_LOWLEVEL=y
-CONFIG_SCSI_SYM53C8XX_2=y
-CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
-CONFIG_SCSI_SYM53C8XX_MMIO=y
-
-CONFIG_NET_VENDOR_REALTEK=y
-CONFIG_8139CP=y
-"
- DTB=arch/arm/boot/dts/versatile-pb.dtb
-elif [ "$TARGET" == armv7l ] || [ "$TARGET" == aarch64 ]
-then
- if [ "$TARGET" == aarch64 ]
- then
- QEMU="qemu-system-aarch64 -M virt -cpu cortex-a57"
- KARCH=arm64
- VMLINUX=arch/arm64/boot/Image
- else
- QEMU="qemu-system-arm -M virt"
- KARCH=arm
- VMLINUX=arch/arm/boot/zImage
- fi
- KARGS="console=ttyAMA0"
- KERNEL_CONFIG="
-CONFIG_MMU=y
-CONFIG_ARCH_MULTI_V7=y
-CONFIG_ARCH_VIRT=y
-CONFIG_SOC_DRA7XX=y
-CONFIG_ARCH_OMAP2PLUS_TYPICAL=y
-CONFIG_ARCH_ALPINE=y
-CONFIG_ARM_THUMB=y
-CONFIG_VDSO=y
-CONFIG_CPU_IDLE=y
-CONFIG_ARM_CPUIDLE=y
-CONFIG_KERNEL_MODE_NEON=y
-
-CONFIG_SERIAL_AMBA_PL011=y
-CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
-
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_HCTOSYS=y
-CONFIG_RTC_DRV_PL031=y
-
-CONFIG_NET_CORE=y
-CONFIG_VIRTIO_MENU=y
-CONFIG_VIRTIO_NET=y
-
-CONFIG_PCI=y
-CONFIG_PCI_HOST_GENERIC=y
-CONFIG_VIRTIO_BLK=y
-CONFIG_VIRTIO_PCI=y
-CONFIG_VIRTIO_MMIO=y
-
-CONFIG_ATA=y
-CONFIG_ATA_SFF=y
-CONFIG_ATA_BMDMA=y
-CONFIG_ATA_PIIX=y
-
-CONFIG_PATA_PLATFORM=y
-CONFIG_PATA_OF_PLATFORM=y
-CONFIG_ATA_GENERIC=y
-"
-elif [ "$TARGET" == i486 ] || [ "$TARGET" == i686 ] ||
- [ "$TARGET" == x86_64 ] || [ "$TARGET" == x32 ]
-then
- if [ "$TARGET" == i486 ]
- then
- QEMU="qemu-system-i386 -cpu 486 -global fw_cfg.dma_enabled=false"
- KERNEL_CONFIG="CONFIG_M486=y"
- elif [ "$TARGET" == i686 ]
- then
- QEMU="qemu-system-i386 -cpu pentium3"
- KERNEL_CONFIG="CONFIG_MPENTIUMII=y"
- else
- QEMU=qemu-system-x86_64
- KERNEL_CONFIG="CONFIG_64BIT=y"
- [ "$TARGET" == x32 ] && KERNEL_CONFIG="$KERNEL_CONFIG
-CONFIG_X86_X32=y"
- fi
- KARCH=x86
- KARGS="console=ttyS0"
- VMLINUX=arch/x86/boot/bzImage
- CONFIG_MPENTIUMII=y
- KERNEL_CONFIG="
-$KERNEL_CONFIG
-
-CONFIG_UNWINDER_FRAME_POINTER=y
-
-CONFIG_PCI=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_ATA=y
-CONFIG_ATA_SFF=y
-CONFIG_ATA_BMDMA=y
-CONFIG_ATA_PIIX=y
-
-CONFIG_NET_VENDOR_INTEL=y
-CONFIG_E1000=y
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_RTC_CLASS=y
-"
-elif [ "$TARGET" == mips ] || [ "$TARGET" == mipsel ]
-then
- QEMU="qemu-system-mips -M malta"
- KARCH=mips
- KARGS="console=ttyS0"
- VMLINUX=vmlinux
- KERNEL_CONFIG="
-CONFIG_MIPS_MALTA=y
-CONFIG_CPU_MIPS32_R2=y
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-
-CONFIG_PCI=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_ATA=y
-CONFIG_ATA_SFF=y
-CONFIG_ATA_BMDMA=y
-CONFIG_ATA_PIIX=y
-
-CONFIG_NET_VENDOR_AMD=y
-CONFIG_PCNET32=y
-
-CONFIG_POWER_RESET=y
-CONFIG_POWER_RESET_SYSCON=y
-"
- [ "$TARGET" == mipsel ] &&
- KERNEL_CONFIG="${KERNEL_CONFIG}CONFIG_CPU_LITTLE_ENDIAN=y" &&
- QEMU="qemu-system-mipsel -M malta"
-elif [ "$TARGET" == powerpc ]
-then
- KARCH=powerpc
- QEMU="qemu-system-ppc -M g3beige"
- KARGS="console=ttyS0"
- VMLINUX=vmlinux
- KERNEL_CONFIG="
-CONFIG_ALTIVEC=y
-CONFIG_PPC_PMAC=y
-CONFIG_PPC_OF_BOOT_TRAMPOLINE=y
-
-CONFIG_IDE=y
-CONFIG_IDE_GD=y
-CONFIG_IDE_GD_ATA=y
-CONFIG_BLK_DEV_IDE_PMAC=y
-CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
-
-CONFIG_MACINTOSH_DRIVERS=y
-CONFIG_ADB=y
-CONFIG_ADB_CUDA=y
-
-CONFIG_NET_VENDOR_NATSEMI=y
-CONFIG_NET_VENDOR_8390=y
-CONFIG_NE2K_PCI=y
-
-CONFIG_SERIO=y
-CONFIG_SERIAL_PMACZILOG=y
-CONFIG_SERIAL_PMACZILOG_TTYS=y
-CONFIG_SERIAL_PMACZILOG_CONSOLE=y
-CONFIG_BOOTX_TEXT=y
-"
-elif [ "$TARGET" == powerpc64le ]
-then
- KARCH=powerpc
- QEMU="qemu-system-ppc64 -M pseries -vga none"
- KARGS="console=/dev/hvc0"
- VMLINUX=vmlinux
- KERNEL_CONFIG="CONFIG_PPC64=y
-CONFIG_PPC_PSERIES=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_PPC_OF_BOOT_TRAMPOLINE=y
-
-CONFIG_BLK_DEV_SD=y
-CONFIG_SCSI_LOWLEVEL=y
-CONFIG_SCSI_IBMVSCSI=y
-CONFIG_ATA=y
-
-CONFIG_NET_VENDOR_IBM=y
-CONFIG_IBMVETH=y
-CONFIG_HVC_CONSOLE=y
-
-# None of this should be necessary
-CONFIG_PPC_TRANSACTIONAL_MEM=y
-CONFIG_PPC_DISABLE_WERROR=y
-CONFIG_SECTION_MISMATCH_WARN_ONLY=y
-"
-elif [ "$TARGET" = s390x ]
-then
- QEMU="qemu-system-s390x"
- KARCH=s390
- VMLINUX=arch/s390/boot/bzImage
- KERNEL_CONFIG="
-CONFIG_MARCH_Z900=y
-CONFIG_PACK_STACK=y
-CONFIG_NET_CORE=y
-CONFIG_VIRTIO_NET=y
-CONFIG_VIRTIO_BLK=y
-CONFIG_SCLP_TTY=y
-CONFIG_SCLP_CONSOLE=y
-CONFIG_SCLP_VT220_TTY=y
-CONFIG_SCLP_VT220_CONSOLE=y
-CONFIG_S390_GUEST=y
-"
-elif [ "$TARGET" == sh4 ]
-then
- QEMU="qemu-system-sh4 -M r2d -serial null -serial mon:stdio"
- KARCH=sh
- KARGS="console=ttySC1 noiotrap"
- VMLINUX=arch/sh/boot/zImage
- KERNEL_CONFIG="
-CONFIG_CPU_SUBTYPE_SH7751R=y
-CONFIG_MMU=y
-CONFIG_MEMORY_START=0x0c000000
-CONFIG_VSYSCALL=y
-CONFIG_SH_FPU=y
-CONFIG_SH_RTS7751R2D=y
-CONFIG_RTS7751R2D_PLUS=y
-CONFIG_SERIAL_SH_SCI=y
-CONFIG_SERIAL_SH_SCI_CONSOLE=y
-
-CONFIG_PCI=y
-CONFIG_NET_VENDOR_REALTEK=y
-CONFIG_8139CP=y
-
-CONFIG_PCI=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_ATA=y
-CONFIG_ATA_SFF=y
-CONFIG_ATA_BMDMA=y
-CONFIG_PATA_PLATFORM=y
-
-CONFIG_BINFMT_ELF_FDPIC=y
-CONFIG_BINFMT_FLAT=y
-
-#CONFIG_SPI=y
-#CONFIG_SPI_SH_SCI=y
-#CONFIG_MFD_SM501=y
-
-#CONFIG_RTC_CLASS=y
-#CONFIG_RTC_DRV_R9701=y
-#CONFIG_RTC_DRV_SH=y
-#CONFIG_RTC_HCTOSYS=y
-"
-else
- echo "Unknown \$TARGET"
- exit 1
-fi
-
-# Write the miniconfig file
-{
- echo "# make ARCH=$KARCH allnoconfig KCONFIG_ALLCONFIG=$TARGET.miniconf"
- echo "# make ARCH=$KARCH -j \$(nproc)"
- echo "# boot $VMLINUX"
- echo
- echo "$KERNEL_CONFIG"
-
- # Generic options for all targets
-
- echo "
-# CONFIG_EMBEDDED is not set
-CONFIG_EARLY_PRINTK=y
-CONFIG_BINFMT_ELF=y
-CONFIG_BINFMT_SCRIPT=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-
-CONFIG_BLK_DEV=y
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_RD_GZIP=y
-
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_EXT4_FS=y
-CONFIG_EXT4_USE_FOR_EXT2=y
-CONFIG_VFAT_FS=y
-CONFIG_FAT_DEFAULT_UTF8=y
-CONFIG_MISC_FILESYSTEMS=y
-CONFIG_SQUASHFS=y
-CONFIG_SQUASHFS_XATTR=y
-CONFIG_SQUASHFS_ZLIB=y
-CONFIG_DEVTMPFS=y
-CONFIG_DEVTMPFS_MOUNT=y
-CONFIG_TMPFS=y
-CONFIG_TMPFS_POSIX_ACL=y
-
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-CONFIG_IPV6=y
-CONFIG_NETDEVICES=y
-#CONFIG_NET_CORE=y
-#CONFIG_NETCONSOLE=y
-CONFIG_ETHERNET=y
-"
-} > "$OUTPUT/miniconfig-$TARGET"
-
-# Write the qemu launch script
-echo "$QEMU -nographic -no-reboot -m 256" \
- "-append \"panic=1 HOST=$TARGET $KARGS\"" \
- "-kernel $(basename "$VMLINUX") -initrd ${CROSS_BASE}root.cpio.gz" \
- ${DTB:+-dtb "$(basename "$DTB")"} '"$@"' \
- > "$OUTPUT/qemu-$TARGET.sh" &&
-chmod +x "$OUTPUT/qemu-$TARGET.sh" &&
-
-echo "Build linux for $KARCH"
-
-# Snapshot Linux source dir and clean it
-cp -sfR "$LINUX" "$MYBUILD/linux" && pushd "$MYBUILD/linux" > /dev/null ||
- exit 1
-
-# Build kernel
-make distclean &&
-make ARCH=$KARCH allnoconfig KCONFIG_ALLCONFIG="$OUTPUT/miniconfig-$TARGET" &&
-make ARCH=$KARCH CROSS_COMPILE="$CROSS_COMPILE" -j $(nproc) || exit 1
-
-# If we have a device tree binary, save it for QEMU.
-if [ ! -z "$DTB" ]
-then
- cp "$DTB" "$OUTPUT/$(basename "$DTB")" || exit 1
-fi
-
-cp "$VMLINUX" "$OUTPUT/$(basename "$VMLINUX")" && cd .. && rm -rf linux &&
- popd || exit 1
-rmdir "$MYBUILD" "$BUILD" 2>/dev/null
-
-# package root filesystem for initramfs.
-# we do it here so module install can add files (not implemented yet)
-echo === create "${CROSS_BASE}root.cpio.gz"
-
-(cd "$ROOT" && find . | cpio -o -H newc | gzip) > \
- "$OUTPUT/${CROSS_BASE}root.cpio.gz"
diff --git a/scripts/portability.sh b/scripts/portability.sh
index 618022c7..abeb31f2 100644
--- a/scripts/portability.sh
+++ b/scripts/portability.sh
@@ -10,5 +10,5 @@ fi
if [ -z "$SED" ]
then
- [ ! -z "$(command -v gsed 2>/dev/null)" ] && SED=gsed || SED=sed
+ [ ! -z "$(which gsed 2>/dev/null)" ] && SED=gsed || SED=sed
fi
diff --git a/scripts/runtest.sh b/scripts/runtest.sh
index 90d6299b..ab10bf44 100644
--- a/scripts/runtest.sh
+++ b/scripts/runtest.sh
@@ -10,7 +10,6 @@
# DEBUG - Show every command run by test script.
# VERBOSE - Print the diff -u of each failed test case.
# If equal to "fail", stop after first failed test.
-# "nopass" to not show successful tests
#
# The "testcmd" function takes five arguments:
# $1) Description to display when running command
@@ -57,7 +56,7 @@ fi
optional()
{
- option=`printf %s "$OPTIONFLAGS" | egrep "(^|:)$1(:|\$)"`
+ option=`echo "$OPTIONFLAGS" | egrep "(^|:)$1(:|\$)"`
# Not set?
if [ -z "$1" ] || [ -z "$OPTIONFLAGS" ] || [ ${#option} -ne 0 ]
then
@@ -75,22 +74,14 @@ skipnot()
else
eval "$@"
fi
- [ $? -eq 0 ] || SKIPNEXT=1
-}
-
-toyonly()
-{
- IS_TOYBOX="$("$C" --version 2>/dev/null)"
- [ "${IS_TOYBOX/toybox/}" == "$IS_TOYBOX" ] && SKIPNEXT=1
-
- "$@"
+ [ $? -eq 0 ] || SKIPNOT=1
}
wrong_args()
{
if [ $# -ne 5 ]
then
- printf "%s\n" "Test $NAME has the wrong number of arguments ($# $*)" >&2
+ echo "Test $NAME has the wrong number of arguments ($# $*)" >&2
exit
fi
}
@@ -106,10 +97,10 @@ testing()
[ -n "$DEBUG" ] && set -x
- if [ -n "$SKIP" -o -n "$SKIP_HOST" -a -n "$TEST_HOST" -o -n "$SKIPNEXT" ]
+ if [ -n "$SKIP" -o -n "$SKIP_HOST" -a -n "$TEST_HOST" -o -n "$SKIPNOT" ]
then
- [ ! -z "$VERBOSE" ] && printf "%s\n" "$SHOWSKIP: $NAME"
- unset SKIPNEXT
+ [ ! -z "$VERBOSE" ] && echo "$SHOWSKIP: $NAME"
+ unset SKIPNOT
return 0
fi
@@ -121,20 +112,21 @@ testing()
# Catch segfaults
[ $RETVAL -gt 128 ] && [ $RETVAL -lt 255 ] &&
echo "exited with signal (or returned $RETVAL)" >> actual
- DIFF="$(diff -au${NOSPACE:+w} expected actual)"
+
+ DIFF="$(diff -au${NOSPACE:+b} expected actual)"
if [ ! -z "$DIFF" ]
then
- FAILCOUNT=$(($FAILCOUNT+1))
- printf "%s\n" "$SHOWFAIL: $NAME"
+ FAILCOUNT=$[$FAILCOUNT+1]
+ echo "$SHOWFAIL: $NAME"
if [ -n "$VERBOSE" ]
then
- [ ! -z "$4" ] && printf "%s\n" "echo -ne \"$4\" > input"
- printf "%s\n" "echo -ne '$5' |$EVAL $2"
- printf "%s\n" "$DIFF"
+ [ ! -z "$4" ] && echo "echo -ne \"$4\" > input"
+ echo "echo -ne '$5' |$EVAL $2"
+ echo "$DIFF"
[ "$VERBOSE" == fail ] && exit 1
fi
else
- [ "$VERBOSE" != "nopass" ] && printf "%s\n" "$SHOWPASS: $NAME"
+ echo "$SHOWPASS: $NAME"
fi
rm -f input expected actual
@@ -149,7 +141,7 @@ testcmd()
X="$1"
[ -z "$X" ] && X="$CMDNAME $2"
- testing "$X" "\"$C\" $2" "$3" "$4" "$5"
+ testing "$X" "$C $2" "$3" "$4" "$5"
}
# Recursively grab an executable and all the libraries needed to run it.
diff --git a/scripts/test.sh b/scripts/test.sh
index d9955a5f..ea58f56f 100755
--- a/scripts/test.sh
+++ b/scripts/test.sh
@@ -34,13 +34,11 @@ do_test()
cd "$TESTDIR" && rm -rf testdir && mkdir testdir && cd testdir || exit 1
CMDNAME="${1##*/}"
CMDNAME="${CMDNAME%.test}"
+ C="$CMDNAME"
if [ -z "$TEST_HOST" ]
then
C="$TESTDIR/$CMDNAME"
[ ! -e "$C" ] && echo "$CMDNAME disabled" && return
- else
- C="$(which $CMDNAME 2>/dev/null)"
- [ -z "$C" ] && "C=$CMDNAME"
fi
. "$1"
diff --git a/tests/blkid.test b/tests/blkid.test
index 5bfce435..deb94d89 100755
--- a/tests/blkid.test
+++ b/tests/blkid.test
@@ -4,51 +4,40 @@
#testing "name" "command" "result" "infile" "stdin"
-function BLKID()
-{
- file=$1
- shift
- bzcat $FILES/blkid/$file.bz2 > temp.img
- # e2fsprogs' blkid outputs trailing spaces; no other blkid does.
- blkid "$@" temp.img | sed 's/ $//'
- rm temp.img
-}
+BDIR="$FILES/blkid"
-testing "cramfs" "BLKID cramfs" \
- 'temp.img: LABEL="mycramfs" TYPE="cramfs"\n' "" ""
-testing "ext2" "BLKID ext2" \
- 'temp.img: LABEL="myext2" UUID="e59093ba-4135-4fdb-bcc4-f20beae4dfaf" TYPE="ext2"\n' \
+bzcat "$BDIR"/squashfs.bz2 > temp.img
+testing "file" "blkid temp.img" 'temp.img: TYPE="squashfs"\n' "" ""
+rm temp.img
+
+testing "cramfs" 'bzcat "$BDIR"/cramfs.bz2 | blkid -' \
+ '-: LABEL="mycramfs" TYPE="cramfs"\n' "" ""
+testing "ext2" 'bzcat "$BDIR"/ext2.bz2 | blkid -' \
+ '-: LABEL="myext2" UUID="e59093ba-4135-4fdb-bcc4-f20beae4dfaf" TYPE="ext2"\n' \
"" ""
-testing "ext3" "BLKID ext3" \
- 'temp.img: LABEL="myext3" UUID="79d1c877-1a0f-4e7d-b21d-fc32ae3ef101" SEC_TYPE="ext2" TYPE="ext3"\n' \
+testing "ext3" 'bzcat "$BDIR"/ext3.bz2 | blkid -' \
+ '-: LABEL="myext3" UUID="79d1c877-1a0f-4e7d-b21d-fc32ae3ef101" TYPE="ext3"\n' \
"" ""
-testing "ext4" "BLKID ext4" \
- 'temp.img: LABEL="myext4" UUID="dc4b7c00-c0c0-4600-af7e-0335f09770fa" TYPE="ext4"\n' \
- "" ""
-testing "f2fs" "BLKID f2fs" \
- 'temp.img: LABEL="myf2fs" UUID="b53d3619-c204-4c0b-8504-36363578491c" TYPE="f2fs"\n' \
+testing "ext4" 'bzcat "$BDIR"/ext4.bz2 | blkid -' \
+ '-: LABEL="myext4" UUID="dc4b7c00-c0c0-4600-af7e-0335f09770fa" TYPE="ext4"\n' \
"" ""
-testing "msdos" "BLKID msdos" \
- 'temp.img: SEC_TYPE="msdos" LABEL="mymsdos" UUID="6E1E-0851" TYPE="vfat"\n' \
- "" ""
-
-# We use -s here because toybox blkid can't do ntfs volume labels yet.
-testing "ntfs" "BLKID ntfs -s UUID -s TYPE" \
- 'temp.img: UUID="6EE1BF3808608585" TYPE="ntfs"\n' "" ""
-testing "reiserfs" "BLKID reiser3" \
- 'temp.img: LABEL="myreiser" UUID="a5b99bec-45cc-41d7-986e-32f4b6fc28f2" TYPE="reiserfs"\n' \
+testing "f2fs" 'bzcat "$BDIR"/f2fs.bz2 | blkid -' \
+ '-: UUID="b53d3619-c204-4c0b-8504-36363578491c" TYPE="f2fs"\n' \
"" ""
-testing "squashfs" "BLKID squashfs" 'temp.img: TYPE="squashfs"\n' "" ""
-testing "vfat" "BLKID vfat" \
- 'temp.img: SEC_TYPE="msdos" LABEL="myvfat" UUID="7356-B91D" TYPE="vfat"\n' \
+testing "msdos" 'bzcat "$BDIR"/msdos.bz2 | blkid -' \
+ '-: LABEL="mymsdos" UUID="5108-1e6e" TYPE="vfat"\n' "" ""
+testing "ntfs" 'bzcat "$BDIR"/ntfs.bz2 | blkid -' \
+ '-: UUID="8585600838bfe16e" TYPE="ntfs"\n' "" ""
+testing "reiserfs" 'bzcat "$BDIR"/reiser3.bz2 | blkid -' \
+ '-: LABEL="myreiser" UUID="a5b99bec-45cc-41d7-986e-32f4b6fc28f2" TYPE="reiserfs"\n' \
"" ""
-testing "xfs" "BLKID xfs" \
- 'temp.img: LABEL="XFS_test" UUID="d63a1dc3-27d5-4dd4-8b38-f4f97f495c6f" TYPE="xfs"\n' \
- "" ""
-
-# Unlike util-linux's blkid, toybox blkid can read from stdin.
-toyonly testing "stdin" "bzcat $FILES/blkid/squashfs.bz2 | blkid -" \
+testing "squashfs" 'bzcat "$BDIR"/squashfs.bz2 | blkid -' \
'-: TYPE="squashfs"\n' "" ""
+testing "vfat" 'bzcat "$BDIR"/vfat.bz2 | blkid -' \
+ '-: LABEL="myvfat" UUID="1db9-5673" TYPE="vfat"\n' "" ""
+testing "xfs" 'bzcat "$BDIR"/xfs.bz2 | blkid -' \
+ '-: LABEL="XFS_test" UUID="d63a1dc3-27d5-4dd4-8b38-f4f97f495c6f" TYPE="xfs"\n' \
+ "" ""
#testing "minix" 'bzcat "$BDIR"/minix.bz2 | blkid -'
#adfs bfs btrfs cramfs jfs nilfs romfs
diff --git a/tests/chgrp.test b/tests/chgrp.test
index a137baed..65820361 100755
--- a/tests/chgrp.test
+++ b/tests/chgrp.test
@@ -10,9 +10,8 @@ then
fi
# We chgrp between "root" and the last group in /etc/group.
+
GRP="$(sed -n '$s/:.*//p' /etc/group)"
-# Or if that fails, assume we're on Android and pick a well-known group.
-: "${GRP:=shell}"
# Set up a little testing hierarchy
diff --git a/tests/chown.test b/tests/chown.test
index f79d5c1a..56eed81e 100755
--- a/tests/chown.test
+++ b/tests/chown.test
@@ -11,11 +11,9 @@ fi
# We chown between user "root" and the last user in /etc/passwd,
# and group "root" and the last group in /etc/group.
+
USR="$(sed -n '$s/:.*//p' /etc/passwd)"
GRP="$(sed -n '$s/:.*//p' /etc/group)"
-# Or if that fails, we assume we're on Android...
-: "${USR:=shell}"
-: "${GRP:=daemon}"
# Set up a little testing hierarchy
@@ -26,7 +24,7 @@ F=testdir/file
# Wrapper to reset groups and return results
-OUT="&& stat --format '%U %G' $F"
+OUT="&& echo \$(ls -l testdir/file | awk '{print \$3,\$4}')"
#testing "name" "command" "result" "infile" "stdin"
diff --git a/tests/cmp.test b/tests/cmp.test
index 0c4355ab..62d4b89d 100755
--- a/tests/cmp.test
+++ b/tests/cmp.test
@@ -3,11 +3,7 @@
[ -f testing.sh ] && . testing.sh
# TODO: coreutils cmp uses stdin if only one file is given
-testing "one argument match" 'cmp input && echo yes' "yes\n" \
- "one\ntwo\nthree" "one\ntwo\nthree"
-# posix says ""%s %s differ: char %d, line %d\n" but diffutils says "byte"
-testing "one argument diff" 'cmp input | sed s/byte/char/' \
- "input - differ: char 5, line 2\n" "one\ntwo\nthree" "one\nboing\nthree"
+SKIP_HOST=1 testing "not enough arguments [fail]" 'cmp input 2>/dev/null || echo $?' "2\n" "foo" ""
testing "missing file1 [fail]" 'cmp file1 input 2>/dev/null || echo $?' "2\n" "foo" ""
@@ -25,8 +21,7 @@ testing "identical files, return code" "cmp input input2 && echo yes" "yes\n" "a
testing "EOF, stderr" "cmp input input2 2>&1" "cmp: EOF on input2\n" "ab\nc\nx" ""
testing "EOF, return code" "cmp input input2 2>/dev/null || echo yes" "yes\n" "ab\nc\nx" ""
# The gnu/dammit version fails this because posix says "char" and they don't.
-testing "diff, stdout" "cmp input input2 | sed s/byte/char/" \
- "input input2 differ: char 4, line 2\n" "ab\nx\nx" ""
+testing "diff, stdout" "cmp input input2" "input input2 differ: char 4, line 2\n" "ab\nx\nx" ""
testing "diff, return code" "cmp input input2 > /dev/null || echo yes" "yes\n" "ab\nx\nx" ""
testing "-s EOF, return code" "cmp -s input input2 2>&1 || echo yes" "yes\n" "ab\nc\nx" ""
@@ -39,7 +34,6 @@ testing "-s not exist" "cmp -s input doesnotexist 2>&1 || echo yes" "yes\n" "" "
rm input2
-testing "stdin and file" "cmp input - | sed s/byte/char/" \
- "input - differ: char 4, line 2\n" "ab\nc\n" "ab\nx\n"
+testing "stdin and file" "cmp input -" "input - differ: char 4, line 2\n" "ab\nc\n" "ab\nx\n"
#testing "stdin and stdin" "cmp input -" "" "" "ab\nc\n"
diff --git a/tests/cp.test b/tests/cp.test
index b665e47e..a720d1f5 100755
--- a/tests/cp.test
+++ b/tests/cp.test
@@ -2,9 +2,6 @@
[ -f testing.sh ] && . testing.sh
-OLDUMASK=$(umask)
-umask 0002
-
# Create test file
dd if=/dev/urandom of=random bs=64 count=1 2> /dev/null
@@ -38,20 +35,17 @@ rm -rf two three walrus
touch two
chmod 000 two
-skipnot [ $(id -u) -ne 0 ] # Root doesn't count.
-testing "file->inaccessible [fail]" \
+testing "file->inaccessable [fail]" \
"cp random two 2>/dev/null || echo yes" "yes\n" "" ""
rm -f two
touch two
chmod 000 two
-skipnot [ $(id -u) -ne 0 ] # Root doesn't count.
-testing "-f file->inaccessible" \
+testing "-f file->inaccessable" \
"cp -f random two && cmp random two && echo yes" "yes\n" "" ""
mkdir sub
chmod 000 sub
-skipnot [ $(id -u) -ne 0 ] # Root doesn't count.
-testing "file->inaccessible_dir [fail]" \
+testing "file->inaccessable_dir [fail]" \
"cp random sub 2>/dev/null || echo yes" "yes\n" "" ""
rm two
rmdir sub
@@ -95,32 +89,20 @@ testing "-r dir1/* dir2" \
"cp -r one/* dir2 && diff -r one dir2 && echo yes" "yes\n" "" ""
rm -rf one dir dir2
-mkdir one; touch one/two; cp one/two one/three
-cp -pr one/ one_ # Succeeds twice in a row
-testing "-pr dir/." "cp -pr one/. one_ && echo yes" "yes\n" "" ""
-rm -rf one one_
-mkdir one; touch one/two; ln -s two one/three
-cp -pr one/ one_ # First time ok, second mustn't fail with "File exists"
-testing "-pr dir/. symlink child" "cp -pr one/. one_ && echo yes" "yes\n" "" ""
-rm -rf one one_
-
touch walrus
chmod 644 walrus
ln -s walrus woot
+
testing "symlink dest permissions" "cp woot carpenter && stat -c %A carpenter" \
"-rw-r--r--\n" "" ""
-testing "duplicated --preserve options" \
- "cp --preserve=mode,mode walrus walrus2 2>&1 || echo bad" "" "" ""
-rm -rf walrus woot carpenter
# cp -r ../source destdir
# cp -r one/two/three missing
# cp -r one/two/three two
+# mkdir one; touch one/two; ln -s two one/three
# cp file1 file2 dir
# cp file1 missing file2 -> dir
# Make sure it's truncating existing file
# copy with -d at top level, with -d in directory, without -d at top level,
# without -d in directory
-
-umask $OLDUMASK
diff --git a/tests/cut.test b/tests/cut.test
index e475288a..e5a23fc1 100755
--- a/tests/cut.test
+++ b/tests/cut.test
@@ -31,11 +31,11 @@ testing "-c -b" "cut -c -39 abc.txt" \
"" ""
testing "-c a" "cut -c 40 abc.txt" "\n:\n \n" "" ""
testing "-c a,b-c,d" "cut -c 3,5-7,10 abc.txt" "etwoh\npa:ba\nequi \n" "" ""
-toyonly testing "-c japan.txt" 'cut -c 3-6,9-12 "$FILES/utf8/japan.txt"' \
+SKIP_HOST=1 testing "-c japan.txt" 'cut -c 3-6,9-12 "$FILES/utf8/japan.txt"' \
"ガラスをられます\n" "" ""
# substitute for awk
-toyonly testcmd "-DF" "-DF 2,7,5" \
+SKIP_HOST=1 testcmd "-DF" "-DF 2,7,5" \
"said and your\nare\nis demand. supply\nforecast :\nyou you better,\n\nEm: Took hate\n" "" \
"Bother, said Pooh. It's your husband, and he has a gun.
Cheerios are donut seeds.
diff --git a/tests/date.test b/tests/date.test
index 3be10425..5c490b02 100644
--- a/tests/date.test
+++ b/tests/date.test
@@ -13,17 +13,17 @@ testing "-d @0" "TZ=$tz date -d @0" "Thu Jan 1 01:00:00 CET 1970\n" "" ""
testing "-d @0x123 invalid" "TZ=$tz date -d @0x123 2>/dev/null || echo expected error" "expected error\n" "" ""
# POSIX format with 2- and 4-digit years.
-# All toyonly because coreutils rejects POSIX format dates supplied to -d.
+# All SKIP_HOST=1 because coreutils rejects POSIX format dates supplied to -d.
# These expected values are from running on the host without -d (not as root!).
-toyonly testing "-d MMDDhhmm" \
- "TZ=$tz date -d 06021234" "Sun Jun 2 12:34:00 CEST $(date +%Y)\n" "" ""
-toyonly testing "-d MMDDhhmmYY.SS" \
- "TZ=$tz date -d 1110143115.30" "Tue Nov 10 14:31:30 CET 2015\n" "" ""
+SKIP_HOST=1 testing "-d MMDDhhmm" \
+ "TZ=$tz date -d 06021234" "Sun Jun 2 12:34:00 CEST $(date +%Y)\n" "" ""
+SKIP_HOST=1 testing "-d MMDDhhmmYY.SS" \
+ "TZ=$tz date -d 1110143115.30" "Tue Nov 10 14:31:30 CET 2015\n" "" ""
# busybox thinks this is the year 603 (ISO time 0602-12-34 19:82 with out of range fields normalized).
-toyonly testing "-d MMDDhhmmCCYY" \
- "TZ=$tz date -d 060212341982" "Wed Jun 2 12:34:00 CEST 1982\n" "" ""
-toyonly testing "-d MMDDhhmmCCYY.SS" \
- "TZ=$tz date -d 111014312015.30" "Tue Nov 10 14:31:30 CET 2015\n" "" ""
+SKIP_HOST=1 testing "-d MMDDhhmmCCYY" \
+ "TZ=$tz date -d 060212341982" "Wed Jun 2 12:34:00 CEST 1982\n" "" ""
+SKIP_HOST=1 testing "-d MMDDhhmmCCYY.SS" \
+ "TZ=$tz date -d 111014312015.30" "Tue Nov 10 14:31:30 CET 2015\n" "" ""
# ISO date format.
testing "-d 1980-01-02" "TZ=$tz date -d 1980-01-02" "Wed Jan 2 00:00:00 CET 1980\n" "" ""
diff --git a/tests/dd.test b/tests/dd.test
index 7d7b794b..1ab06d45 100644
--- a/tests/dd.test
+++ b/tests/dd.test
@@ -13,7 +13,7 @@ opt="2>/dev/null"
# Test suffixed number parsing; `count` is representative.
testing "count=2" "dd if=input count=2 ibs=1 $opt" "hi" "high\n" ""
testing "count= 2" "dd if=input 'count= 2' ibs=1 $opt" "hi" "high\n" ""
-toyonly testing "count=0x2" "dd if=input 'count=0x2' ibs=1 $opt" "hi" \
+SKIP_HOST=1 testing "count=0x2" "dd if=input 'count=0x2' ibs=1 $opt" "hi" \
"high\n" ""
testing "count=-2" "dd if=input 'count=-2' ibs=1 2>/dev/null || echo errored" "errored\n" "" ""
@@ -92,18 +92,3 @@ testing "conv=sync with IF" "dd conv=sync if=input $opt | head -n 1" "I WANT\n"
# status=noxfer|none
testing "status=noxfer" "dd if=input status=noxfer ibs=1 2>&1" "input\n6+0 records in\n0+1 records out\n" "input\n" ""
testing "status=none" "dd if=input status=none ibs=1 2>&1" "input\n" "input\n" ""
-
-testing "seek stdout" "yes 2> /dev/null | dd bs=8 seek=2 count=1 > out 2> /dev/null && xxd -p out" \
- "00000000000000000000000000000000790a790a790a790a\n" "" ""
-
-# Duplicated options are fine.
-testing "conv=sync,sync" "dd conv=sync,sync $opt | head -n 1" "I WANT\n" "" "I WANT\n"
-
-# _bytes options
-testing "iflag=count_bytes" \
- "dd if=input count=2 ibs=4096 iflag=count_bytes $opt" "hi" "high" ""
-testing "iflag=skip_bytes" \
- "dd if=input skip=2 ibs=4096 iflag=skip_bytes $opt" "gh" "high" ""
-testing "oflag=seek_bytes" \
- "dd if=input of=output seek=2 obs=4096 oflag=seek_bytes status=none && \
- xxd -p output" "000030313233\n" "0123" ""
diff --git a/tests/demo_number.test b/tests/demo_number.test
index 7ce5d68f..0d86476f 100755
--- a/tests/demo_number.test
+++ b/tests/demo_number.test
@@ -25,5 +25,3 @@ testcmd "units" "-b 1c 1b 1k 1kd 1m 1md 1g 1gd 1t 1td 1e 1ed" \
testcmd "decimal units" "-d 1c 1b 1k 1kd 1m 1md 1g 1gd 1t 1td 1e 1ed" \
"1\n512\n1.0k\n1.0k\n1.0M\n1.0M\n1.0G\n1.0G\n1.1T\n1.0T\n1.1E\n1.0E\n" \
"" ""
-
-testcmd "longer output" "-D6 123 1234567 1234567890" "123\n1206K\n1177M\n" "" ""
diff --git a/tests/diff.test b/tests/diff.test
index f78eaa66..98477587 100644
--- a/tests/diff.test
+++ b/tests/diff.test
@@ -33,8 +33,3 @@ echo foo > tree1/file
echo food > tree2/file
testing "-r" "diff -r -L tree1/file -L tree2/file tree1 tree2 |tee out" "$expected" "" ""
-
-echo -e "hello\r\nworld\r\n"> a
-echo -e "hello\nworld\n"> b
-testing "--strip-trailing-cr off" "diff -q a b" "Files a and b differ\n" "" ""
-testing "--strip-trailing-cr on" "diff -u --strip-trailing-cr a b" "" "" ""
diff --git a/tests/du.test b/tests/du.test
index ae610256..a0960743 100755
--- a/tests/du.test
+++ b/tests/du.test
@@ -2,15 +2,6 @@
[ -f testing.sh ] && . testing.sh
-# ext stores extended attributes in a way that makes all the numbers in the
-# tests below incorrect.
-# TODO: include a read-only ext file system that we can mount for the tests?
-if [ "$(stat --format %C . 2>/dev/null)" != "?" ]; then
- echo "$SHOWSKIP: du (SELinux extended attributes present)"
- return 2>/dev/null
- exit
-fi
-
#testing "name" "command" "result" "infile" "stdin"
# we only test with -k since getting POSIX version is variable
diff --git a/tests/echo.test b/tests/echo.test
index 80774e66..e2035561 100755
--- a/tests/echo.test
+++ b/tests/echo.test
@@ -27,21 +27,10 @@ testcmd "-nex hello" "-nex hello" "-nex hello\n" "" ""
testcmd "-e octal values" \
"-ne '\01234 \0060 \060 \0130\0131\0132 \077\012'" \
"S4 0 0 XYZ ?\n" "" ""
-testcmd "-e invalid oct" "-ne 'one\\079two'" "one\a9two" "" ""
-testcmd "-e \\0040" "-ne '\0040'" " " "" ""
# Hexadecimal value tests
testcmd "-e hexadecimal values" \
"-ne '\x534 \x30 \x58\x59\x5a \x3F\x0A'"\
"S4 0 XYZ ?\n" "" ""
-testcmd "-e invalid hex 1" "-e 'one\xvdtwo'" "one\\xvdtwo\n" "" ""
-testcmd "-e invalid hex 2" "-e 'one\xavtwo'" "one\nvtwo\n" "" ""
-
-# GNU extension for ESC
-testcmd "-e \e" "-ne '\\e' | xxd -p" "1b\n" "" ""
testcmd "-e \p" "-e '\\p'" "\\p\n" "" ""
-
-# http://austingroupbugs.net/view.php?id=1222 added -E
-testcmd "-En" "-En 'one\ntwo'" 'one\\ntwo' "" ""
-testcmd "-eE" "-eE '\e'" '\\e\n' "" ""
diff --git a/tests/env.test b/tests/env.test
index 00b56540..286fb36c 100755
--- a/tests/env.test
+++ b/tests/env.test
@@ -18,13 +18,3 @@ testcmd "-0" "-i five=six seven=eight env -0 | sort -z" "five=six\0seven=eight\0
unset WALRUS BANANA LETTERS FILTER
testcmd "early fail" '--oops 2> /dev/null ; echo $?' "125\n" "" ""
-testcmd "why is this allowed" "=BLAH env | grep '^=BLAH\$'" "=BLAH\n" "" ""
-
-testcmd "replace" "A=foo PATH= `which printenv` A" "foo\n" "" ""
-
-# env bypasses shell builtins
-echo "#!$(which sh)
-echo \$@" > true
-chmod a+x true
-testcmd "norecurse" 'env PATH="$PWD:$PATH" true hello' "hello\n" "" ""
-rm true
diff --git a/tests/file.test b/tests/file.test
index 57204e64..2d8f04b6 100755
--- a/tests/file.test
+++ b/tests/file.test
@@ -9,52 +9,25 @@ echo "#!/bin/bash" > bash.script
echo "#! /bin/bash" > bash.script2
echo "#! /usr/bin/env python" > env.python.script
echo "Hello, world!" > ascii
+echo "cafebabe000000310000" | xxd -r -p > java.class
echo "6465780a3033350038ca8f6ce910f94e" | xxd -r -p > android.dex
-ln -s $FILES/java.class symlink
-LINK=$(readlink symlink)
-ln -s $FILES/java.klass dangler
-BROKEN=$(readlink dangler)
+ln -s java.class symlink
-testing "directory" "file ." ".: directory\n" "" ""
testing "empty" "file empty" "empty: empty\n" "" ""
testing "bash.script" "file bash.script" "bash.script: /bin/bash script\n" "" ""
testing "bash.script with spaces" "file bash.script2" "bash.script2: /bin/bash script\n" "" ""
testing "env python script" "file env.python.script" "env.python.script: python script\n" "" ""
testing "ascii" "file ascii" "ascii: ASCII text\n" "" ""
-testing "utf-8" "file $FILES/utf8/japan.txt | sed 's|$FILES/||'" \
- "utf8/japan.txt: UTF-8 text\n" "" ""
-testing "java class" "file $FILES/java.class | sed 's|$FILES/||'" \
- "java.class: Java class file, version 53.0 (Java 1.9)\n" "" ""
-testing "tar file" "file $FILES/tar/tar.tar | sed 's|$FILES/||'" \
- "tar/tar.tar: POSIX tar archive (GNU)\n" "" ""
-testing "gzip data" "file $FILES/tar/tar.tgz | sed 's|$FILES/||'" \
- "tar/tar.tgz: gzip compressed data\n" "" ""
-testing "bzip2 data" "file $FILES/tar/tar.tbz2 | sed 's|$FILES/||'" \
- "tar/tar.tbz2: bzip2 compressed data, block size = 900k\n" "" ""
-testing "zip file" "file $FILES/zip/example.zip | sed 's|$FILES/||'" \
- "zip/example.zip: Zip archive data, requires at least v1.0 to extract\n" "" ""
-
-# TODO: check in a genuine minimal .dex
+testing "java class" "file java.class" "java.class: Java class file, version 49.0 (Java 1.5)\n" "" ""
testing "Android .dex" "file android.dex" "android.dex: Android dex file, version 035\n" "" ""
+testing "symlink" "file symlink" "symlink: symbolic link\n" "" ""
+testing "symlink -h" "file -h symlink" "symlink: symbolic link\n" "" ""
+testing "symlink -L" "file -L symlink" "symlink: Java class file, version 49.0 (Java 1.5)\n" "" ""
-# These actually test a lot of the ELF code: 32-/64-bit, arm/arm64, PT_INTERP,
-# the two kinds of NDK ELF note, BuildID, and stripped/not stripped.
-toyonly testing "Android NDK full ELF note" \
- "file $FILES/elf/ndk-elf-note-full | sed 's/^.*: //'" \
- "ELF shared object, 64-bit LSB arm64, dynamic (/system/bin/linker64), for Android 24, built by NDK r19b (5304403), BuildID=0c712b8af424d57041b85326f0000fadad38ee0a, not stripped\n" "" ""
-toyonly testing "Android NDK short ELF note" \
- "file $FILES/elf/ndk-elf-note-short | sed 's/^.*: //'" \
- "ELF shared object, 32-bit LSB arm, dynamic (/system/bin/linker), for Android 28, BuildID=da6a5f4ca8da163b9339326e626d8a3c, stripped\n" "" ""
-
-testing "broken symlink" "file dangler" "dangler: broken symbolic link to $BROKEN\n" "" ""
-testing "symlink" "file symlink" "symlink: symbolic link to $LINK\n" "" ""
-testing "symlink -h" "file -h symlink" "symlink: symbolic link to $LINK\n" "" ""
-testing "symlink -L" "file -L symlink" "symlink: Java class file, version 53.0 (Java 1.9)\n" "" ""
-
-testing "- pipe" "cat $FILES/java.class | file -" "-: Java class file, version 53.0 (Java 1.9)\n" "" ""
-testing "- redirect" "file - <$FILES/java.class" "-: Java class file, version 53.0 (Java 1.9)\n" "" ""
+testing "- pipe" "cat java.class | file -" "-: Java class file, version 49.0 (Java 1.5)\n" "" ""
+testing "- redirect" "file - <java.class" "-: Java class file, version 49.0 (Java 1.5)\n" "" ""
-testing "/dev/zero" "file /dev/zero" "/dev/zero: character special (1/5)\n" "" ""
+testing "/dev/zero" "file /dev/zero" "/dev/zero: character special\n" "" ""
testing "- </dev/zero" "file - </dev/zero" "-: data\n" "" ""
-rm empty bash.script bash.script2 env.python.script ascii android.dex
+rm empty bash.script bash.script2 env.python.script ascii java.class android.dex
diff --git a/tests/files/bc/power.txt b/tests/files/bc/power.txt
index 5107be43..0a61671c 100644
--- a/tests/files/bc/power.txt
+++ b/tests/files/bc/power.txt
@@ -40,5 +40,6 @@
-0.23424398 ^ -81
-178.234786 ^ -79
-1274.346 ^ -8
+0 ^ -251
-0.2959371298 ^ 27
diff --git a/tests/files/bc/power_results.txt b/tests/files/bc/power_results.txt
index 1bca1b97..6c4f4ec6 100644
--- a/tests/files/bc/power_results.txt
+++ b/tests/files/bc/power_results.txt
@@ -48,4 +48,5 @@
379359
0
0
+0
-.00000000000000527697
diff --git a/tests/files/elf/ndk-elf-note-full b/tests/files/elf/ndk-elf-note-full
deleted file mode 100755
index da186122..00000000
--- a/tests/files/elf/ndk-elf-note-full
+++ /dev/null
Binary files differ
diff --git a/tests/files/elf/ndk-elf-note-short b/tests/files/elf/ndk-elf-note-short
deleted file mode 100755
index d2304250..00000000
--- a/tests/files/elf/ndk-elf-note-short
+++ /dev/null
Binary files differ
diff --git a/tests/files/java.class b/tests/files/java.class
deleted file mode 100644
index 5ddfa5ef..00000000
--- a/tests/files/java.class
+++ /dev/null
Binary files differ
diff --git a/tests/files/tar/tar.tar b/tests/files/tar/tar.tar
deleted file mode 100644
index ca7c53dd..00000000
--- a/tests/files/tar/tar.tar
+++ /dev/null
Binary files differ
diff --git a/tests/find.test b/tests/find.test
index afe7fd2e..6b0b0a8a 100755
--- a/tests/find.test
+++ b/tests/find.test
@@ -52,7 +52,6 @@ testing "-print -o -print" \
# Testing previous failures
-testing " " "cd perm; find" ".\n./all-read-only\n" "" ""
testing "-type f -user -exec" \
"find dir -type f -user $USER -exec ls {} \\;" "dir/file\n" "" ""
testing "-type l -newer -exec" \
@@ -74,17 +73,23 @@ testing "-perm (any success)" \
testing "-perm (any failure)" \
"find perm -type f -perm -0222" "" "" ""
+# Still fails
+
testing "unterminated -exec {}" \
"find dir -type f -exec ls {} 2>/dev/null || echo bad" "bad\n" "" ""
testing "-exec {} +" \
"find dir -type f -exec ls {} +" "dir/file\n" "" ""
# `find . -iname` was segfaulting
-testing "-name file" "find dir -name file" "dir/file\n" "" ""
-testing "-name FILE" "find dir -name FILE" "" "" ""
+testing "-name file" \
+ "find dir -name file" "dir/file\n" "" ""
+testing "-name FILE" \
+ "find dir -name FILE" "" "" ""
-testing "-iname file" "find dir -iname FILE" "dir/file\n" "" ""
-testing "-iname FILE" "find dir -iname FILE" "dir/file\n" "" ""
+testing "-iname file" \
+ "find dir -iname FILE" "dir/file\n" "" ""
+testing "-iname FILE" \
+ "find dir -iname FILE" "dir/file\n" "" ""
testing "-name (no arguments)" \
@@ -95,42 +100,13 @@ testing "-iname (no arguments)" \
testing "" "find dir \( -iname file -o -iname missing \) -exec echo {} \;" \
"dir/file\n" "" ""
-testing "-path glob" "find dir -path 'dir*e'" "dir/file\n" "" ""
-testing "-wholename glob" "find dir -wholename 'dir*e'" "dir/file\n" "" ""
-testing "-ipath glob" "find dir -ipath 'dIr*E'" "dir/file\n" "" ""
-testing "-iwholename glob" "find dir -iwholename 'dIr*E'" "dir/file\n" "" ""
-testing "-printf" "find dir -name file -printf '%f %p %P %s'" \
- "file dir/file file 0" "" ""
-testing "-printf .N" "find dir -name file -printf %.2f" "fi" "" ""
-# findutils find supports C letter escapes and \0 octal, but not \x or \u.
-testing "-printf escapes" \
- "find dir -name file -printf '\0 \007 \t \079' | xxd -p" \
- "0020072009200739\n" "" ""
-# findutils find treats \c as "no more output from this -printf", not "no more
-# output from find".
-testing "-printf \\c escape" "find dir -name f* -printf 'x\cy'" "xx" "" ""
-
-# No error message for a dangling link.
-ln -s does-not-exist dir/dangler
-testing "-L dangling symlink silent" \
- "LANG=C find -L dir -name file 2>&1" "dir/file\n" "" ""
-rm -f dir/dangler
-
-# An error for a symlink loop.
-ln -s looper dir/looper
-testing "-L symlink loop noisy" \
- "LANG=C find -L dir -name file 2>err ; grep -q dir/looper err || echo missing error" \
- "dir/file\n" "" ""
-rm -f dir/looper err
-
-testing "-false" "find dir -false" "" "" ""
-testing "-true" "find dir/file -true" "dir/file\n" "" ""
-
-testing "missing root error" \
- "LANG=C find -L dir/missing-root 2>err ; grep -q dir/missing-root err || echo missing error" \
- "" "" ""
-
-testing "-path match root" "find dir/f* -path dir/file" "dir/file\n" "" ""
-testing "-name match root" "find dir/f* -name file" "dir/file\n" "" ""
+testing "-path glob" \
+ "find dir -path 'dir*e'" "dir/file\n" "" ""
+testing "-wholename glob" \
+ "find dir -wholename 'dir*e'" "dir/file\n" "" ""
+testing "-ipath glob" \
+ "find dir -ipath 'dIr*E'" "dir/file\n" "" ""
+testing "-iwholename glob" \
+ "find dir -iwholename 'dIr*E'" "dir/file\n" "" ""
rm -rf dir
diff --git a/tests/grep.test b/tests/grep.test
index 69f8036e..798a9c6a 100755
--- a/tests/grep.test
+++ b/tests/grep.test
@@ -69,7 +69,7 @@ testing "-o overlap" "grep -bo aaa" "1:aaa\n" "" "baaaa\n"
testing "-co" "grep -co one input" "1\n" "one one one\n" ""
testing "-nom" "grep -nom 2 one" "1:one\n1:one\n1:one\n2:one\n2:one\n" \
"" "one one one\none one\none"
-toyonly testing "-vo" "grep -vo one input" "two\nthree\n" "onetwoonethreeone\n" ""
+testing "-vo" "grep -vo one input" "two\nthree\n" "onetwoonethreeone\n" ""
testing "no newline" "grep -h one input -" \
"hello one\nthere one\n" "hello one" "there one"
@@ -90,8 +90,6 @@ testing "-Fx ''" "grep -Fx '' input" "" "one one one\n" ""
testing "-F ''" "grep -F '' input" "one one one\n" "one one one\n" ""
testing "-F -e blah -e ''" "grep -F -e blah -e '' input" "one one one\n" \
"one one one\n" ""
-testing "-Fxv -e subset" "grep -Fxv -e bbswitch-dkms -e dkms" "" "" \
- "bbswitch-dkms\n"
testing "-e blah -e ''" "grep -e blah -e '' input" "one one one\n" \
"one one one\n" ""
testing "-w ''" "grep -w '' input" "" "one one one\n" ""
@@ -167,33 +165,3 @@ ln -s nope sub/link
testing "" 'grep -r walrus sub 2>/dev/null; echo $?' "1\n" "" ""
rm -rf sub
-# --exclude-dir
-mkdir sub
-mkdir sub/yes
-echo "hello world" > sub/yes/test
-mkdir sub/no
-echo "hello world" > sub/no/test
-testing "--exclude-dir" 'grep --exclude-dir=no -r world sub' "sub/yes/test:hello world\n" "" ""
-rm -rf sub
-
-# -r and -R differ in that -R will dereference symlinks to directories.
-mkdir dir
-echo "hello" > dir/f
-mkdir sub
-ln -s ../dir sub/link
-testing "" "grep -rh hello sub 2>/dev/null || echo err" "err\n" "" ""
-testing "" "grep -Rh hello sub" "hello\n" "" ""
-rm -rf sub real
-
-# -F multiple matches
-testing "-F multiple" "grep -F h input" "this is hello\nthis is world\n" \
- "missing\nthis is hello\nthis is world\nmissing" ""
-testing "-Fi multiple" "grep -Fi h input" "this is HELLO\nthis is WORLD\n" \
- "missing\nthis is HELLO\nthis is WORLD\nmissing" ""
-testing "-F empty multiple" "grep -Fi '' input" \
- "missing\nthis is HELLO\nthis is WORLD\nmissing\n" \
- "missing\nthis is HELLO\nthis is WORLD\nmissing" ""
-testing "-Fx" "grep -Fx h input" "h\n" \
- "missing\nH\nthis is hello\nthis is world\nh\nmissing" ""
-testing "-Fix" "grep -Fix h input" "H\nh\n" \
- "missing\nH\nthis is HELLO\nthis is WORLD\nh\nmissing" ""
diff --git a/tests/hostname.test b/tests/hostname.test
index d94f480a..ba65a398 100755
--- a/tests/hostname.test
+++ b/tests/hostname.test
@@ -4,9 +4,14 @@
#testing "name" "command" "result" "infile" "stdin"
-HOST="$(cat /proc/sys/kernel/hostname 2>/dev/null)"
-skipnot [ $? -eq 0 ]
+HOST="$(cat /proc/sys/kernel/hostname)"
testing "get" "hostname" "$HOST\n" "" ""
-skipnot [ $(id -u) -eq 0 ]
+if [ "$(id -u)" -ne 0 ]
+then
+ echo "$SHOWSKIP: groupdel (not root)"
+ return 2>/dev/null
+ exit
+fi
+
testing "set" 'hostname "2>&1 | tee"; hostname; hostname "$HOST"' "2>&1 | tee\n" "" ""
diff --git a/tests/ifconfig.test b/tests/ifconfig.test
index c189ccaf..34b84b73 100755
--- a/tests/ifconfig.test
+++ b/tests/ifconfig.test
@@ -35,8 +35,6 @@ modprobe dummy 2>/dev/null
if ! ifconfig dummy0 up 2>/dev/null
then
echo "$SHOWSKIP: ifconfig dummy0 up failed"
- return 2>/dev/null
- exit
fi
# Test Description: Disable the dummy0 interface
@@ -125,18 +123,16 @@ testing "dummy0 arp down" \
# Test Description: Call the pointopoint option with no argument
# Results Expected: After calling ifconfig dummy0, there is one line with the
# NOARP and UP flags
-# TODO: http://lists.landley.net/pipermail/toybox-landley.net/2014-November/003795.html
-#testing "dummy0 pointopoint" \
-#"ifconfig dummy0 pointopoint && ifconfig dummy0 | grep -i NOARP | grep -i UP | wc -l" \
-#"1\n" "" ""
+testing "dummy0 pointopoint" \
+"ifconfig dummy0 pointopoint && ifconfig dummy0 | grep -i NOARP | grep -i UP | wc -l" \
+"1\n" "" ""
# Test Description: Test the pointopoint option and set the ipaddress
# Results Expected: After calling ifconfig dummy0, there is one line with the
# word inet and the selected ip address
-# TODO: http://lists.landley.net/pipermail/toybox-landley.net/2014-November/003795.html
-#testing "dummy0 pointopoint 127.0.0.2" \
-#"ifconfig dummy0 pointopoint 127.0.0.2 && ifconfig dummy0 | grep -i inet | grep -i 127\.0\.0\.2 | wc -l" \
-#"1\n" "" ""
+testing "dummy0 pointopoint 127.0.0.2" \
+"ifconfig dummy0 pointopoint 127.0.0.2 && ifconfig dummy0 | grep -i inet | grep -i 127\.0\.0\.2 | wc -l" \
+"1\n" "" ""
####### Flags you can set on an interface (or -remove by prefixing with -): ###############
diff --git a/tests/kill.test b/tests/kill.test
deleted file mode 100644
index ce423412..00000000
--- a/tests/kill.test
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-[ -f testing.sh ] && . testing.sh
-
-#testing "name" "command" "result" "infile" "stdin"
-
-testcmd "-l HUP" "-l HUP" "1\n" "" ""
-testcmd "-l 1" "-l 1" "HUP\n" "" ""
diff --git a/tests/killall.test b/tests/killall.test
index 7b2cee33..100ac7ca 100644
--- a/tests/killall.test
+++ b/tests/killall.test
@@ -4,18 +4,11 @@
#testing "name" "command" "result" "infile" "stdin"
-echo -e "#!$(which sh)\nwhile true; do sleep 0.1; done" > toybox.test
-chmod a+x toybox.test
-cp toybox.test toybox.killall.test.script
+echo "#!/bin/sh
+yes > /dev/null" > toybox.killall.test.script
+chmod a+x toybox.killall.test.script
-tst=toybox.test
-(./$tst 2>/dev/null &)
-testing "short name" "killall -w $tst && echo killed ; sleep 0.1; \
- pgrep -l $tst || echo really" "killed\nreally\n" "" ""
+./toybox.killall.test.script &
+testing "script" "killall toybox.killall.test.script && echo killed ; pgrep -l toybox.killall.test.script || echo really" "killed\nreally\n" "" ""
-tst=toybox.killall.test.script
-(./$tst 2>/dev/null &)
-testing "long name" "killall -w $tst && echo killed ; sleep 0.1; \
- pgrep -l $tst || echo really" "killed\nreally\n" "" ""
-
-rm -f toybox.killall.test.script toybox.test
+rm -f toybox.killall.test.script
diff --git a/tests/link.test b/tests/link.test
index 31de4a5d..d91b7946 100755
--- a/tests/link.test
+++ b/tests/link.test
@@ -8,7 +8,7 @@
#testing "name" "command" "result" "infile" "stdin"
echo "" >foo
-testing "fails on non-existent file" "link foo/foo baz 2>/dev/null || echo GOOD" "GOOD\n" "" ""
+testing "fails on non-existent file" "link foo/foo baz || echo GOOD" "GOOD\n" "" ""
rm -f foo bar
echo file1 > file
diff --git a/tests/ln.test b/tests/ln.test
index c326c2e1..3e70cd83 100755
--- a/tests/ln.test
+++ b/tests/ln.test
@@ -20,7 +20,7 @@ testing "force_create_hardlink" "ln -f file hlink &&
[ file -ef hlink ] && cat hlink 2>/dev/null" "file1\n" "" ""
echo slink1 > slink
-testing "force_create_symlink" "ln -f -s file slink &&
+testing "force_create_softlink" "ln -f -s file slink &&
[ -L slink ] && readlink slink" "file\n" "" ""
rm slink hlink
@@ -31,7 +31,7 @@ testing "preserves_hardlinks" "ln file hlink 2>/dev/null || echo 'yes'" \
echo slink1 > slink
set +e
-testing "preserves_symlinks" "ln -s file slink 2>/dev/null || echo 'yes'" \
+testing "preserves_softlinks" "ln -s file slink 2>/dev/null || echo 'yes'" \
"yes\n" "" ""
rm slink hlink
@@ -44,18 +44,8 @@ rm slink
testing "no_dereference" "ln -s dir slink &&
ln -n -s file slink 2>/dev/null || [ -L slink ] && readlink slink" \
"dir\n" "" ""
-rm slink
-
-testing "-T acts like -n" "ln -s dir slink &&
- ln -Tsf file slink || [ -L slink ] && readlink slink" "file\n" "" ""
-rm slink
-
-testing "-T with dir" "ln -Ts file dir 2>/dev/null || echo yes" "yes\n" "" ""
rm -rf file dir slink
-testing "-t" "ln -st . one/two three && readlink two three" "one/two\nthree\n" \
- "" ""
-
touch file1 file2 && mkdir dir
testing "create_multiple_hardlinks" "ln file* dir/ &&
[ file1 -ef dir/file1 -a file2 -ef dir/file2 ] && echo 'yes'" "yes\n" "" ""
diff --git a/tests/losetup.test b/tests/losetup.test
index 2f72b920..f30a0fe2 100755
--- a/tests/losetup.test
+++ b/tests/losetup.test
@@ -2,41 +2,24 @@
[ -f testing.sh ] && . testing.sh
-if [ "$(id -u)" -ne 0 ]; then
+if [ "$(id -u)" -ne 0 ]
+then
echo "$SHOWSKIP: losetup (not root)"
return 2>/dev/null
exit
fi
-if [ "$(losetup -a | wc -l)" -ne 0 ]; then
- echo "$SHOWSKIP: losetup (devices already in use)"
- return 2>/dev/null
- exit
-fi
-
-# Android's loopback devices are only in /dev/block/loop*.
-# Debian has symlinks like /dev/block/7:0 back to ../loop*.
-if [ -b /dev/block/sda ]; then
- DIR="/dev/block" # Presumably Android.
-else
- DIR="/dev"
-fi
-
#testing "name" "command" "result" "infile" "stdin"
truncate -s 1M blah.img &&
FILE="$(readlink -f blah.img)"
-DEV="$(stat --format %d blah.img)"
-NODE="$(stat --format %i blah.img)"
+DEV="$(printf '%04s' $(stat -t blah.img | awk '{print $7}'))"
+NODE="$(stat -t blah.img | awk '{print $8}')"
+
+losetup -f
+losetup -f -s
+losetup -f file
-# TODO: assumes there are no loopback devices!
-testcmd "-f" "-f" "$DIR/loop0\n" "" ""
-testcmd "-f blah.img" "-f blah.img" "" "" ""
-testcmd "-f --show" "-f --show blah.img" "$DIR/loop1\n" "" ""
-testcmd "-a" "-a | sort" \
- "$DIR/loop0: [$DEV]:$NODE ($FILE)\n$DIR/loop1: [$DEV]:$NODE ($FILE)\n" "" ""
-testcmd "-d $DIR/loop0" "-d $DIR/loop0 && losetup -a" \
- "$DIR/loop1: [$DEV]:$NODE ($FILE)\n" "" ""
-testcmd "-D" "-D && losetup -a" "" "" ""
+losetup -d
rm blah.img
diff --git a/tests/ls.test b/tests/ls.test
index 91f69183..56f74034 100755
--- a/tests/ls.test
+++ b/tests/ls.test
@@ -31,8 +31,6 @@ testing "with -k" "$IN && ls -k; $OUT" "dir1\ndir2\nfile1.txt\nfile2.txt\n" "" "
testing "with -m" "$IN && ls -m; $OUT" "dir1, dir2, file1.txt, file2.txt\n" "" ""
testing "with -F" "$IN && ls -F; $OUT" "dir1/\ndir2/\nfile1.txt\nfile2.txt\n" "" ""
testing "with -dk *" "$IN && ls -dk *; $OUT" "dir1\ndir2\nfile1.txt\nfile2.txt\n" "" ""
-testing "with -Z" "$IN && ls -Z file1.txt | egrep -q '^[^ ]+ file1.txt' || echo fail; $OUT" "" "" ""
-testing "with -lZ" "$IN && ls --full-time -lZ file1.txt | egrep -q '^-[rwx-]+ +[0-9]+ +[^ ]+ +[^ ]+ +[^ ]+ +[0-9]+ [0-9][0-9][0-9][0-9]-[0-9][0-9]-.* file1.txt' || echo fail; $OUT" "" "" ""
ln -s file1.txt lstest/slink
testing "-l symlink" \
@@ -52,8 +50,5 @@ rm -rf lstest/* && touch lstest/file1.txt && INODE=`stat -c %i lstest/file1.txt`
testing "with -i" "$IN && ls -i 2>/dev/null; $OUT" "$INODE file1.txt\n" "" ""
unset INODE
-testing "missing" "$IN && ls does-not-exist 2>err ; grep -q 'ls:.*missing.*: No
-such file' err || echo missing error; $OUT" "" "" ""
-
# Removing test dir for cleanup purpose
rm -rf lstest
diff --git a/tests/lsattr.test b/tests/lsattr.test
index c2c7c617..c2c7c617 100644..100755
--- a/tests/lsattr.test
+++ b/tests/lsattr.test
diff --git a/tests/man.test b/tests/man.test
deleted file mode 100644
index 0f3ad1db..00000000
--- a/tests/man.test
+++ /dev/null
@@ -1,222 +0,0 @@
-#!/bin/bash
-# Copyright 2019 makepost <makepost@firemail.cc>
-
-[ -f testing.sh ] && . testing.sh
-
-#testing "name" "command" "result" "infile" "stdin"
-
-mkdir -p banana/man{1,3,5}
-
-# Can't/shouldn't write to /usr/share/man so use -M to change path
-MAN="man -M banana"
-echo one | bzip2 >banana/man1/numbers.1.bz2
-echo three | gzip >banana/man3/numbers.3.gz
-echo five > banana/man5/numbers.5
-
-testing "man" "$MAN numbers" " one\n\n" "" ""
-testing "man.section" "$MAN numbers.3" " three\n\n" "" ""
-testing "section man" "$MAN 5 numbers" " five\n\n" "" ""
-testing "/" "$MAN /" "" "" "" # Regression guard for !suf in zopen
-
-cat >banana/man1/toybox.1 <<EOF
-.TP
-.PD 0
-.B \\-F
-.TP
-.PD
-.B \\-\\^\\-foo\\-bar
-Does something.
-.TP
-.PD 0
-.B \\-\\-no\\-alias
-Has no alias.
-EOF
-
-testing "gawk alias" "$MAN toybox" " -F\n --foo-bar Does something.\n\n --no-alias Has no alias.\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-\\fBsh\\fR-compatible
-\\fIKorn\\fP
-EOF
-testing "bash bold,ita" "$MAN toybox" " sh-compatible Korn\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-quoted \\(aqstring\\(aq
-\\(dqserver\\(dq
-Don\\(cq\\&t
-EOF
-testing "bash,rsync quote" "$MAN toybox" " quoted 'string' \"server\" Don't\n\n" "" ""
-
-echo "\\*(lq\\-\\^\\-\\*(rq" >banana/man1/toybox.1
-testing "gawk quote" "$MAN toybox" " \"--\"\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-.IP \\(bu
-[\\fB|\\fP\\(bv\\fB|&\\fP]
-EOF
-testing "bash symbol" "$MAN toybox" " * [|||&]\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-\\&\\fBfflush(...)\\fR
-\\f(CW$ ssh ...\\fP
-EOF
-testing "gawk,rsync fancy" "$MAN toybox" " fflush(...) $ ssh ...\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-"\\eC\\-x\\eC\\-r": re\\-read
-must be \\(>= 1
-EOF
-testing "bash escape" "$MAN toybox" " \"\C-x\C-r\": re-read must be >= 1\n\n" "" ""
-
-echo "\\*(AK language. The \\*(PX standard" >banana/man1/toybox.1
-testing "gawk var" "$MAN toybox" " #AK language. The #PX standard\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-If set to
-.BR On ,
-(...)
-EOF
-testing "bash boldpunct" "$MAN toybox" " If set to On, (...)\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-.IP \\fB\$endif\\fP
-(...)
-.IP \\fB\$else\\fP
-(...)
-.IP \\fB\$include\\fP
-EOF
-testing "bash list" "$MAN toybox" " \$endif (...)\n\n \$else (...)\n\n \$include\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-asynchronously (in the
-.IR background ),
-it prints
-EOF
-testing "bash itapunct" "$MAN toybox" " asynchronously (in the background), it prints\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-(...)
-.B Bash
-is
-EOF
-testing "bash bold" "$MAN toybox" " (...) Bash is\n\n" "" ""
-
-# TODO: Unquote.
-cat >banana/man1/toybox.1 <<EOF
-.PD 0
-.BI \\-f " program-file"
-.TP
-EOF
-testing "gawk boldita" "$MAN toybox" " -f \" program-file\"\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-same format as
-.FN /etc/hosts
-(...)
-EOF
-testing "bash filename" "$MAN toybox" " same format as /etc/hosts (...)\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-The
-.I Internal Field Separator
-that is used
-EOF
-testing "bash ita" "$MAN toybox" " The Internal Field Separator that is used\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-.if n Copyright (C) 2019
-.if t Copyright \\(co 2019
-EOF
-testing "bash nroff" "$MAN toybox" " Copyright (C) 2019\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-.EX
-#include <stdio.h>
-#include <stdlib.h>
-.EE
-EOF
-testing "stat example" "$MAN toybox" "#include <stdio.h>\n#include <stdlib.h>\n\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-(...)
-.PP
-(...)
-EOF
-testing "bash paragraph" "$MAN toybox" " (...)\n\n (...)\n\n" "" ""
-
-# TODO: Find some command I saw that has a different see below.
-cat >banana/man1/toybox.1 <<EOF
-(see
-.SM
-.B INVOCATION
-below)
-EOF
-testing "bash small" "$MAN toybox" " (see INVOCATION below)\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-(...)
-.SH "SHELL GRAMMAR"
-.SS Simple Commands
-.PP
-(...)
-EOF
-testing "bash section" "$MAN toybox" " (...)\n\n\"SHELL GRAMMAR\"\n\nSimple Commands\n\n (...)\n\n" "" ""
-
-echo ".so man1/last.1" >banana/man1/toybox.1
-testing "lastb" "$MAN toybox" "See last.1\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-.TH TOYBOX 1 "Apr 13 2019" "Project Organization" "Document Name"
-.PP
-.TH "TOYBOX" "1" "04/13/2019" "Toybox 0\\&.8\\&.0" "Toybox Manual"
-EOF
-testing "gawk,git head" "$MAN toybox" "TOYBOX 1 Apr 13 2019 Project Organization Document Name \n\n TOYBOX 1 04/13/2019 Toybox 0.8.0 Toybox Manual \n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-(...)
-.PP
-.PD 0
-.TP 10
-.B \\-c
-If the
-.B \\-c
-option is present
-EOF
-testing "bash table" "$MAN toybox" " (...)\n\n -c If the -c option is present\n\n" "" ""
-
-cat >banana/man1/toybox.1 <<EOF
-.de FN
-.sp
-.RE
-'\" t
-EOF
-testing "bash,git garbage" "$MAN toybox" "" "" ""
-
-# "bash,git garbage" from above has no content, -k skips it.
-bzip2 >banana/man1/numbers.1.bz2 <<EOF
-.TH NUMBERS 1 "2019 Apr 28" "Toybox Manual"
-.SH NAME
-man \- test -k
-.SH ANOTHER SECTION
-.so noop.1
-Skip this text.
-EOF
-echo "No dash." | gzip >banana/man3/numbers.3.gz
-echo .so man1/numbers.1 >banana/man5/numbers.5
-testing "-k ." "$MAN -k ." "numbers.1.bz2 - test -k\nnumbers.3.gz - No dash.\nnumbers.5 - See numbers.1\n" "" ""
-testing "-k -k" "$MAN -k -k" "numbers.1.bz2 - test -k\n" "" ""
-testing "-k d.*h" "$MAN -k 'd.*h'" "numbers.3.gz - No dash.\n" "" ""
-testing "-k ers.1" "$MAN -k ers.1" "numbers.1.bz2 - test -k\nnumbers.5 - See numbers.1\n" "" ""
-
-mkdir -p walrus/man1
-echo Local development override. | bzip2 >walrus/man1/numbers.1.bz2
-testing "-M /dir:/dir0" "man -M walrus:banana numbers" " Local development override.\n\n" "" ""
-testing "-M /dir:/dir0 -k ." "man -M walrus:banana -k ." "numbers.1.bz2 - Local development override.\nnumbers.1.bz2 - test -k\nnumbers.3.gz - No dash.\nnumbers.5 - See numbers.1\n" "" ""
-testing "-M '' x" "man -M '' numbers 2>&1" "man: no numbers\n" "" ""
-testing "-M '' 1 x" "man -M '' 1 numbers 2>&1" "man: section 1 no numbers\n" "" ""
-testing "-M '' -k ." "man -M '' -k ." "" "" ""
-
-# TODO: emerge section header newline
-# TODO: fdm,man-pages man1p/, .nf, rare tags
-
-rm -rf banana walrus
diff --git a/tests/mktemp.test b/tests/mktemp.test
index adf8666e..0c235469 100755
--- a/tests/mktemp.test
+++ b/tests/mktemp.test
@@ -4,29 +4,42 @@
#testing "name" "command" "result" "infile" "stdin"
-testing "default template uses \$TMPDIR" "TMPDIR=. mktemp | grep -q '^./tmp\...........$' && echo yes" "yes\n" "" ""
-testing "default creates file" "test -f `TMPDIR=. mktemp` && echo yes" "yes\n" \
- "" ""
-testing "-d creates dir" "test -d `TMPDIR=. mktemp -d` && echo yes" "yes\n" \
- "" ""
-testing "TEMPLATE does not use \$TMPDIR" "TMPDIR=/t mktemp -u hello.XXXXXXXX | grep -q '^hello\.........$' && echo yes" "yes\n" "" ""
-testing "/ in TEMPLATE works but ignores \$TMPDIR" "TMPDIR=/t mktemp -u /x/hello.XXXXXXXX | grep -q '^/x/hello\.........$' && echo yes" "yes\n" "" ""
-testing "/ in TEMPLATE with -p DIR is error" "TMPDIR=/t mktemp -p DIR -u /x/hello.XXXXXXXX 2>/dev/null || echo error" "error\n" "" ""
-testing "-t TEMPLATE uses \$TMPDIR" "TMPDIR=/t mktemp -u -t hello.XXXXXXXX | grep -q '^/t/hello\.........$' && echo yes" "yes\n" "" ""
-testing "-t and TEMPLATE but no \$TMPDIR uses /tmp" "TMPDIR= mktemp -u -t hello.XXXXXXXX | grep -q '^/tmp/hello\.........$' && echo yes" "yes\n" "" ""
-testing "-p DIR and TEMPLATE should use DIR" "TMPDIR=/t mktemp -u -p DIR hello.XXXXXXXX | grep -q '^DIR/hello\.........$' && echo yes" "yes\n" "" ""
-testing "-p DIR and -t: -t wins" "TMPDIR=/t mktemp -u -p DIR -t hello.XXXXXXXX | grep -q '^/t/hello\.........$' && echo yes" "yes\n" "" ""
-testing "-p DIR -t TEMPLATE but no \$TMPDIR (DIR wins)" "TMPDIR= mktemp -u -p DIR -t hello.XXXXXXXX | grep -q '^DIR/hello\.........\$' && echo yes" "yes\n" "" ""
-testing "-u doesn't need to be able to write to dir" \
- "mktemp -u -p /proc | grep -q '^/proc/tmp\...........\$' && echo yes" "yes\n" \
- "" ""
-testing "needs at least XXX in template" \
- "mktemp -u helloX 2>/dev/null || echo error" "error\n" "" ""
-testing "-q shouldn't print path" \
- "mktemp -p /proc -q || echo only-failure" "only-failure\n" "" ""
-testing "--tmpdir doesn't need argument" \
- "TMPDIR= mktemp -u helloXXX --tmpdir | grep -q '^/tmp/hello...\$' && echo yes" \
- "yes\n" "" ""
-testing "--tmpdir can have argument" \
- "TMPDIR= mktemp -u helloXXX --tmpdir=abc | grep -q '^abc/hello...\$' && echo yes" \
- "yes\n" "" ""
+# mktemp by default should use tmp.XXXXXXXXXX as the template,
+# and $TMPDIR as the directory.
+testing "default" "TMPDIR=. mktemp | grep -q '^./tmp\...........$' && echo yes" "yes\n" "" ""
+
+# Test that -d creates a directory and the default is a file.
+testing "dir" "test -d `TMPDIR=. mktemp -d` && echo yes" "yes\n" "" ""
+testing "file" "test -f `TMPDIR=. mktemp` && echo yes" "yes\n" "" ""
+
+# mktemp with a template should *not* use $TMPDIR.
+testing "TEMPLATE" "TMPDIR=/t mktemp -u hello.XXXXXXXX | grep -q '^hello\.........$' && echo yes" "yes\n" "" ""
+
+# mktemp with a template that includes a '/' should ignore $TMPDIR
+testing "/ TEMPLATE" "TMPDIR=/t mktemp -u /x/hello.XXXXXXXX | grep -q '^/x/hello\.........$' && echo yes" "yes\n" "" ""
+# ...and setting DIR is an error.
+testing "/ TEMPLATE -p DIR" "TMPDIR=/t mktemp -p DIR -u /x/hello.XXXXXXXX || echo error" "error\n" "" ""
+
+# mktemp with -t and a template should use $TMPDIR.
+testing "-t TEMPLATE" "TMPDIR=/t mktemp -u -t hello.XXXXXXXX | grep -q '^/t/hello\.........$' && echo yes" "yes\n" "" ""
+
+# mktemp with -t and a template should use $TMPDIR ... or /tmp if no $TMPDIR.
+testing "-t TEMPLATE but no TMPDIR" "TMPDIR= mktemp -u -t hello.XXXXXXXX | grep -q '^/tmp/hello\.........$' && echo yes" "yes\n" "" ""
+
+# mktemp with -p DIR and a template should use DIR.
+testing "-p DIR TEMPLATE" "TMPDIR=/t mktemp -u -p DIR hello.XXXXXXXX | grep -q '^DIR/hello\.........$' && echo yes" "yes\n" "" ""
+
+# mktemp -p DIR and -t: -t wins.
+testing "-p DIR -t TEMPLATE" "TMPDIR=/t mktemp -u -p DIR -t hello.XXXXXXXX | grep -q '^/t/hello\.........$' && echo yes" "yes\n" "" ""
+
+# mktemp -p DIR and -t but no $TMPDIR: DIR wins.
+testing "-p DIR -t TEMPLATE but no TMPDIR" "TMPDIR= mktemp -u -p DIR -t hello.XXXXXXXX | grep -q '^DIR/hello\.........$' && echo yes" "yes\n" "" ""
+
+# mktemp -u doesn't need to be able to write to the directory.
+testing "-u" "mktemp -u -p /proc | grep -q '^/proc/tmp\...........$' && echo yes" "yes\n" "" ""
+
+# mktemp needs at least XX in the template.
+testing "bad template" "mktemp -u helloX || echo error" "error\n" "" ""
+
+# mktemp -q shouldn't print the path.
+testing "-q" "mktemp -p /proc -q || echo only-failure" "only-failure\n" "" ""
diff --git a/tests/modinfo.test b/tests/modinfo.test
index aaa7a7bd..0a8c2bec 100644
--- a/tests/modinfo.test
+++ b/tests/modinfo.test
@@ -4,27 +4,7 @@
#testing "name" "command" "result" "infile" "stdin"
-# Android keeps its modules (if any) on the vendor partition.
-MODULE_ROOT=""
-[ -d /vendor/lib/modules ] && MODULE_ROOT="/vendor"
-
-if [[ ! -e /proc/modules || ! -d $MODULE_ROOT/lib/modules ]]; then
- echo "$SHOWSKIP: modinfo (no modules)"
- return 2>/dev/null
- exit
-fi
-
-testcmd "missing" "missing 2>&1" "modinfo: missing: not found\n" "" ""
-
-# Find some modules to work with.
-MODULE_PATH1=$(find $MODULE_ROOT/lib/modules -name *.ko | head -1 2>/dev/null)
-MODULE1=$(basename -s .ko $MODULE_PATH1)
-MODULE_PATH2=$(find $MODULE_ROOT/lib/modules -name *.ko | tail -1 2>/dev/null)
-MODULE2=$(basename -s .ko $MODULE_PATH2)
-DASH_MODULE=$(basename -s .ko \
- $(find $MODULE_ROOT/lib/modules -name *-*.ko | tail -1 2>/dev/null))
-BAR_MODULE=$(basename -s .ko \
- $(find $MODULE_ROOT/lib/modules -name *_*.ko | tail -1 2>/dev/null))
+[ -e /proc/modules ] || { echo "Skipping test because modules are not supported"; exit 1; }
# modinfo does not need to output fields in a specified order.
# Instead, there are labelled fields. We can use sort to make up for this.
@@ -32,19 +12,19 @@ BAR_MODULE=$(basename -s .ko \
# which change from kernel to kernel and can be disabled.
# We grep to remove these.
-skipnot [ -n "$DASH_MODULE" ]
-testing "treats - and _ as equivalent" "modinfo $DASH_MODULE > dash-dash &&
- modinfo ${DASH_MODULE/-/_} > dash-bar && diff -u dash-dash dash-bar" "" "" ""
-skipnot [ -n "$BAR_MODULE" ]
-testing "treats _ and - as equivalent" "modinfo $BAR_MODULE > bar-bar &&
- modinfo ${BAR_MODULE/_/-} > bar-dash && diff -u bar-bar bar-dash" "" "" ""
+#We expect they have ne2k-pci as a module.
+
+testing "gets right number of fields" "modinfo ne2k-pci |cut -d: -f1 |grep -v ver|sort" "alias\nalias\nalias\nalias\nalias\nalias\nalias\nalias\nalias\nalias\nalias\nauthor\ndepends\ndescription\nfilename\nlicense\nparm\nparm\nparm\n" "" ""
+testing "treats - and _ as equivalent" "modinfo ne2k_pci |cut -d: -f1 |grep -v ver|sort" "alias\nalias\nalias\nalias\nalias\nalias\nalias\nalias\nalias\nalias\nalias\nauthor\ndepends\ndescription\nfilename\nlicense\nparm\nparm\nparm\n" "" ""
# Output of -F filename should be an absolute path to the module.
# Otherwise, initrd generating scripts will break.
-testing "-F filename gets absolute path" "modinfo -F filename $MODULE1" \
- "$MODULE_PATH1\n" "" ""
+testing "-F filename gets absolute path" "[ -e `modinfo -F filename ne2k-pci` ] && echo ne2k-pci " "ne2k-pci\n" "" ""
+
+testing "supports multiple modules" "modinfo -F filename ne2k-pci 8390 | wc -l" "2\n" "" ""
+
+testing "does not output filename for bad module" "modinfo -F filename zxcvbnm__9753" "" "" ""
+
+
-skipnot [ "$MODULE1" != "$MODULE2" ]
-testing "supports multiple modules" "modinfo -F filename $MODULE1 $MODULE2" \
- "$MODULE_PATH1\n$MODULE_PATH2\n" "" ""
diff --git a/tests/more.test b/tests/more.test
index ac701f77..4dcf6d85 100644
--- a/tests/more.test
+++ b/tests/more.test
@@ -9,9 +9,6 @@ line1
line2
EOF
-# For non-tty output, headers are shown even if there's only one file.
-testing "non-tty" "more file1 | cat -" "::::::::::::::\nfile1\n::::::::::::::\nline1\nline2\n" "" ""
-
-testing "directory" "more ." "\n*** .: directory ***\n\n" "" ""
+testing "non-tty" "more file1 | cat -" "line1\nline2\n" "" ""
rm file1
diff --git a/tests/mv.test b/tests/mv.test
index ed8922ac..f1f4a4f9 100755
--- a/tests/mv.test
+++ b/tests/mv.test
@@ -96,26 +96,6 @@ testing "dir to existing dir" \
"yes\n" "" ""
rm -rf dir*
-# Trailing slash was once throwing: bad 'dir1/dir2/': Resource busy
-mkdir -p dir1/dir2
-testing "dir1/dir2 to ." \
- "mv dir1/dir2 . && [ ! -e dir1/dir2 -a -d dir2 ] && echo yes" \
- "yes\n" "" ""
-rm -rf dir*
-mkdir -p dir1/dir2
-testing "dir1/dir2/ to ." \
- "mv dir1/dir2/ . && [ ! -e dir1/dir2 -a -d dir2 ] && echo yes" \
- "yes\n" "" ""
-rm -rf dir*
-mkdir -p dir1/dir2
-testing "dir1/dir2/ to ./" \
- "mv dir1/dir2/ ./ && [ ! -e dir1/dir2 -a -d dir2 ] && echo yes" \
- "yes\n" "" ""
-rm -rf dir*
-testing "not/exists/ to ./" \
- "mv not/exists/ ./ 2>&1 | grep -o not/exists/" \
- "not/exists/\n" "" ""
-
touch file1 file2
chmod 400 file1 file2
testing "force over unwritable" \
diff --git a/tests/nl.test b/tests/nl.test
index 046773f5..499734d3 100755
--- a/tests/nl.test
+++ b/tests/nl.test
@@ -39,13 +39,8 @@ testing "-sook -b p" "nl -sook -bpoing" \
" one\n 1ookboing\n 2ooksproingy\n" \
"" "one\nboing\nsproingy\n"
-testing "-v42" "nl -v 42" " 42\tone\n 43\ttwo\n 44\tthree\n" \
+testing "-v" "nl -v 42" " 42\tone\n 43\ttwo\n 44\tthree\n" \
"" "one\ntwo\nthree\n"
-testing "-v-1" "nl -v -1" " -1\tone\n 0\ttwo\n 1\tthree\n" \
- "" "one\ntwo\nthree\n"
-testing "-v0" "nl -v 0" " 0\tone\n 1\ttwo\n 2\tthree\n" \
- "" "one\ntwo\nthree\n"
-
testing "-l" "nl -ba -l2 -w2 - input" \
" 1\tone\n \n 2\t\n 3\ttwo\n \n 4\t\n \n 5\tthree\n 6\tfour\n \n 7\t\n \n 8\tbang\n \n" \
"\n\nbang\n\n" "one\n\n\ntwo\n\n\n\nthree\nfour\n\n"
diff --git a/tests/pidof.test b/tests/pidof.test
deleted file mode 100644
index 1d0ea567..00000000
--- a/tests/pidof.test
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-[ -f testing.sh ] && . testing.sh
-
-#testing "name" "command" "result" "infile" "stdin"
-
-#
-# pidof (unlike killall) doesn't match argv[1] unless you supply -x.
-#
-
-echo -e "#!$(which sh)\nread i < /proc/self/fd/1" > pidof-$$.test
-chmod a+x pidof-$$.test
-cp pidof-$$.test toybox.pidof-$$.test.script
-(./pidof-$$.test & echo $! > pid.txt)
-pid=$(cat pid.txt)
-testcmd "short argv[1]" "pidof-$$.test" "" "" ""
-testcmd "short argv[1] -x" "-x pidof-$$.test" "$pid\n" "" ""
-kill $pid
-
-(./toybox.pidof-$$.test.script & echo $! > pid.txt)
-pid=$(cat pid.txt)
-testcmd "long argv[1]" "toybox.pidof-$$.test.script" "" "" ""
-testcmd "long argv[1] -x" "-x toybox.pidof-$$.test.script" "$pid\n" "" ""
-kill $pid
-
-rm -f toybox.pidof-$$.test.script pidof-$$.test pid.txt
-
-# pidof (unlike killall) will match itself.
-testcmd "pidof pidof" "pidof > /dev/null && echo found" "found\n" "" ""
diff --git a/tests/printf.test b/tests/printf.test
index a341615e..eb0e0bec 100755
--- a/tests/printf.test
+++ b/tests/printf.test
@@ -68,19 +68,3 @@ testing "printf posix inconsistency" "$PRINTF '\\0066-%b' '\\0066'" "\x066-6" \
testing "printf \x" "$PRINTF 'A\x1b\x2B\x3Q\xa' | od -An -tx1" \
" 41 1b 2b 03 51 0a\n" "" ""
-
-testing "printf \c" "$PRINTF 'one\ctwo'" "one" "" ""
-
-# An extra leading 0 is fine for %b, but not as a direct escape, for some
-# reason...
-testing "printf octal %b" "$PRINTF '\0007%b' '\0007' | xxd -p" "003707\n" "" ""
-
-# Unlike echo, printf errors out on bad hex.
-testcmd "invalid hex 1" "'one\xvdtwo' 2>/dev/null || echo err" "oneerr\n" "" ""
-testcmd "invalid hex 2" "'one\xavtwo'" "one\nvtwo" "" ""
-# But bad octal is shown as text.
-testcmd "invalid oct" "'one\079two'" "one\a9two" "" ""
-
-# extension for ESC
-testcmd "%b \e" "'%b' '\\e' | xxd -p" "1b\n" "" ""
-testcmd "\e" "'\\e' | xxd -p" "1b\n" "" ""
diff --git a/tests/ps.test b/tests/ps.test
deleted file mode 100755
index e14336ff..00000000
--- a/tests/ps.test
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-[ -f testing.sh ] && . testing.sh
-
-#testing "name" "command" "result" "infile" "stdin"
-
-ln -s "$(which sleep)" xiphoid
-(./xiphoid 5 & echo $! > pid.txt)
-ID=$(cat pid.txt)
-NOSPACE=1 testing "" "ps -o pid $ID" "PID\n$ID\n" "" ""
-kill "$ID"
diff --git a/tests/readlink.test b/tests/readlink.test
index cc728dbf..52121770 100755
--- a/tests/readlink.test
+++ b/tests/readlink.test
@@ -17,7 +17,6 @@ testing "-f missing" "readlink -f notfound" "$APWD/notfound\n" "" ""
ln -sf notfound link
testing "link" "readlink link" "notfound\n" "" ""
-testing "links" "readlink link link" "notfound\nnotfound\n" "" ""
testing "link->missing" "readlink -f link" "$APWD/notfound\n" "" ""
ln -sf ../../ link
testing "stays relative" "readlink link" "../../\n" "" ""
diff --git a/tests/rm.test b/tests/rm.test
index 9f2b8012..f0a123c3 100755
--- a/tests/rm.test
+++ b/tests/rm.test
@@ -45,7 +45,7 @@ testing "-r nested_dir" "rm -r dir1/dir2/ 2>/dev/null &&
rm -rf dir*
mkdir -p one && touch one/two && chmod 000 one
-toyonly testing "-rf 000 dir" \
+SKIP_HOST=1 testing "-rf 000 dir" \
"rm -rf one 2>/dev/null && [ ! -e one ] && echo yes" "yes\n" "" ""
chmod 777 one 2>/dev/null ; rm -rf one
diff --git a/tests/sed.test b/tests/sed.test
index 98c109ad..6b27fff8 100755
--- a/tests/sed.test
+++ b/tests/sed.test
@@ -151,12 +151,6 @@ testing "trailing a\ (for debian)" "sed 'a\\'" "hello\n" "" "hello"
# You have to match the first line of a range in order to activate
# the range, numeric and ascii work the same way
testing "skip start of range" "sed -e n -e '1,2s/b/c/'" "a\nb\n" "" "a\nb\n"
-testing "range +1" "sed -ne '/blah/,+1p'" "blah\n6\n" "" \
- "1\n2\n3\n4\n5\nblah\n6\n7\n8\n9\n"
-testing "range +0" "sed -ne '/blah/,+0p'" "blah\n" "" \
- "1\n2\n3\n4\n5\nblah\n6\n7\n8\n9\n"
-testing "range +3" "sed -ne '2,+3p'" "2\n3\n4\n5\n" "" \
- "1\n2\n3\n4\n5\nblah\n6\n7\n8\n9\n"
#echo meep | sed/sed -e '1a\' -e 'huh'
#echo blah | sed/sed -f <(echo -e "1a\\\\\nboom")
@@ -182,10 +176,4 @@ testing '\n with empty capture' \
testing '\n too high' \
'sed -E "s/(.*)/\2/p" 2>/dev/null || echo OK' "OK\n" "" "foo"
-# Performance test
-X=x; Y=20; while [ $Y -gt 0 ]; do X=$X$X; Y=$(($Y-1)); done
-testing 'megabyte s/x/y/g (5 sec timeout)' "timeout 5 sed 's/x/y/g' | sha1sum" \
- '138c1fa7c3f64186203b0192fb4abdb33cb4e98a -\n' '' "$X\n"
-unset X Y
-
# -i with $ last line test
diff --git a/tests/split.test b/tests/split.test
index 4a522432..533cd4fa 100755
--- a/tests/split.test
+++ b/tests/split.test
@@ -25,7 +25,7 @@ testing "bytes" \
"seq 1 20000 | split -b 100 -a 3 - whang && ls whang* | wc -l && wc -c whangbpw" "1089\n94 whangbpw\n" "" ""
testing "reassembly" \
- 'ls whang* | sort | xargs cat > reassembled && seq 1 20000 | diff -u reassembled - && echo yes' \
+ 'diff -u <(ls whang* | sort | xargs cat) <(seq 1 20000) && echo yes' \
"yes\n" "" ""
-rm file whang* reassembled
+rm file whang*
diff --git a/tests/tail.test b/tests/tail.test
index 036f433c..b148aebc 100755
--- a/tests/tail.test
+++ b/tests/tail.test
@@ -26,6 +26,7 @@ rm file1
testing "stdin no trailing newline" "tail -n 1 - " "c" "" "a\nb\nc"
testing "file no trailing newline" "tail -n 1 input" "c" "a\nb\nc" ""
+optional TAIL_SEEK
testing "noseek -n in bounds" "tail -n 3" "nine\nten\neleven\n" \
"" "$BIGTEST"
testing "noseek -n out of bounds" "tail -n 999" "$BIGTEST" "" "$BIGTEST"
diff --git a/tests/tar.test b/tests/tar.test
index 985cea5f..ef83ad94 100644
--- a/tests/tar.test
+++ b/tests/tar.test
@@ -11,278 +11,110 @@ export TZ=utc
OLDUMASK=$(umask)
umask 0002
-# 255 bytes, longest VFS name
-LONG=0123456789abcdef0123456789abcdef
-LONG=$LONG$LONG$LONG$LONG$LONG$LONG$LONG$LONG
-LONG=${LONG:1:255}
+# 3888 bytes, most of PATH_MAX
+LONG=abcdefghijklmnopqrstuvwxyz0123456789
+LONG=$LONG$LONG$LONG$LONG$LONG$LONG$LONG$LONG$LONG
+LONG=$LONG$LONG$LONG$LONG$LONG$LONG
+LONG=$LONG$LONG
-# Reproducible tarballs: override ownership and timestamp.
-TAR='tar c --owner root --group root --mtime @1234567890'
-
-# Also amount of trailing NUL padding varies (1024 bytes is minimum,
-# gnu/dammit does more) so look at first N 512-byte frames when
-# analyzing header content.
-function SUM()
-{
- if [ -n "$TARHD" ]; then
- # (Android's shell doesn't support process substitution.)
- mkfifo xxd-pipe
- xxd <xxd-pipe & pid=$!
- tee xxd-pipe | head -c $(($1*512)) | sha1sum | sed "s/ .*//"
- rm xxd-pipe
- wait $pid
- else
- head -c $(($1*512)) | sha1sum | sed "s/ .*//"
- fi
-}
+# Reproducible tarballs: override ownership and timestamp. Also amount of
+# trailing NUL padding varies (1024 bytes is minimum, gnu/dammit does more)
+# so look at first 3 512-byte frames when analyzing header content.
-function LST()
-{
- tar tv "$@" | sed 's/[ \t][ \t]*/ /g'
-}
+TAR='tar c --owner root --group root --mtime @1234567890'
+SUM='head -c $((3*512)) | sha1sum | sed "s/ .*//"'
+[ -n "$TARHD" ] && SUM="tee >(hd >&2) | $SUM"
+LST='tar tv | sed "s/[ \t][ \t]*/ /g"'
touch file
-testing "create file" "$TAR file | SUM 3" \
+testing "create file" "$TAR file | $SUM" \
"fecaecba936e604bb115627a6ef4db7c7a3a8f81\n" "" ""
-testing "pass file" "$TAR file | LST" \
+testing "pass file" "$TAR file | $LST" \
"-rw-rw-r-- root/root 0 2009-02-13 23:31 file\n" "" ""
# The kernel has two hardwired meaningful UIDs: 0 (root) and 65534 (nobody).
# (Technically changeable via /proc/sys/*/overflowuid but nobody ever does)
skipnot id nobody >/dev/null
-testing "pass user" "tar -c --owner nobody --group root --mtime @0 file | LST" \
+testing "pass user" "tar -c --owner nobody --group root --mtime @0 file | $LST" \
"-rw-rw-r-- nobody/root 0 1970-01-01 00:00 file\n" "" ""
-# (We assume that if we have the nobody user, we also have the group, in the
-# absence of a good portable way to test for the existence of a named group.)
-skipnot id nobody >/dev/null
-testing "pass group" "tar c --owner root --group nobody --mtime @0 file | LST" \
+skipnot grep nobody /etc/group >/dev/null
+testing "pass group" "tar c --owner root --group nobody --mtime @0 file | $LST" \
"-rw-rw-r-- root/nobody 0 1970-01-01 00:00 file\n" "" ""
touch -t 198701231234.56 file
testing "pass mtime" \
- "tar c --owner root --group root file | LST --full-time" \
+ "tar c --owner root --group root file | tar tv --full-time | sed 's/[ \t][ \t]*/ /g'" \
"-rw-rw-r-- root/root 0 1987-01-23 12:34:56 file\n" "" ""
-testing "adjust mode" \
- "tar c --owner root --group root --mode a+x file | LST --full-time" \
- "-rwxrwxr-x root/root 0 1987-01-23 12:34:56 file\n" "" ""
-
mkdir dir
-testing "create dir" "$TAR dir | SUM 3" \
+testing "create dir" "$TAR dir | $SUM" \
"05739c423d7d4a7f12b3dbb7c94149acb2bb4f8d\n" "" ""
-testing "pass dir" "$TAR dir | LST" \
+testing "pass dir" "$TAR dir | $LST" \
"drwxrwxr-x root/root 0 2009-02-13 23:31 dir/\n" "" ""
# note: does _not_ include dir entry in archive, just file
touch dir/file
-testing "create file in dir" "$TAR dir/file | SUM 3" \
+testing "create file in dir" "$TAR dir/file | $SUM" \
"2d7b96c7025987215f5a41f10eaa84311160afdb\n" "" ""
# Tests recursion without worrying about content order
-testing "create dir and dir/file" "$TAR dir | SUM 3" \
+testing "create dir and dir/file" "$TAR dir | $SUM" \
"0bcc8005a3e07eb63c9b735267aecc5b774795d7\n" "" ""
-testing "pass dir/file" "$TAR dir | LST" \
+testing "pass dir/file" "$TAR dir | $LST" \
"drwxrwxr-x root/root 0 2009-02-13 23:31 dir/\n-rw-rw-r-- root/root 0 2009-02-13 23:31 dir/file\n" "" ""
-echo boing > dir/that
-testing "tar C" "$TAR -C dir that | SUM 3" \
- "f0deff71bf4858eb0c5f49d99d052f12f1831feb\n" "" ""
-
# / and .. only stripped from name, not symlink target.
ln -s ../name.././.. dir/link
-testing "create symlink" "$TAR dir/link | SUM 3" \
+testing "create symlink" "$TAR dir/link | $SUM" \
"7324cafbd9aeec5036b6efc54d741f11528aeb10\n" "" ""
# Also two explicit targets
ln dir/file dir/hardlink
-testing "create hardlink" "$TAR dir/file dir/hardlink | SUM 3" \
+testing "create hardlink" "$TAR dir/file dir/hardlink | $SUM" \
"c5383651f8c03ec0fe15e8a9e28a4e8e5273990d\n" "" ""
ln dir/link dir/hlink
-testing "create hardlink to symlink" "$TAR dir/link dir/hlink | SUM 3" \
+testing "create hardlink to symlink" "$TAR dir/link dir/hlink | $SUM" \
"3bc16f8fb6fc8b05f691da8caf989a70ee99284a\n" "" ""
skipnot mkfifo dir/fifo
-testing "create dir/fifo" "$TAR dir/fifo | SUM 3" \
+testing "create dir/fifo" "$TAR dir/fifo | $SUM" \
"bd1365db6e8ead4c813333f9666994c1899924d9\n" "" ""
# test L and K records
# 4+96=100 (biggest short name), 4+97=101 (shortest long name)
touch dir/${LONG:1:96} dir/${LONG:1:97}
-testing "create long fname" "$TAR dir/${LONG:1:97} dir/${LONG:1:96} | SUM 3" \
- "99348686fe9c9bf80f5740f1fc0c6f32f2021e3d\n" "" ""
-
-ln -s dir/${LONG:1:96} dir/lshort
-ln -s dir/${LONG:1:97} dir/llong
-testing "create long symlnk" "$TAR dir/lshort dir/llong | SUM 3" \
- "8a5d652dc85f252a2e3b3f47d1ecd699e98a5f4b\n" "" ""
-
-ln -s $LONG dir/${LONG:5}
-testing "create long->long" "$TAR dir/${LONG:5} | SUM 7" \
- "543116b8e690a116a559ab5b673f9b6d6601c925\n" "" ""
-# absolute and relative link names, broken and not
-
-ln -s file dir/linkok
-testing "create symlink" "$TAR dir/linkok | SUM 3" \
- "55652846506cf0a9d43b3ef03ccf9e98123befaf\n" "" ""
-
-ln -s /dev/null dir/linknull
-testing "pass absolute symlink" "$TAR dir/linknull | LST" \
- "lrwxrwxrwx root/root 0 2009-02-13 23:31 dir/linknull -> /dev/null\n" "" ""
-
-ln -s rel/broken dir/relbrok
-testing "pass broken symlink" "$TAR dir/relbrok | LST" \
- "lrwxrwxrwx root/root 0 2009-02-13 23:31 dir/relbrok -> rel/broken\n" "" ""
-
-ln -s /does/not/exist dir/linkabsbrok
-testing "pass broken absolute symlink" "$TAR dir/linkabsbrok | LST" \
- "lrwxrwxrwx root/root 0 2009-02-13 23:31 dir/linkabsbrok -> /does/not/exist\n" \
- "" ""
+testing "create longfilename" "$TAR dir/${LONG:1:97} dir/${LONG:1:96} | $SUM" \
+ "08af4f9d8b7f4b2f6c264689efe42a4159314708\n" "" ""
# this expects devtmpfs values
testing "pass /dev/null" \
- "tar c --mtime @0 /dev/null 2>/dev/null | LST" \
+ "tar c --mtime @0 /dev/null 2>/dev/null | $LST" \
"crw-rw-rw- root/root 1,3 1970-01-01 00:00 dev/null\n" "" ""
-# compression types
-testing "autodetect gzip" 'LST -f "$FILES"/tar/tar.tgz' \
- "drwxr-x--- enh/eng 0 2017-05-13 01:05 dir/\n-rw-r----- enh/eng 12 2017-05-13 01:05 dir/file\n" \
- "" ""
-
-testing "manually specify bz2" 'LST -jf "$FILES"/tar/tar.tbz2' \
- "drwxr-x--- enh/eng 0 2017-05-13 01:05 dir/\n-rw-r----- enh/eng 12 2017-05-13 01:05 dir/file\n" \
- "" ""
+testing "pass /dev/loop0" \
+ "tar c --numeric-owner --mtime @0 /dev/loop0 2>/dev/null | $LST" \
+ "brw-rw---- 0/6 7,0 1970-01-01 00:00 dev/loop0\n" "" ""
skipnot mknod dir/char c 12 34
-testing "character special" "tar --mtime @0 -cf test.tar dir/char && rm -f dir/char && tar xf test.tar && ls -l dir/char" \
- "crw-rw---- 1 root root 12, 34 1970-01-01 00:00 dir/char\n" "" ""
-
-skipnot mknod dir/block b 23 45
-testing "block special" "tar --mtime @0 -cf test.tar dir/block && rm -f dir/block && tar xf test.tar && ls -l dir/block" \
- "brw-rw---- 1 root root 23, 45 1970-01-01 00:00 dir/block\n" "" ""
-
-skipnot chown nobody dir/file
-testing "ownership" "$TAR dir/file | SUM 3" \
- "2d7b96c7025987215f5a41f10eaa84311160afdb\n" "" ""
-
-mkdir -p dd/sub/blah &&
-tar cf test.tar dd/sub/blah &&
-rm -rf dd/sub &&
-ln -s ../.. dd/sub || SKIPNEXT=1
-toyonly testing "symlink out of cwd" \
- "tar xf test.tar 2> /dev/null || echo yes ; [ ! -e dd/sub/blah ] && echo yes" \
- "yes\nyes\n" "" ""
-
-# If not root can't preserve ownership, so don't try yet.
+testing "create char2" "$TAR /dev/null | $SUM" \
+ "" "" ""
-testing "extract dir/file from tar" \
- "tar xvCf dd $FILES/tar/tar.tar && stat -c '%A %Y %n' dd/dir dd/dir/file" \
- "dir/\ndir/file\ndrwxr-x--- 1494637555 dd/dir\n-rw-r----- 1494637555 dd/dir/file\n" \
- "" ""
+#testing "create block" "$TAR /dev/
-testing "extract dir/file from tgz (autodetect)" \
- "tar xvCf dd $FILES/tar/tar.tgz && stat -c '%A %Y %n' dd/dir dd/dir/file" \
- "dir/\ndir/file\ndrwxr-x--- 1494637555 dd/dir\n-rw-r----- 1494637555 dd/dir/file\n" \
- "" ""
+skipnot mknod dir/block b 56 78
+testing "create dir/block" "$TAR dir/block | $SUM" \
+ "" "" ""
-toyonly testing "cat tgz | extract dir/file (autodetect)" \
- "cat $FILES/tar/tar.tgz | tar xvC dd && stat -c '%A %Y %n' dd/dir dd/dir/file" \
- "dir/\ndir/file\ndrwxr-x--- 1494637555 dd/dir\n-rw-r----- 1494637555 dd/dir/file\n" \
- "" ""
-
-testing "extract dir/file from tbz2 (autodetect)" \
- "tar xvCf dd $FILES/tar/tar.tbz2 && stat -c '%A %Y %n' dd/dir dd/dir/file" \
- "dir/\ndir/file\ndrwxr-x--- 1494637555 dd/dir\n-rw-r----- 1494637555 dd/dir/file\n" \
- "" ""
-
-toyonly testing "cat tbz | extract dir/file (autodetect)" \
- "cat $FILES/tar/tar.tbz2 | tar xvC dd && stat -c '%A %Y %n' dd/dir dd/dir/file" \
- "dir/\ndir/file\ndrwxr-x--- 1494637555 dd/dir\n-rw-r----- 1494637555 dd/dir/file\n" \
- "" ""
-
-yes | (dd bs=$((1<<16)) count=1; dd bs=8192 seek=14 count=1; dd bs=4096 seek=64 count=5) 2>/dev/null > fweep
-testing "sparse without overflow" "$TAR --sparse fweep | SUM 3" \
- "e1560110293247934493626d564c8f03c357cec5\n" "" ""
-
-rm fweep
-for i in 1 3 5 7 9 14 27 36 128 256 300 304
-do
- dd if=/dev/zero of=fweep bs=65536 seek=$i count=1 2>/dev/null
-done
-
-testing "sparse single overflow" "$TAR --sparse fweep | SUM 6" \
- "063fc6519ea2607763bc591cc90dd15ac2b43eb8\n" "" ""
-
-rm fweep
-for i in $(seq 8 3 200)
-do
- dd if=/dev/zero of=fweep bs=65536 seek=$i count=1 2>/dev/null
- dd if=/dev/zero of=fweep2 bs=65536 seek=$i count=1 2>/dev/null
-done
-truncate -s 20m fweep2
-
-testing "sparse double overflow" "$TAR --sparse fweep | SUM 7" \
- "f1fe57f8313a9d682ec9013a80f3798910b6ff51\n" "" ""
-
-tar c --sparse fweep > fweep.tar
-rm fweep
-testing "sparse extract" "tar xf fweep.tar && $TAR --sparse fweep | SUM 4" \
- "38dc57b8b95632a287db843c214b5c96d1cfe415\n" "" ""
-testing "sparse tvf" "tar tvf fweep.tar | grep -wq 13172736 && echo right size"\
- "right size\n" "" ""
-rm fweep fweep.tar
-
-tar c --sparse fweep2 > fweep2.tar
-rm fweep2
-testing "sparse extract hole at end" \
- "tar xf fweep2.tar && $TAR --sparse fweep2 | SUM 4" \
- "791060574c569e5c059e2b90c1961a3575898f97\n" "" ""
-rm fweep2 fweep2.tar
-
-if false
-then
-
-chmod 700 dir
-tar cpf tar.tgz dir/file
-#chmod 700 dir
-#tar xpf file
-#ls -ld dir/file
-
-# restore ownership of file, dir, and symlink
-
-# merge add_to_tar and write_longname,
-# filter, incl or excl and anchored/wildcards
-
-# extract file not under cwd
-# exclusion defaults to --no-anchored and --wildcards-match-slash
-# both incl and excl
-
-# catch symlink overwrite
-# add dir with no trailing slash
-# don't allow hardlink target outside cwd
-# extract dir/file without dir in tarball
-# create with and without each flag
-# --owner --group --numeric-owner
-# extract with and without each flag
-# --owner 0 --group 0
-# set symlink owner
-# >256 hardlink inodes
-# // remove leading / and any .. entries from saved name
-# // exclusion defaults to --no-anchored and --wildcards-match-slash
-# //bork blah../thing blah/../thing blah/../and/../that blah/.. ../blah
-# tar tv --owner --group --mtime
-# extract file within dir date correct
-# name ending in /.. or just ".." as a name
-
-
-fi
+skipnot chown nobody dir/file
+testing "ownership" "$TAR dir/block | $SUM" \
+ "blat" "" ""
TZ="$OLDTZ"
umask $OLDUMASK
-unset LONG TAR SUM OLDUMASK OLDTZ
-unset -f LST
+unset LONG TAR SUM OLDUMASK OLDTZ LST
diff --git a/tests/timeout.test b/tests/timeout.test
index 18f93790..189b592a 100644
--- a/tests/timeout.test
+++ b/tests/timeout.test
@@ -18,18 +18,3 @@ testcmd "exit 1" '.1 false ; echo $?' '1\n' '' ''
testcmd "--preserve-status" '--preserve-status .1 sleep 100 ; echo $?' '143\n' '' ''
testcmd "--preserve-status killed" '--preserve-status -s 9 .1 sleep 100 ; echo $?' '137\n' '' ''
-
-# There's another special case where if the subprocess catches our timeout
-# signal and exits, we need to report that as a timeout (unless overridden).
-cat > loop.sh <<EOF
-#!/bin/sh
-trap "exit 3" SIGTERM
-while true; do
- :
-done
-EOF
-chmod a+x loop.sh
-testcmd "trap-and-exit" '1 ./loop.sh ; echo $?' '124\n' '' ''
-testcmd "trap-and-exit --preserve-status" \
- '--preserve-status 1 ./loop.sh ; echo $?' '3\n' '' ''
-rm loop.sh
diff --git a/tests/touch.test b/tests/touch.test
index 8be231b7..b010f7d3 100644
--- a/tests/touch.test
+++ b/tests/touch.test
@@ -64,10 +64,10 @@ testing "-t CCMMDDhhmm" \
"touch -t 2101231234 input && date +%Y-%m-%d:%H-%M-%S -r input" \
"$(date +%C)21-01-23:12-34-00\n" "" ""
-testing "-a" "TZ=utc touch -t 197101020304 walrus &&
- TZ=utc touch -t 197203040506 -a walrus && TZ=utc stat -c '%X %Y' walrus" \
- "68533560 31633440\n" "" ""
-testing "-m" "TZ=utc touch -t 197101020304 walrus &&
+testing "-a" "touch -t 197101020304 walrus &&
+ touch -t 197203040506 -a walrus && stat -c '%X %Y' walrus" \
+ "68555160 31655040\n" "" ""
+testing "-m" "TZ=utc touch -t 197101020304 walrus &&
TZ=utc touch -t 197203040506 -m walrus && TZ=utc stat -c '%X %Y' walrus" \
"31633440 68533560\n" "" ""
testing "-am" "TZ=utc touch -t 197101020304 walrus &&
diff --git a/tests/truncate.test b/tests/truncate.test
index 253af626..1d19aa1b 100755
--- a/tests/truncate.test
+++ b/tests/truncate.test
@@ -8,11 +8,8 @@ SIZE='&& stat -c %s freep'
testing "0" "truncate -s 0 freep $SIZE" "0\n" "" ""
testing "12345" "truncate -s 12345 freep $SIZE" "12345\n" "" ""
testing "1m" "truncate -s 1m freep $SIZE" "1048576\n" "" ""
-# We can't test against 0 because Android filesystems use an extra 4KiB for
-# extended attributes (SELinux).
-testing "is sparse" "truncate -s 1g freep && [ $(stat -c %b freep) -le 8 ] &&
- echo okay" \
- "okay\n" "" ""
+testing "is sparse" "truncate -s 1g freep && stat -c %b freep" \
+ "0\n" "" ""
testing "+" "truncate -s 1k freep && truncate -s +1k freep $SIZE" \
"2048\n" "" ""
testing "-" "truncate -s 4k freep && truncate -s -1k freep $SIZE" \
diff --git a/tests/xargs.test b/tests/xargs.test
index e2eec036..dce93ed3 100644
--- a/tests/xargs.test
+++ b/tests/xargs.test
@@ -10,22 +10,14 @@ testing "spaces" "xargs" \
testing "-n 0" "xargs -n 0 2>/dev/null || echo ok" "ok\n" \
"" "one \ntwo\n three"
-testing "-n 1" "xargs -n 1" "one\n" "" "one\n"
testing "-n 2" "xargs -n 2" "one two\nthree\n" "" "one \ntwo\n three"
testing "-n exact match" "xargs -n 3" "one two three\n" "" "one two three"
testing "xargs2" "xargs -n2" "one two\nthree four\nfive\n" "" \
"one two three four five"
-testing "-s too long" "xargs -s 9 echo 2>/dev/null; echo \$?" \
- "one\ntwo\n1\n" "" "one two three"
+testing "-s too long" "xargs -s 9 echo 2>/dev/null || echo ok" \
+ "one\ntwo\nok\n" "" "one two three"
testing "-s 13" "xargs -s 13 echo" "one two\nthree\n" "" "one \ntwo\n three"
testing "-s 12" "xargs -s 12 echo" "one\ntwo\nthree\n" "" "one \ntwo\n three"
-# Check that we're accounting for the command *and* its arguments correctly.
-testing "-s counts args" "xargs -s 13 echo ' ' ' '" " one\n" "" "one\n"
-# 5 is the minimum allowed for the default "echo".
-testing "-s 4 fails" "xargs -s 4 2>/dev/null || echo bad" "bad\n" "" ""
-testing "-s 5 no input okay" "xargs -s 5" "\n" "" ""
-testing "-s 5 with input bad" "xargs -s 5 2>/dev/null || echo bad" "bad\n" \
- "" "a\n"
touch one two three
testing "command -opt" "xargs -n2 ls -1" "one\ntwo\nthree\n" "" \
@@ -37,20 +29,9 @@ testing "-0 -n2" "printf 'a\0b\0c\0d\0e\0f' | xargs -0 -n2 echo _" "_ a b\n_ c d
testing "-t" "xargs -t 2>stderr ; cat stderr ; rm stderr" "one two\necho one two \n" "" "one\ntwo\n"
-testing "-E END" "xargs -E END" "a b ENDE\n" "" "a\nb\nENDE\nEND\nc\nd\n"
+testing "-E END" "xargs -E END" "a b\n" "" "a\nb\nEND\nc\nd\n"
testing "-r" "xargs -r echo x" "" "" ""
-testing "no -r" "xargs echo x" "x\n" "" ""
-
-# Exit value madness. 0 and 126/127 are normal.
-testing "true" "xargs true; echo \$?" "0\n" "" ""
-testing "command not found" "xargs does-not-exist 2>/dev/null; echo \$?" \
- "127\n" "" ""
-# But 1-125 are flattened to 123.
-testing "false" "xargs false; echo \$?" "123\n" "" ""
-# 255 is special "abort early" magic.
-testing "exit 255" "xargs sh -c 'exit 255' 2>&1; echo \$?" \
- "xargs: sh: exited with status 255; aborting\n124\n" "" ""
# TODO: what exactly is -x supposed to do? why does coreutils output "one"?
#testing "-x" "xargs -x -s 9 || echo expected" "one\nexpected\n" "" "one\ntwo\nthree"
@@ -59,4 +40,8 @@ testing "exit 255" "xargs sh -c 'exit 255' 2>&1; echo \$?" \
#testing "-n exact match"
#testing "-s exact match"
+#testing "-s 0"
#testing "-s impossible"
+
+# xargs command_not_found - returns 127
+# xargs false - returns 1
diff --git a/toybox-tests.xml b/toybox-tests.xml
deleted file mode 100644
index 25bdf42e..00000000
--- a/toybox-tests.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<configuration description="Config for running toybox-tests through Atest or in Infra">
- <option name="test-suite-tag" value="toybox-tests" />
- <!-- Several of these tests assume they're run as root. -->
- <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
- <!-- This test requires a device, so it's not annotated with a null-device. -->
- <test class="com.android.tradefed.testtype.binary.ExecutableHostTest" >
- <option name="binary" value="run-tests-on-android.sh" />
- <!-- Toybox tests script assumes a relative path with the tests/ folders. -->
- <option name="relative-path-execution" value="true" />
- <!-- Tests shouldn't be that long but set 15m to be safe. -->
- <option name="per-binary-timeout" value="15m" />
- </test>
-</configuration>
diff --git a/toys.h b/toys.h
index 177918a6..b9eb4f39 100644
--- a/toys.h
+++ b/toys.h
@@ -101,7 +101,6 @@ extern struct toy_context {
char **optargs; // Arguments left over from get_optflags()
unsigned long long optflags; // Command line option flags from get_optflags()
int optc; // Count of optargs
- int envc; // Count of original environ entries
int old_umask; // Old umask preserved by TOYFLAG_UMASK
short toycount; // Total number of commands in this build
short signal; // generic_signal() records what signal it saw here
diff --git a/toys/android/getprop.c b/toys/android/getprop.c
new file mode 100644
index 00000000..51ef7f6b
--- /dev/null
+++ b/toys/android/getprop.c
@@ -0,0 +1,119 @@
+/* getprop.c - Get an Android system property
+ *
+ * Copyright 2015 The Android Open Source Project
+
+USE_GETPROP(NEWTOY(getprop, ">2Z", TOYFLAG_USR|TOYFLAG_SBIN))
+
+config GETPROP
+ bool "getprop"
+ default y
+ depends on TOYBOX_ON_ANDROID && TOYBOX_SELINUX
+ help
+ usage: getprop [NAME [DEFAULT]]
+
+ Gets an Android system property, or lists them all.
+*/
+
+#define FOR_getprop
+#include "toys.h"
+
+#include <sys/system_properties.h>
+
+#include <selinux/android.h>
+#include <selinux/label.h>
+#include <selinux/selinux.h>
+
+GLOBALS(
+ size_t size;
+ char **nv; // name/value pairs: even=name, odd=value
+ struct selabel_handle *handle;
+)
+
+static char *get_property_context(const char *property)
+{
+ char *context = NULL;
+
+ if (selabel_lookup(TT.handle, &context, property, 1)) {
+ perror_exit("unable to lookup label for \"%s\"", property);
+ }
+ return context;
+}
+
+static void read_callback(void *unused, const char *name, const char *value,
+ unsigned serial)
+{
+ if (!(TT.size&31)) TT.nv = xrealloc(TT.nv, (TT.size+32)*2*sizeof(char *));
+
+ TT.nv[2*TT.size] = xstrdup((char *)name);
+ if (toys.optflags & FLAG_Z) {
+ TT.nv[1+2*TT.size++] = get_property_context(name);
+ } else {
+ TT.nv[1+2*TT.size++] = xstrdup((char *)value);
+ }
+}
+
+static void add_property(const prop_info *pi, void *unused)
+{
+ __system_property_read_callback(pi, read_callback, NULL);
+}
+
+static void print_callback(void *unused, const char *unused_name, const char *value,
+ unsigned unused_serial)
+{
+ puts(value);
+}
+
+// Needed to supress extraneous "Loaded property_contexts from" message
+static int selinux_log_callback_local(int type, const char *fmt, ...)
+{
+ va_list ap;
+
+ if (type == SELINUX_INFO) return 0;
+ va_start(ap, fmt);
+ verror_msg((char *)fmt, 0, ap);
+ va_end(ap);
+ return 0;
+}
+
+void getprop_main(void)
+{
+ if (toys.optflags & FLAG_Z) {
+ union selinux_callback cb;
+
+ cb.func_log = selinux_log_callback_local;
+ selinux_set_callback(SELINUX_CB_LOG, cb);
+ TT.handle = selinux_android_prop_context_handle();
+ if (!TT.handle) error_exit("unable to get selinux property context handle");
+ }
+
+ if (*toys.optargs) {
+ if (toys.optflags & FLAG_Z) {
+ char *context = get_property_context(*toys.optargs);
+
+ puts(context);
+ if (CFG_TOYBOX_FREE) free(context);
+ } else {
+ const prop_info* pi = __system_property_find(*toys.optargs);
+ if (pi == NULL) {
+ puts(toys.optargs[1] ? toys.optargs[1] : "");
+ } else {
+ __system_property_read_callback(pi, print_callback, NULL);
+ }
+ }
+ } else {
+ size_t i;
+
+ if (__system_property_foreach(add_property, NULL))
+ error_exit("property_list");
+ qsort(TT.nv, TT.size, 2*sizeof(char *), qstrcmp);
+ for (i = 0; i<TT.size; i++) printf("[%s]: [%s]\n", TT.nv[i*2],TT.nv[1+i*2]);
+ if (CFG_TOYBOX_FREE) {
+ for (i = 0; i<TT.size; i++) {
+ free(TT.nv[i*2]);
+ free(TT.nv[1+i*2]);
+ }
+ free(TT.nv);
+ }
+ }
+ if (CFG_TOYBOX_FREE && (toys.optflags & FLAG_Z)) selabel_close(TT.handle);
+}
diff --git a/toys/android/setprop.c b/toys/android/setprop.c
new file mode 100644
index 00000000..cda34a5d
--- /dev/null
+++ b/toys/android/setprop.c
@@ -0,0 +1,44 @@
+/* setprop.c - Set an Android system property
+ *
+ * Copyright 2015 The Android Open Source Project
+
+USE_SETPROP(NEWTOY(setprop, "<2>2", TOYFLAG_USR|TOYFLAG_SBIN))
+
+config SETPROP
+ bool "setprop"
+ default y
+ depends on TOYBOX_ON_ANDROID
+ help
+ usage: setprop NAME VALUE
+
+ Sets an Android system property.
+*/
+
+#define FOR_setprop
+#include "toys.h"
+
+void setprop_main(void)
+{
+ char *name = toys.optargs[0], *value = toys.optargs[1];
+ char *p;
+ size_t name_len = strlen(name), value_len = strlen(value);
+
+ // property_set doesn't tell us why it failed, and actually can't
+ // recognize most failures (because it doesn't wait for init), so
+ // we duplicate all of init's checks here to help the user.
+
+ if (value_len >= PROP_VALUE_MAX && !strncmp(value, "ro.", 3))
+ error_exit("value '%s' too long; try '%.*s'",
+ value, PROP_VALUE_MAX - 1, value);
+
+ if (*name == '.' || name[name_len - 1] == '.')
+ error_exit("property names must not start or end with '.'");
+ if (strstr(name, ".."))
+ error_exit("'..' is not allowed in a property name");
+ for (p = name; *p; ++p)
+ if (!isalnum(*p) && !strchr(":@_.-", *p))
+ error_exit("invalid character '%c' in name '%s'", *p, name);
+
+ if (__system_property_set(name, value))
+ error_msg("failed to set property '%s' to '%s'", name, value);
+}
diff --git a/toys/android/start.c b/toys/android/start.c
new file mode 100644
index 00000000..5df847a9
--- /dev/null
+++ b/toys/android/start.c
@@ -0,0 +1,59 @@
+/* start.c - Start/stop system services.
+ *
+ * Copyright 2016 The Android Open Source Project
+
+USE_START(NEWTOY(start, "", TOYFLAG_USR|TOYFLAG_SBIN))
+USE_STOP(NEWTOY(stop, "", TOYFLAG_USR|TOYFLAG_SBIN))
+
+config START
+ bool "start"
+ depends on TOYBOX_ON_ANDROID
+ default y
+ help
+ usage: start [SERVICE...]
+
+ Starts the given system service, or netd/surfaceflinger/zygotes.
+
+config STOP
+ bool "stop"
+ depends on TOYBOX_ON_ANDROID
+ default y
+ help
+ usage: stop [SERVICE...]
+
+ Stop the given system service, or netd/surfaceflinger/zygotes.
+*/
+
+#define FOR_start
+#include "toys.h"
+
+static void start_stop(int start)
+{
+ char *property = start ? "ctl.start" : "ctl.stop";
+ // null terminated in both directions
+ char *services[] = {0,"netd","surfaceflinger","zygote","zygote_secondary",0},
+ **ss = toys.optargs;
+ int direction = 1;
+
+ if (getuid()) error_exit("must be root");
+
+ if (!*ss) {
+ // If we don't have optargs, iterate through services forward/backward.
+ ss = services+1;
+ if (!start) ss = services+ARRAY_LEN(services)-2, direction = -1;
+ }
+
+ for (; *ss; ss += direction)
+ if (__system_property_set(property, *ss))
+ error_exit("failed to set property '%s' to '%s'", property, *ss);
+}
+
+void start_main(void)
+{
+ start_stop(1);
+}
+
+void stop_main(void)
+{
+ start_stop(0);
+}
diff --git a/toys/example/demo_number.c b/toys/example/demo_number.c
index 010320cf..fce18f11 100644
--- a/toys/example/demo_number.c
+++ b/toys/example/demo_number.c
@@ -2,7 +2,7 @@
*
* Copyright 2015 Rob Landley <rob@landley.net>
-USE_DEMO_NUMBER(NEWTOY(demo_number, "D#=3<3hdbs", TOYFLAG_BIN))
+USE_DEMO_NUMBER(NEWTOY(demo_number, "hdbs", TOYFLAG_BIN))
config DEMO_NUMBER
bool "demo_number"
@@ -16,13 +16,8 @@ config DEMO_NUMBER
-s Space between number and units (HR_SPACE)
*/
-#define FOR_demo_number
#include "toys.h"
-GLOBALS(
- long D;
-)
-
void demo_number_main(void)
{
char **arg;
@@ -31,7 +26,7 @@ void demo_number_main(void)
long long ll = atolx(*arg);
if (toys.optflags) {
- human_readable_long(toybuf, ll, TT.D, toys.optflags);
+ human_readable(toybuf, ll, toys.optflags);
xputs(toybuf);
} else printf("%lld\n", ll);
}
diff --git a/toys/lsb/hostname.c b/toys/lsb/hostname.c
index daa60cc0..ac7f9163 100644
--- a/toys/lsb/hostname.c
+++ b/toys/lsb/hostname.c
@@ -5,7 +5,6 @@
* http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/hostname.html
USE_HOSTNAME(NEWTOY(hostname, ">1bdsfF:[!bdsf]", TOYFLAG_BIN))
-USE_DNSDOMAINNAME(NEWTOY(dnsdomainname, ">0", TOYFLAG_BIN))
config HOSTNAME
bool "hostname"
@@ -20,18 +19,9 @@ config HOSTNAME
-f Show fully-qualified name (host+domain, FQDN)
-F Set hostname to contents of FILENAME
-s Show short host name (no domain)
-
-config DNSDOMAINNAME
- bool "dnsdomainname"
- default y
- help
- usage: dnsdomainname
-
- Show domain this system belongs to (same as hostname -d).
*/
#define FOR_hostname
-#define FORCE_FLAGS
#include "toys.h"
GLOBALS(
@@ -40,17 +30,21 @@ GLOBALS(
void hostname_main(void)
{
- char *hostname = toybuf, *dot;
+ char *hostname = *toys.optargs, *dot;
struct hostent *h;
- gethostname(toybuf, sizeof(toybuf)-1);
if (TT.F && (hostname = xreadfile(TT.F, 0, 0))) {
if (!*chomp(hostname)) {
if (CFG_TOYBOX_FREE) free(hostname);
if (!FLAG(b)) error_exit("empty '%s'", TT.F);
hostname = 0;
}
- } else hostname = (FLAG(b) && !*toybuf) ? "localhost" : *toys.optargs;
+ }
+
+ // Implement -b.
+ if (!hostname && FLAG(b))
+ if (gethostname(toybuf, sizeof(toybuf)-1) || !*toybuf)
+ hostname = "localhost";
// Setting?
if (hostname) {
@@ -59,19 +53,14 @@ void hostname_main(void)
return;
}
+ // Get the hostname.
+ if (gethostname(toybuf, sizeof(toybuf)-1)) perror_exit("gethostname");
// We only do the DNS lookup for -d and -f.
if (FLAG(d) || FLAG(f)) {
- if (!(h = gethostbyname(toybuf)))
- error_exit("gethostbyname: %s", hstrerror(h_errno));
+ if (!(h = gethostbyname(toybuf))) perror_exit("gethostbyname");
snprintf(toybuf, sizeof(toybuf), "%s", h->h_name);
}
- dot = toybuf+strcspn(toybuf, ".");
- if (FLAG(s)) *dot = '\0';
+ dot = strchr(toybuf, '.');
+ if (FLAG(s) && dot) *dot = '\0';
xputs(FLAG(d) ? dot+1 : toybuf);
}
-
-void dnsdomainname_main(void)
-{
- toys.optflags = FLAG_d;
- hostname_main();
-}
diff --git a/toys/lsb/killall.c b/toys/lsb/killall.c
index d3546a05..8870618b 100644
--- a/toys/lsb/killall.c
+++ b/toys/lsb/killall.c
@@ -4,7 +4,7 @@
*
* http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/killall.html
-USE_KILLALL(NEWTOY(killall, "?s:ilqvw", TOYFLAG_USR|TOYFLAG_BIN))
+USE_KILLALL(NEWTOY(killall, "?s:lqvi", TOYFLAG_USR|TOYFLAG_BIN))
config KILLALL
bool "killall"
@@ -19,7 +19,6 @@ config KILLALL
-q Don't print any warnings or error messages
-s Send SIGNAL instead of SIGTERM
-v Report if the signal was successfully sent
- -w Wait until all signaled processes are dead
*/
#define FOR_killall
@@ -32,7 +31,6 @@ GLOBALS(
pid_t cur_pid;
char **names;
short *err;
- struct int_list { struct int_list *next; int val; } *pids;
)
static int kill_process(pid_t pid, char *name)
@@ -41,19 +39,13 @@ static int kill_process(pid_t pid, char *name)
if (pid == TT.cur_pid) return 0;
- if (FLAG(i)) {
+ if (toys.optflags & FLAG_i) {
fprintf(stderr, "Signal %s(%d)", name, (int)pid);
if (!yesno(0)) return 0;
}
errno = 0;
kill(pid, TT.signum);
- if (FLAG(w)) {
- struct int_list *new = xmalloc(sizeof(*TT.pids));
- new->val = pid;
- new->next = TT.pids;
- TT.pids = new;
- }
for (;;) {
if (TT.names[offset] == name) {
TT.err[offset] = errno;
@@ -61,8 +53,8 @@ static int kill_process(pid_t pid, char *name)
} else offset++;
}
if (errno) {
- if (!FLAG(q)) perror_msg("pid %d", (int)pid);
- } else if (FLAG(v))
+ if (!(toys.optflags & FLAG_q)) perror_msg("pid %d", (int)pid);
+ } else if (toys.optflags & FLAG_v)
printf("Killed %s(%d) with signal %d\n", name, pid, TT.signum);
return 0;
@@ -75,14 +67,14 @@ void killall_main(void)
TT.names = toys.optargs;
TT.signum = SIGTERM;
- if (FLAG(l)) {
- list_signals();
+ if (toys.optflags & FLAG_l) {
+ sig_to_num(NULL);
return;
}
if (TT.s || (*TT.names && **TT.names == '-')) {
if (0 > (TT.signum = sig_to_num(TT.s ? TT.s : (*TT.names)+1))) {
- if (FLAG(q)) exit(1);
+ if (toys.optflags & FLAG_q) exit(1);
error_exit("Invalid signal");
}
if (!TT.s) {
@@ -91,13 +83,13 @@ void killall_main(void)
}
}
- if (!toys.optc) help_exit("no name");
+ if (!(toys.optflags & FLAG_l) && !toys.optc) help_exit("no name");
TT.cur_pid = getpid();
TT.err = xmalloc(2*toys.optc);
for (i=0; i<toys.optc; i++) TT.err[i] = ESRCH;
- names_to_pid(TT.names, kill_process, 1);
+ names_to_pid(TT.names, kill_process);
for (i=0; i<toys.optc; i++) {
if (TT.err[i]) {
toys.exitval = 1;
@@ -105,18 +97,5 @@ void killall_main(void)
perror_msg_raw(TT.names[i]);
}
}
- if (FLAG(w)) {
- for (;;) {
- struct int_list *p = TT.pids;
- int c = 0;
-
- for (; p; p=p->next) if (kill(p->val, 0) != -1 || errno != ESRCH) ++c;
- if (!c) break;
- sleep(1);
- }
- }
- if (CFG_TOYBOX_FREE) {
- free(TT.err);
- llist_traverse(TT.pids, free);
- }
+ if (CFG_TOYBOX_FREE) free(TT.err);
}
diff --git a/toys/lsb/md5sum.c b/toys/lsb/md5sum.c
index ff7e8b45..14024184 100644
--- a/toys/lsb/md5sum.c
+++ b/toys/lsb/md5sum.c
@@ -17,10 +17,10 @@
USE_MD5SUM(NEWTOY(md5sum, "bc(check)s(status)[!bc]", TOYFLAG_USR|TOYFLAG_BIN))
USE_SHA1SUM(NEWTOY(sha1sum, "bc(check)s(status)[!bc]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_TOYBOX_LIBCRYPTO(USE_SHA224SUM(OLDTOY(sha224sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_TOYBOX_LIBCRYPTO(USE_SHA256SUM(OLDTOY(sha256sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_TOYBOX_LIBCRYPTO(USE_SHA384SUM(OLDTOY(sha384sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
-USE_TOYBOX_LIBCRYPTO(USE_SHA512SUM(OLDTOY(sha512sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
+USE_SHA224SUM(OLDTOY(sha224sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN))
+USE_SHA256SUM(OLDTOY(sha256sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN))
+USE_SHA384SUM(OLDTOY(sha384sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN))
+USE_SHA512SUM(OLDTOY(sha512sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN))
config MD5SUM
bool "md5sum"
@@ -102,6 +102,8 @@ GLOBALS(
} buffer;
)
+#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
+
// for(i=0; i<64; i++) md5table[i] = abs(sin(i+1))*(1<<32); But calculating
// that involves not just floating point but pulling in -lm (and arguing with
// C about whether 1<<32 is a valid thing to do on 32 bit platforms) so:
@@ -120,44 +122,45 @@ static uint32_t md5table[64] = {
0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391
};
+static const uint8_t md5rot[64] = {
+ 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
+ 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20,
+ 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23,
+ 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21
+};
+
// Mix next 64 bytes of data into md5 hash
static void md5_transform(void)
{
- unsigned x[4], *b = (unsigned *)TT.buffer.c;
+ unsigned x[4], *b = TT.buffer.i;
int i;
memcpy(x, TT.state, sizeof(x));
for (i=0; i<64; i++) {
- unsigned int in, a, rot, temp;
-
- a = (-i)&3;
+ unsigned int in, temp, swap;
if (i<16) {
in = i;
- rot = 7+(5*(i&3));
- temp = x[(a+1)&3];
- temp = (temp & x[(a+2)&3]) | ((~temp) & x[(a+3)&3]);
+ temp = x[1];
+ temp = (temp & x[2]) | ((~temp) & x[3]);
} else if (i<32) {
in = (1+(5*i))&15;
- temp = (i&3)+1;
- rot = temp*5;
- if (temp&2) rot--;
- temp = x[(a+3)&3];
- temp = (x[(a+1)&3] & temp) | (x[(a+2)&3] & ~temp);
+ temp = x[3];
+ temp = (x[1] & temp) | (x[2] & ~temp);
} else if (i<48) {
- in = (5+(3*(i&15)))&15;
- rot = i&3;
- rot = 4+(5*rot)+((rot+1)&6);
- temp = x[(a+1)&3] ^ x[(a+2)&3] ^ x[(a+3)&3];
+ in = (3*i+5)&15;
+ temp = x[1] ^ x[2] ^ x[3];
} else {
- in = (7*(i&15))&15;
- rot = (i&3)+1;
- rot = (5*rot)+(((rot+2)&2)>>1);
- temp = x[(a+2)&3] ^ (x[(a+1)&3] | ~x[(a+3)&3]);
+ in = (7*i)&15;
+ temp = x[2] ^ (x[1] | ~x[3]);
}
- temp += x[a] + b[in] + md5table[i];
- x[a] = x[(a+1)&3] + ((temp<<rot) | (temp>>(32-rot)));
+ temp += x[0] + b[in] + md5table[i];
+ swap = x[3];
+ x[3] = x[2];
+ x[2] = x[1];
+ x[1] += rol(temp, md5rot[i]);
+ x[0] = swap;
}
for (i=0; i<4; i++) TT.state[i] += x[i];
}
@@ -165,7 +168,6 @@ static void md5_transform(void)
// Mix next 64 bytes of data into sha1 hash.
static const unsigned rconsts[]={0x5A827999,0x6ED9EBA1,0x8F1BBCDC,0xCA62C1D6};
-#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
static void sha1_transform(void)
{
diff --git a/toys/lsb/mktemp.c b/toys/lsb/mktemp.c
index 0986b4fd..22c880fa 100644
--- a/toys/lsb/mktemp.c
+++ b/toys/lsb/mktemp.c
@@ -4,7 +4,7 @@
*
* http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/mktemp.html
-USE_MKTEMP(NEWTOY(mktemp, ">1(tmpdir);:uqd(directory)p:t", TOYFLAG_BIN))
+USE_MKTEMP(NEWTOY(mktemp, ">1uqd(directory)p(tmpdir):t", TOYFLAG_BIN))
config MKTEMP
bool "mktemp"
@@ -28,20 +28,14 @@ config MKTEMP
#include "toys.h"
GLOBALS(
- char *p, *tmpdir;
+ char *p;
)
void mktemp_main(void)
{
- char *template = *toys.optargs, *dir, *te = getenv("TMPDIR");
+ char *template = *toys.optargs, *dir = TT.p, *te = getenv("TMPDIR");
int len;
- // --tmpdir's argument is optional's but -p is mandatory, so can't combine
- if (!TT.p && FLAG(tmpdir)) {
- TT.p = TT.tmpdir ? TT.tmpdir : "";
- toys.optflags |= FLAG_p;
- }
- dir = TT.p;
// if template, no prefix unless -pt. if !template, always prefix
if (!dir || !*dir || (FLAG(t) && te && *te)) dir = te;
if (!dir || !*dir) dir = "/tmp";
@@ -58,7 +52,7 @@ void mktemp_main(void)
// In theory you just xputs(mktemp(template)) for -u, in practice there's
// link-time deprecation warnings if you do that. So we fake up our own:
- if (FLAG(u)) {
+ if (toys.optflags & FLAG_u) {
long long rr;
char *s = template+len;
@@ -78,12 +72,12 @@ void mktemp_main(void)
if (*s>'Z') (*s) += 6;
rr>>=6;
}
- } else if (FLAG(d) ? !mkdtemp(template) : mkstemp(template) == -1) {
- if (FLAG(q)) {
+ } else if ((toys.optflags & FLAG_d) ? !mkdtemp(template) : mkstemp(template) == -1) {
+ if (toys.optflags & FLAG_q) {
toys.exitval = 1;
return;
- } else perror_exit("Failed to create %s %s",
- FLAG(d) ? "directory" : "file", template);
+ } else perror_exit("Failed to create %s %s/%s",
+ (toys.optflags & FLAG_d) ? "directory" : "file", TT.p, template);
}
xputs(template);
diff --git a/toys/lsb/pidof.c b/toys/lsb/pidof.c
index cd705a7c..4f266b84 100644
--- a/toys/lsb/pidof.c
+++ b/toys/lsb/pidof.c
@@ -5,7 +5,7 @@
*
* http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/pidof.html
-USE_PIDOF(NEWTOY(pidof, "<1so:x", TOYFLAG_BIN))
+USE_PIDOF(NEWTOY(pidof, "<1so:", TOYFLAG_BIN))
config PIDOF
bool "pidof"
@@ -17,7 +17,6 @@ config PIDOF
-s Single shot, only return one pid
-o Omit PID(s)
- -x Match shell scripts too
*/
#define FOR_pidof
@@ -40,6 +39,6 @@ static int print_pid(pid_t pid, char *name)
void pidof_main(void)
{
toys.exitval = 1;
- names_to_pid(toys.optargs, print_pid, FLAG(x));
+ names_to_pid(toys.optargs, print_pid);
if (!toys.exitval) xputc('\n');
}
diff --git a/toys/net/ftpget.c b/toys/net/ftpget.c
index 27ea6db6..ad3c3030 100644
--- a/toys/net/ftpget.c
+++ b/toys/net/ftpget.c
@@ -105,7 +105,7 @@ void ftpget_main(void)
if (!remote) remote = toys.optargs[1];
// connect
- TT.fd = xconnectany(xgetaddrinfo(*toys.optargs, TT.p, 0, SOCK_STREAM, 0,
+ TT.fd = xconnect(xgetaddrinfo(*toys.optargs, TT.p, 0, SOCK_STREAM, 0,
AI_ADDRCONFIG));
if (getpeername(TT.fd, (void *)&si6, &sl)) perror_exit("getpeername");
@@ -147,7 +147,7 @@ void ftpget_main(void)
if (!s || port<1 || port>65535) error_exit_raw(toybuf);
si6.sin6_port = SWAP_BE16(port); // same field size/offset for v4 and v6
port = xsocket(si6.sin6_family, SOCK_STREAM, 0);
- xconnect(port, (void *)&si6, sizeof(si6));
+ if (connect(port, (void *)&si6, sizeof(si6))) perror_exit("connect");
// RETR blocks until file data read from data port, so use SIZE to check
// if file exists before creating local copy
@@ -166,7 +166,7 @@ void ftpget_main(void)
lenl = fdlength(ii);
}
if (get) {
- cmd = "RETR";
+ cmd = "REST";
if (toys.optflags&FLAG_l) cmd = "LIST";
if (toys.optflags&FLAG_L) cmd = "NLST";
if (cnt) {
diff --git a/toys/net/ifconfig.c b/toys/net/ifconfig.c
index f8f1277e..dbe66d39 100644
--- a/toys/net/ifconfig.c
+++ b/toys/net/ifconfig.c
@@ -133,9 +133,8 @@ static void display_ifconfig(char *name, int always, unsigned long long val[])
printf("%*c", 29-len, ' ');
}
- // Query hardware type and hardware address.
- // Not xioctl because you don't have permission for this on Android.
- ioctl(TT.sockfd, SIOCGIFHWADDR, &ifre);
+ // query hardware type and hardware address
+ xioctl(TT.sockfd, SIOCGIFHWADDR, &ifre);
if (toys.optflags&FLAG_S)
for (i=0; i<6; i++) printf(":%02x"+!i, ifre.ifr_hwaddr.sa_data[i]);
diff --git a/toys/net/netcat.c b/toys/net/netcat.c
index 1729bd50..833d32ae 100644
--- a/toys/net/netcat.c
+++ b/toys/net/netcat.c
@@ -7,13 +7,13 @@
* netcat -L zombies
USE_NETCAT(OLDTOY(nc, netcat, TOYFLAG_USR|TOYFLAG_BIN))
-USE_NETCAT(NEWTOY(netcat, USE_NETCAT_LISTEN("^tlL")"w#<1W#<1p#<1>65535q#<1s:f:46uU"USE_NETCAT_LISTEN("[!tlL][!Lw]")"[!46U]", TOYFLAG_BIN))
+USE_NETCAT(NEWTOY(netcat, USE_NETCAT_LISTEN("^tlL")"w#<1W#<1p#<1>65535q#<1s:f:46u"USE_NETCAT_LISTEN("[!tlL][!Lw]")"[!46]", TOYFLAG_BIN))
config NETCAT
bool "netcat"
default y
help
- usage: netcat [-46U] [-u] [-wpq #] [-s addr] {IPADDR PORTNUM|-f FILENAME}
+ usage: netcat [-46] [-u] [-wpq #] [-s addr] {IPADDR PORTNUM|-f FILENAME}
Forward stdin/stdout to a file or network connection.
@@ -24,7 +24,6 @@ config NETCAT
-q Quit SECONDS after EOF on stdin, even if stdout hasn't closed yet
-s Local source address
-u Use UDP
- -U Use a UNIX domain socket
-w SECONDS timeout to establish connection
-W SECONDS timeout for more data on an idle connection
@@ -71,30 +70,10 @@ static void set_alarm(int seconds)
alarm(seconds);
}
-// open AF_UNIX socket
-static int usock(char *name, int type, int out)
-{
- int sockfd;
- struct sockaddr_un sockaddr;
-
- memset(&sockaddr, 0, sizeof(struct sockaddr_un));
-
- if (strlen(name) + 1 > sizeof(sockaddr.sun_path))
- error_exit("socket path too long %s", name);
- strcpy(sockaddr.sun_path, name);
- sockaddr.sun_family = AF_UNIX;
-
- sockfd = xsocket(AF_UNIX, type, 0);
- (out?xconnect:xbind)(sockfd, (struct sockaddr*)&sockaddr, sizeof(sockaddr));
-
- return sockfd;
-}
-
-
void netcat_main(void)
{
- int sockfd = -1, in1 = 0, in2 = 0, out1 = 1, out2 = 1, family = AF_UNSPEC,
- ll = FLAG(L)|FLAG(l), type = FLAG(u) ? SOCK_DGRAM : SOCK_STREAM;
+ int sockfd = -1, in1 = 0, in2 = 0, out1 = 1, out2 = 1;
+ int family = AF_UNSPEC, type = SOCK_STREAM;
pid_t child;
// Addjust idle and quit_delay to ms or -1 for no timeout
@@ -105,39 +84,39 @@ void netcat_main(void)
// The argument parsing logic can't make "<2" conditional on other
// arguments like -f and -l, so do it by hand here.
- if (FLAG(f) ? toys.optc : (!ll && toys.optc!=(FLAG(U)?1:2)))
- help_exit("bad argument count");
+ if ((toys.optflags&FLAG_f) ? toys.optc :
+ (!(toys.optflags&(FLAG_l|FLAG_L)) && toys.optc!=2))
+ help_exit("bad argument count");
- if (FLAG(4)) family = AF_INET;
- else if (FLAG(6)) family = AF_INET6;
- else if (FLAG(U)) family = AF_UNIX;
+ if (toys.optflags&FLAG_4) family = AF_INET;
+ else if (toys.optflags&FLAG_6) family = AF_INET6;
+
+ if (toys.optflags&FLAG_u) type = SOCK_DGRAM;
if (TT.f) in1 = out2 = xopen(TT.f, O_RDWR);
else {
// Setup socket
- if (!ll) {
- if (FLAG(U)) sockfd = usock(toys.optargs[0], type, 1);
- else sockfd = xconnectany(xgetaddrinfo(toys.optargs[0], toys.optargs[1],
- family, type, 0, 0));
+ if (!(toys.optflags&(FLAG_L|FLAG_l))) {
+ struct addrinfo *addr = xgetaddrinfo(toys.optargs[0], toys.optargs[1],
+ family, type, 0, 0);
+ sockfd = xconnect(addr);
- // We have a connection. Disarm timeout and start poll/send loop.
+ // We have a connection. Disarm timeout.
set_alarm(0);
+
in1 = out2 = sockfd;
+
pollinate(in1, in2, out1, out2, TT.W, TT.q);
} else {
// Listen for incoming connections
- if (FLAG(U)) {
- if (!FLAG(s)) error_exit("-s must be provided if using -U with -L/-l");
- sockfd = usock(TT.s, type, 0);
- } else {
- sprintf(toybuf, "%ld", TT.p);
- sockfd = xbindany(xgetaddrinfo(TT.s, toybuf, family, type, 0, 0));
- }
+ struct sockaddr* address = (void*)toybuf;
+ socklen_t len = sizeof(struct sockaddr_storage);
+
+ sprintf(toybuf, "%ld", TT.p);
+ sockfd = xbind(xgetaddrinfo(TT.s, toybuf, family, type, 0, 0));
if (listen(sockfd, 5)) error_exit("listen");
- if (!TT.p && !FLAG(U)) {
- struct sockaddr* address = (void*)toybuf;
- socklen_t len = sizeof(struct sockaddr_storage);
+ if (!TT.p) {
short port_be;
getsockname(sockfd, address, &len);
@@ -145,9 +124,11 @@ void netcat_main(void)
port_be = ((struct sockaddr_in*)address)->sin_port;
else if (address->sa_family == AF_INET6)
port_be = ((struct sockaddr_in6*)address)->sin6_port;
- else perror_exit("getsockname: bad family");
+ else
+ perror_exit("getsockname: bad family");
- dprintf(1, "%d\n", SWAP_BE16(port_be));
+ printf("%d\n", SWAP_BE16(port_be));
+ fflush(stdout);
// Return immediately if no -p and -Ll has arguments, so wrapper
// script can use port number.
if (CFG_TOYBOX_FORK && toys.optc && xfork()) goto cleanup;
@@ -155,7 +136,7 @@ void netcat_main(void)
do {
child = 0;
- in1 = out2 = accept(sockfd, 0, 0);
+ in1 = out2 = accept(sockfd, (struct sockaddr *)address, &len);
if (in1<0) perror_exit("accept");
// We have a connection. Disarm timeout.
@@ -171,23 +152,21 @@ void netcat_main(void)
// Do we need to fork and/or redirect for exec?
-// TODO xpopen_both() here?
-
- if (FLAG(L)) NOEXIT(child = XVFORK());
+ if (toys.optflags&FLAG_L) NOEXIT(child = XVFORK());
if (child) {
close(in1);
continue;
}
dup2(in1, 0);
dup2(in1, 1);
- if (FLAG(L)) dup2(in1, 2);
+ if (toys.optflags&FLAG_L) dup2(in1, 2);
if (in1>2) close(in1);
xexec(toys.optargs);
}
pollinate(in1, in2, out1, out2, TT.W, TT.q);
close(in1);
- } while (!FLAG(l));
+ } while (!(toys.optflags&FLAG_l));
}
}
diff --git a/toys/net/ping.c b/toys/net/ping.c
index 9ae7c856..81dca99f 100644
--- a/toys/net/ping.c
+++ b/toys/net/ping.c
@@ -155,7 +155,7 @@ void ping_main(void)
}
xexit();
}
- if (TT.I) xbind(TT.sock, sa, sizeof(srcaddr));
+ if (TT.I && bind(TT.sock, sa, sizeof(srcaddr))) perror_exit("bind");
if (toys.optflags&FLAG_m) {
int mark = TT.m;
diff --git a/toys/net/sntp.c b/toys/net/sntp.c
index b58abc10..b1ecb1be 100644
--- a/toys/net/sntp.c
+++ b/toys/net/sntp.c
@@ -6,13 +6,13 @@
modes: oneshot display, oneshot set, persist, serve, multi
-USE_SNTP(NEWTOY(sntp, ">1M :m :Sp:t#<0=1>16asdDqr#<4>17=10[!as]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_SNTP(NEWTOY(sntp, "M:m:Sp:asdDqr#<4>17=10[!as]", TOYFLAG_USR|TOYFLAG_BIN))
config SNTP
bool "sntp"
default y
help
- usage: sntp [-saSdDq] [-r SHIFT] [-mM[ADDRESS]] [-p PORT] [SERVER]
+ usage: sntp [-saSdDqm] [-r SHIFT] [-m ADDRESS] [-p PORT] [SERVER]
Simple Network Time Protocol client. Query SERVER and display time.
@@ -20,9 +20,8 @@ config SNTP
-s Set system clock suddenly
-a Adjust system clock gradually
-S Serve time instead of querying (bind to SERVER address if specified)
- -m Wait for updates from multicast ADDRESS (RFC 4330 default 224.0.1.1)
- -M Multicast server on ADDRESS (deault 224.0.0.1)
- -t TTL (multicast only, default 1)
+ -m Wait for updates from multicast ADDRESS (RFC 4330 says use 224.0.1.1)
+ -M Multicast server on ADDRESS
-d Daemonize (run in background re-querying )
-D Daemonize but stay in foreground: re-query time every 1000 seconds
-r Retry shift (every 1<<SHIFT seconds)
@@ -31,10 +30,9 @@ config SNTP
#define FOR_sntp
#include "toys.h"
-#include <sys/timex.h>
GLOBALS(
- long r, t;
+ long r;
char *p, *m, *M;
)
@@ -78,9 +76,8 @@ void sntp_main(void)
union socksaddr sa;
int fd, tries = 0;
- if (FLAG(M)) toys.optflags |= FLAG_S;
if (!(FLAG(S)||FLAG(m)) && !*toys.optargs)
- error_exit("Need -SMm or SERVER address");
+ error_exit("Need -Sm or SERVER address");
// Lookup address and open server or client UDP socket
if (!TT.p || !*TT.p) TT.p = "123";
@@ -90,19 +87,15 @@ void sntp_main(void)
if (FLAG(d) && daemon(0, 0)) perror_exit("daemonize");
// Act as server if necessary
- if (FLAG(S)||FLAG(m)) {
- fd = xbindany(ai);
- if (TT.m || TT.M) {
+ if (FLAG(S)|FLAG(m)) {
+ fd = xbind(ai);
+ if (TT.m) {
struct ip_mreq group;
- int t = 0;
// subscribe to multicast group
memset(&group, 0, sizeof(group));
- group.imr_multiaddr.s_addr = inet_addr(TT.m ? TT.m : TT.M);
+ group.imr_multiaddr.s_addr = inet_addr(TT.m);
xsetsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &group, sizeof(group));
- xsetsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, &t, 4);
- t = TT.t;
- xsetsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &t, 4);
}
} else fd = xsocket(ai->ai_family, SOCK_DGRAM, IPPROTO_UDP);
@@ -114,13 +107,13 @@ void sntp_main(void)
for (;;) {
now = millitime();
- // If we're in server or multicast client mode, don't poll
+ // Figure out if we're in server and multicast modes don't poll
if (FLAG(m) || FLAG(S)) then = -1;
// daemon and oneshot modes send a packet each time through outer loop
else {
then = now + 3000;
- if (FLAG(d)||FLAG(D)||FLAG(M)) then = now + (1<<TT.r)*1000;
+ if (FLAG(d) || FLAG(D)) then = now + (1<<TT.r)*1000;
// Send NTP query packet
memset(toybuf, 0, 48);
@@ -181,7 +174,7 @@ void sntp_main(void)
// First packet: figure out how far off our clock is from what server
// said and try again. Don't set clock, just record offset to use
- // generating second request. (We know this time is in the past
+ // generating second reuest. (We know this time is in the past
// because transmission took time, but it's a start. And if time is
// miraculously exact, don't loop.)
@@ -191,7 +184,7 @@ void sntp_main(void)
// Second packet: determine midpoint of packet transit time according
// to local clock, assuming each direction took same time so midpoint
- // is time server reported. The first tv was the adjusted time
+ // is time server reported. The first television was the adjusted time
// we sent the packet at, tv2 is what server replied, so now diff
// is round trip time.
@@ -207,14 +200,15 @@ void sntp_main(void)
if (clock_settime(CLOCK_REALTIME, &tv2))
perror_exit("clock_settime");
} else if (FLAG(a)) {
- struct timex tx;
+ struct timeval why;
- // call adjtimex() to move the clock gradually
+ // call adjtime() to move the clock gradually, copying nanoseconds
+ // into gratuitous microseconds structure for sad historical reasons
+ memset(&tv2, 0, sizeof(tv2));
nanomove(&tv2, diff);
- memset(&tx, 0, sizeof(struct timex));
- tx.offset = tv2.tv_sec*1000000+tv2.tv_nsec/1000;
- tx.modes = ADJ_OFFSET_SINGLESHOT;
- if (adjtimex(&tx) == -1) perror_exit("adjtime");
+ why.tv_sec = tv2.tv_sec;
+ why.tv_usec = tv2.tv_nsec/1000;
+ if (adjtime(&why, 0)) perror_exit("adjtime");
}
// Display the time and offset
diff --git a/toys/other/blkid.c b/toys/other/blkid.c
index 40391de4..38559981 100644
--- a/toys/other/blkid.c
+++ b/toys/other/blkid.c
@@ -3,22 +3,20 @@
* Copyright 2013 Brad Conroy <bconroy@uis.edu>
*
* See ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.24/libblkid-docs/api-index-full.html
- * TODO: -U and -L should require arguments
-USE_BLKID(NEWTOY(blkid, "ULs*[!LU]", TOYFLAG_BIN))
+USE_BLKID(NEWTOY(blkid, "UL[!LU]", TOYFLAG_BIN))
USE_FSTYPE(NEWTOY(fstype, "<1", TOYFLAG_BIN))
config BLKID
bool "blkid"
default y
help
- usage: blkid [-s TAG] [-UL] DEV...
+ usage: blkid [-UL] DEV...
Print type, label and UUID of filesystem on a block device or image.
-U Show UUID only (or device with that UUID)
-L Show LABEL only (or device with that LABEL)
- -s TAG Only show matching tags (default all)
config FSTYPE
bool "fstype"
@@ -32,10 +30,6 @@ config FSTYPE
#define FOR_blkid
#include "toys.h"
-GLOBALS(
- struct arg_list *s;
-)
-
struct fstype {
char *name;
uint64_t magic;
@@ -45,13 +39,13 @@ struct fstype {
{"swap", 0x4341505350415753LL, 8, 4086, 1036, 15, 1052},
// NTFS label actually 8/16 0x4d80 but horrible: 16 bit wide characters via
// codepage, something called a uuid that's only 8 bytes long...
- {"ntfs", 0x5346544e, 4, 3, 0x48, 0, 0},
+ {"ntfs", 0x5346544e, 4, 3, 0x48+(8<<24), 0, 0},
{"adfs", 0xadf5, 2, 0xc00, 0,0,0},
{"bfs", 0x1badface, 4, 0, 0,0,0},
{"btrfs", 0x4D5F53665248425FULL, 8, 65600, 65803, 256, 65819},
{"cramfs", 0x28cd3d45, 4, 0, 0, 16, 48},
- {"f2fs", 0xF2F52010, 4, 1024, 1132, 512, 0x47c},
+ {"f2fs", 0xF2F52010, 4, 1024, 1132, 16, 1110},
{"jfs", 0x3153464a, 4, 32768, 32920, 16, 32904},
{"nilfs", 0x3434, 2, 1030, 1176, 80, 1192},
{"reiserfs", 0x724573496552ULL, 6, 8244, 8276, 16, 8292},
@@ -60,22 +54,10 @@ struct fstype {
{"squashfs", 0x73717368, 4, 0, 0,0,0},
{"xiafs", 0x012fd16d, 4, 572, 0,0,0},
{"xfs", 0x42534658, 4, 0, 32, 12, 108},
- {"vfat", 0x3233544146ULL, 5, 82, 67, 11, 71}, // fat32
- {"vfat", 0x31544146, 4, 54, 39, 11, 43} // fat1
+ {"vfat", 0x3233544146ULL, 5, 82, 67+(4<<24), 11, 71}, // fat32
+ {"vfat", 0x31544146, 4, 54, 39+(4<<24), 11, 43} // fat1
};
-static void show_tag(char *key, char *value)
-{
- int show = 0;
- struct arg_list *al;
-
- if (TT.s) {
- for (al = TT.s; al; al = al->next) if (!strcmp(key, al->arg)) show = 1;
- } else show = 1;
-
- if (show) printf(" %s=\"%s\"", key, value);
-}
-
static void flagshow(char *s, char *name)
{
if (*toys.optargs && strcmp(s, *toys.optargs)) return;
@@ -130,6 +112,8 @@ static void do_blkid(int fd, char *name)
if (toybuf[1120]&64) type = "ext4";
}
+ // Could special case NTFS here...
+
// Output for fstype
if (*toys.which->name == 'f') {
puts(type);
@@ -137,59 +121,39 @@ static void do_blkid(int fd, char *name)
}
// output for blkid
- if (!FLAG(L) && !FLAG(U)) printf("%s:",name);
+ if (!toys.optflags) printf("%s:",name);
len = fstypes[i].label_len;
if (!FLAG(U) && len) {
s = toybuf+fstypes[i].label_off-off;
if (!strcmp(type, "vfat")) {
- show_tag("SEC_TYPE", "msdos");
while (len && s[len-1]==' ') len--;
if (strstart(&s, "NO NAME")) len=0;
}
- // TODO: special case NTFS $VOLUME_NAME here...
- if (len) {
- if (!strcmp(type, "f2fs")) {
- // Convert UTF16LE to ASCII by replacing non-ASCII with '?'.
- // TODO: support non-ASCII.
- for (j=0; j<len; j++) {
- buf[j] = s[2*j];
- if (s[2*j+1]) buf[j]='?';
- if (!buf[j]) break;
- }
- } else sprintf(buf, "%.*s", len, s);
+ if (len && *s) {
+ sprintf(buf, "%.*s", len, s);
if (FLAG(L)) return flagshow(buf, name);
- show_tag("LABEL", buf);
+ printf(" LABEL=\"%s\"", buf);
}
}
len = fstypes[i].uuid_off;
if (!FLAG(L) && len) {
- int uoff = len-off;
+ int bits = 0x550, size = len >> 24, uoff = (len&((1<<24)-1))-off;
// Assemble UUID with whatever size and set of dashes this filesystem uses
- s = buf;
- if (!strcmp(type, "ntfs")) {
- for (j = 7; j >= 0; --j) s += sprintf(s, "%02X", toybuf[uoff+j]);
- } else if (!strcmp(type, "vfat")) {
- s += sprintf(s, "%02X%02X-%02X%02X", toybuf[uoff+3], toybuf[uoff+2],
- toybuf[uoff+1], toybuf[uoff]);
- } else {
- for (j = 0; j < 16; j++)
- s += sprintf(s, "-%02x"+!(0x550 & (1<<j)), toybuf[uoff+j]);
- }
+ if (size) bits = 4*(size == 4);
+ else size = 16;
+ for (j = 0, s = buf; j < size; j++)
+ s += sprintf(s, "-%02x"+!(bits & (1<<j)), toybuf[uoff+j]);
if (FLAG(U)) return flagshow(buf, name);
- show_tag("UUID", buf);
+ printf(" UUID=\"%s\"", buf);
}
- if ((!strcmp(type, "ext3")||!strcmp(type,"ext4")) && !(toybuf[1120]&~0x12))
- show_tag("SEC_TYPE", "ext2");
-
- if (FLAG(U) || FLAG(L)) return;
+ if (toys.optflags) return;
- show_tag("TYPE", type);
- xputc('\n');
+ printf(" TYPE=\"%s\"\n", type);
}
void blkid_main(void)
diff --git a/toys/other/help.c b/toys/other/help.c
index 6ce1b02e..f7d84817 100644
--- a/toys/other/help.c
+++ b/toys/other/help.c
@@ -61,7 +61,7 @@ void help_main(void)
if (toys.optflags & FLAG_h) {
xprintf("<html>\n<title>Toybox command list</title>\n<body>\n<p>\n");
for (i=0; i < toys.toycount; i++)
- xprintf("<a href=\"#%s\">%s\n</a>\n", toy_list[i].name,
+ xprintf("<a href=\"#%s\">%s</a>\n", toy_list[i].name,
toy_list[i].name);
xprintf("</p>\n");
}
@@ -71,7 +71,7 @@ void help_main(void)
else {
memset(toybuf, '-', 78);
memcpy(toybuf+3, toy_list[i].name, strlen(toy_list[i].name));
- printf("\n%s\n\n", toybuf);
+ printf("%s\n\n", toybuf);
}
do_help(toy_list+i);
if (toys.optflags & FLAG_h) xprintf("</pre>\n");
diff --git a/toys/other/hexedit.c b/toys/other/hexedit.c
index 4b628463..06a96a22 100644
--- a/toys/other/hexedit.c
+++ b/toys/other/hexedit.c
@@ -158,8 +158,8 @@ void hexedit_main(void)
} else {
TT.base--;
i++;
+ tty_esc("1T");
tty_jump(0, 0);
- tty_esc("1L");
draw_line(0);
}
}
@@ -170,8 +170,7 @@ void hexedit_main(void)
} else {
TT.base++;
i++;
- tty_jump(0, 0);
- tty_esc("1M");
+ tty_esc("1S");
tty_jump(0, TT.height-1);
draw_line(TT.height-1);
}
@@ -181,7 +180,7 @@ void hexedit_main(void)
// Display cursor and flush output
highlight(x, y, ro ? 3 : side);
- xflush(1);
+ xflush();
// Wait for next key
key = scan_key(keybuf, -1);
diff --git a/toys/other/losetup.c b/toys/other/losetup.c
index 917e64ea..d77a9500 100644
--- a/toys/other/losetup.c
+++ b/toys/other/losetup.c
@@ -4,7 +4,7 @@
*
* No standard. (Sigh.)
-USE_LOSETUP(NEWTOY(losetup, ">2S(sizelimit)#s(show)ro#j:fdcaD[!afj]", TOYFLAG_SBIN))
+USE_LOSETUP(NEWTOY(losetup, ">2S(sizelimit)#s(show)ro#j:fdca[!afj]", TOYFLAG_SBIN))
config LOSETUP
bool "losetup"
@@ -18,18 +18,17 @@ config LOSETUP
Instead of a device:
-a Iterate through all loopback devices
-f Find first unused loop device (may create one)
- -j FILE Iterate through all loopback devices associated with FILE
+ -j Iterate through all loopback devices associated with FILE
existing:
-c Check capacity (file size changed)
- -d DEV Detach loopback device
- -D Detach all loopback devices
+ -d Detach loopback device
new:
-s Show device name (alias --show)
- -o OFF Start association at offset OFF into FILE
+ -o Start association at OFFSET into FILE
-r Read only
- -S SIZE Limit SIZE of loopback association (alias --sizelimit)
+ -S Limit SIZE of loopback association (alias --sizelimit)
*/
#define FOR_losetup
@@ -43,17 +42,16 @@ GLOBALS(
int openflags;
dev_t jdev;
ino_t jino;
- char *dir;
)
// -f: *device is NULL
// Perform requested operation on one device. Returns 1 if handled, 0 if error
-static int loopback_setup(char *device, char *file)
+static void loopback_setup(char *device, char *file)
{
struct loop_info64 *loop = (void *)(toybuf+32);
int lfd = -1, ffd = ffd;
- int racy = !device;
+ unsigned flags = toys.optflags;
// Open file (ffd) and loop device (lfd)
@@ -66,8 +64,10 @@ static int loopback_setup(char *device, char *file)
// mount -o loop depends on found device being at the start of toybuf.
if (cfd != -1) {
- if (0 <= (i = ioctl(cfd, LOOP_CTL_GET_FREE))) {
- sprintf(device = toybuf, "%s/loop%d", TT.dir, i);
+ if (0 <= (i = ioctl(cfd, 0x4C82))) { // LOOP_CTL_GET_FREE
+ sprintf(device = toybuf, "/dev/loop%d", i);
+ // Fallback for Android
+ if (access(toybuf, F_OK)) sprintf(toybuf, "/dev/block/loop%d", i);
}
close(cfd);
}
@@ -78,12 +78,7 @@ static int loopback_setup(char *device, char *file)
// Stat the loop device to see if there's a current association.
memset(loop, 0, sizeof(struct loop_info64));
if (-1 == lfd || ioctl(lfd, LOOP_GET_STATUS64, loop)) {
- if (errno == ENXIO && (FLAG(a) || FLAG(j))) goto done;
- // ENXIO expected if we're just trying to print the first unused device.
- if (errno == ENXIO && FLAG(f) && !file) {
- puts(device);
- goto done;
- }
+ if (errno == ENXIO && (flags & (FLAG_a|FLAG_j))) goto done;
if (errno != ENXIO || !file) {
perror_msg_raw(device ? device : "-f");
goto done;
@@ -95,9 +90,9 @@ static int loopback_setup(char *device, char *file)
goto done;
// Check size of file or delete existing association
- if (FLAG(c) || FLAG(d)) {
+ if (flags & (FLAG_c|FLAG_d)) {
// The constant is LOOP_SET_CAPACITY
- if (ioctl(lfd, FLAG(c) ? 0x4C07 : LOOP_CLR_FD, 0)) {
+ if (ioctl(lfd, (flags & FLAG_c) ? 0x4C07 : LOOP_CLR_FD, 0)) {
perror_msg_raw(device);
goto done;
}
@@ -106,19 +101,17 @@ static int loopback_setup(char *device, char *file)
char *s = xabspath(file, 1);
if (!s) perror_exit("file"); // already opened, but if deleted since...
- if (ioctl(lfd, LOOP_SET_FD, ffd)) {
- if (racy && errno == EBUSY) return 1;
- perror_exit("%s=%s", device, file);
- }
+ if (ioctl(lfd, LOOP_SET_FD, ffd)) perror_exit("%s=%s", device, file);
loop->lo_offset = TT.o;
loop->lo_sizelimit = TT.S;
xstrncpy((char *)loop->lo_file_name, s, LO_NAME_SIZE);
+ s[LO_NAME_SIZE-1] = 0;
if (ioctl(lfd, LOOP_SET_STATUS64, loop)) perror_exit("%s=%s", device, file);
- if (FLAG(s)) puts(device);
+ if (flags & FLAG_s) printf("%s", device);
free(s);
- }
+ } else if (flags & FLAG_f) printf("%s", device);
else {
- xprintf("%s: [%lld]:%llu (%s)", device, (long long)loop->lo_device,
+ xprintf("%s: [%04llx]:%llu (%s)", device, (long long)loop->lo_device,
(long long)loop->lo_inode, loop->lo_file_name);
if (loop->lo_offset) xprintf(", offset %llu",
(unsigned long long)loop->lo_offset);
@@ -130,7 +123,6 @@ static int loopback_setup(char *device, char *file)
done:
if (file) close(ffd);
if (lfd != -1) close(lfd);
- return 0;
}
// Perform an action on all currently existing loop devices
@@ -153,8 +145,7 @@ void losetup_main(void)
{
char **s;
- TT.dir = CFG_TOYBOX_ON_ANDROID ? "/dev/block" : "/dev";
- TT.openflags = FLAG(r) ? O_RDONLY : O_RDWR;
+ TT.openflags = (toys.optflags & FLAG_r) ? O_RDONLY : O_RDWR;
if (TT.j) {
struct stat st;
@@ -173,19 +164,17 @@ void losetup_main(void)
// -f(dc FILE)
- if (FLAG(D)) toys.optflags |= FLAG_a | FLAG_d;
-
- if (FLAG(f)) {
+ if (toys.optflags & FLAG_f) {
if (toys.optc > 1) perror_exit("max 1 arg");
- while (loopback_setup(NULL, *toys.optargs));
- } else if (FLAG(a) || FLAG(j)) {
+ loopback_setup(NULL, *toys.optargs);
+ } else if (toys.optflags & (FLAG_a|FLAG_j)) {
if (toys.optc) error_exit("bad args");
- dirtree_read(TT.dir, dash_a);
+ dirtree_read("/dev", dash_a);
// Do we need one DEVICE argument?
} else {
- char *file = (FLAG(c) || FLAG(d)) ? NULL : toys.optargs[1];
+ char *file = (toys.optflags & (FLAG_d|FLAG_c)) ? NULL : toys.optargs[1];
- if (!toys.optc || (file && toys.optc != 2))
+ if (!toys.optc || (file && toys.optc != 2))
help_exit("needs %d arg%s", 1+!!file, file ? "s" : "");
for (s = toys.optargs; *s; s++) {
loopback_setup(*s, file);
diff --git a/toys/other/lsattr.c b/toys/other/lsattr.c
index 5a102011..ec7d88e5 100644
--- a/toys/other/lsattr.c
+++ b/toys/other/lsattr.c
@@ -288,13 +288,15 @@ static int update_attr(struct dirtree *root)
if (ext2_setflag(fd, &(root->st), fval) < 0)
perror_msg("setting flags '%s'", fpath);
}
- // set file version
- if (chattr.vflag && (ioctl(fd, FS_IOC_SETVERSION, &chattr.version)<0))
- perror_msg("while setting version on '%s'", fpath);
+ if (chattr.vflag) { // set file version
+ if (ioctl(fd, FS_IOC_SETVERSION, (void*)&chattr.version) < 0)
+ perror_msg("while setting version on '%s'", fpath);
+ }
free(fpath);
xclose(fd);
- return (S_ISDIR(root->st.st_mode) && chattr.recursive) ? DIRTREE_RECURSE : 0;
+ if (S_ISDIR(root->st.st_mode) && chattr.recursive) return DIRTREE_RECURSE;
+ return 0;
}
void chattr_main(void)
diff --git a/toys/other/makedevs.c b/toys/other/makedevs.c
index a6998fcc..fa2b72d8 100644
--- a/toys/other/makedevs.c
+++ b/toys/other/makedevs.c
@@ -17,7 +17,7 @@ config MAKEDEVS
-d File containing device table (default reads from stdin)
- Each line of the device table has the fields:
+ Each line of of the device table has the fields:
<name> <type> <mode> <uid> <gid> <major> <minor> <start> <increment> <count>
Where name is the file name, and type is one of the following:
@@ -36,7 +36,7 @@ config MAKEDEVS
#include "toys.h"
GLOBALS(
- char *d;
+ char *fname;
)
void makedevs_main()
@@ -46,9 +46,9 @@ void makedevs_main()
// Open file and chdir, verbosely
xprintf("rootdir = %s\n", *toys.optargs);
- if ((toys.optflags & FLAG_d) && strcmp(TT.d, "-")) {
- fd = xopenro(TT.d);
- xprintf("table = %s\n", TT.d);
+ if (toys.optflags & FLAG_d && strcmp(TT.fname, "-")) {
+ fd = xopenro(TT.fname);
+ xprintf("table = %s\n", TT.fname);
} else xprintf("table = <stdin>\n");
xchdir(*toys.optargs);
diff --git a/toys/other/modinfo.c b/toys/other/modinfo.c
index 286570f1..eaf6cb98 100644
--- a/toys/other/modinfo.c
+++ b/toys/other/modinfo.c
@@ -10,14 +10,10 @@ config MODINFO
bool "modinfo"
default y
help
- usage: modinfo [-0] [-b basedir] [-k kernel] [-F field] [module|file...]
+ usage: modinfo [-0] [-b basedir] [-k kernrelease] [-F field] [modulename...]
- Display module fields for modules specified by name or .ko path.
-
- -F Only show the given field
- -0 Separate fields with NUL rather than newline
- -b Use <basedir> as root for /lib/modules/
- -k Look in given directory under /lib/modules/
+ Display module fields for all specified modules, looking in
+ <basedir>/lib/modules/<kernrelease>/ (kernrelease defaults to uname -r).
*/
#define FOR_modinfo
@@ -27,7 +23,6 @@ GLOBALS(
char *F, *k, *b;
long mod;
- int count;
)
static void output_field(char *field, char *value)
@@ -35,7 +30,7 @@ static void output_field(char *field, char *value)
if (!TT.F) xprintf("%s:%*c", field, 15-(int)strlen(field), ' ');
else if (strcmp(TT.F, field)) return;
xprintf("%s", value);
- xputc(FLAG(0) ? 0 : '\n');
+ xputc((toys.optflags & FLAG_0) ? 0 : '\n');
}
static void modinfo_file(char *full_name)
@@ -58,7 +53,6 @@ static void modinfo_file(char *full_name)
return;
}
- TT.count++;
output_field("filename", full_name);
for (pos = buf; pos < buf+len; pos++) {
@@ -106,30 +100,19 @@ static int check_module(struct dirtree *new)
void modinfo_main(void)
{
- struct utsname uts;
-
- // Android (as shipped by Google) currently only has modules on /vendor.
- // Android does not support multiple sets of modules for different kernels.
- if (CFG_TOYBOX_ON_ANDROID) {
- if (!TT.b) TT.b = "/vendor";
- if (!TT.k) TT.k = "";
- } else {
- uname(&uts);
- if (!TT.b) TT.b = "";
- if (!TT.k) TT.k = uts.release;
- }
-
- for (TT.mod = 0; TT.mod<toys.optc; TT.mod++) {
+ for(TT.mod = 0; TT.mod<toys.optc; TT.mod++) {
char *s = strstr(toys.optargs[TT.mod], ".ko");
if (s && !s[3]) modinfo_file(toys.optargs[TT.mod]);
else {
- char *path = xmprintf("%s/lib/modules/%s", TT.b, TT.k);
-
- TT.count = 0;
- dirtree_read(path, check_module);
- if (!TT.count) error_msg("%s: not found", toys.optargs[TT.mod]);
- free(path);
+ struct utsname uts;
+
+ if (uname(&uts) < 0) perror_exit("bad uname");
+ if (snprintf(toybuf, sizeof(toybuf), "%s/lib/modules/%s",
+ (toys.optflags & FLAG_b) ? TT.b : "",
+ (toys.optflags & FLAG_k) ? TT.k : uts.release) >= sizeof(toybuf))
+ perror_exit("basedir/kernrelease too long");
+ dirtree_read(toybuf, check_module);
}
}
}
diff --git a/toys/other/nbd_client.c b/toys/other/nbd_client.c
index ad3440af..fcd0fca8 100644
--- a/toys/other/nbd_client.c
+++ b/toys/other/nbd_client.c
@@ -52,7 +52,7 @@ void nbd_client_main(void)
// Find and connect to server
- sock = xconnectany(xgetaddrinfo(host, port, AF_UNSPEC, SOCK_STREAM, 0, 0));
+ sock = xconnect(xgetaddrinfo(host, port, AF_UNSPEC, SOCK_STREAM, 0, 0));
temp = 1;
setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &temp, sizeof(int));
diff --git a/toys/other/printenv.c b/toys/other/printenv.c
index 431bf1de..65f62edf 100644
--- a/toys/other/printenv.c
+++ b/toys/other/printenv.c
@@ -17,6 +17,8 @@ config PRINTENV
#include "toys.h"
+extern char **environ;
+
void printenv_main(void)
{
char **env, **var = toys.optargs;
diff --git a/toys/other/readlink.c b/toys/other/readlink.c
index 9ebf68d7..beef92b0 100644
--- a/toys/other/readlink.c
+++ b/toys/other/readlink.c
@@ -2,13 +2,13 @@
*
* Copyright 2007 Rob Landley <rob@landley.net>
-USE_READLINK(NEWTOY(readlink, "<1nqmef(canonicalize)[-mef]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_READLINK(NEWTOY(readlink, "<1>1nqmef(canonicalize)[-mef]", TOYFLAG_USR|TOYFLAG_BIN))
config READLINK
bool "readlink"
default y
help
- usage: readlink FILE...
+ usage: readlink FILE
With no options, show what symlink points to, return error if not symlink.
@@ -26,18 +26,17 @@ config READLINK
void readlink_main(void)
{
- char **arg, *s;
-
- for (arg = toys.optargs; *arg; arg++) {
- // Calculating full canonical path?
- // Take advantage of flag positions to calculate m = -1, f = 0, e = 1
- if (toys.optflags & (FLAG_f|FLAG_e|FLAG_m))
- s = xabspath(*arg, (toys.optflags&(FLAG_f|FLAG_e))-1);
- else s = xreadlink(*arg);
-
- if (s) {
- if (!FLAG(q)) xprintf(FLAG(n) ? "%s" : "%s\n", s);
- if (CFG_TOYBOX_FREE) free(s);
- } else toys.exitval = 1;
- }
+ char *s;
+
+ // Calculating full canonical path?
+ // Take advantage of flag positions to calculate m = -1, f = 0, e = 1
+ if (toys.optflags & (FLAG_f|FLAG_e|FLAG_m))
+ s = xabspath(*toys.optargs, (toys.optflags&(FLAG_f|FLAG_e))-1);
+ else s = xreadlink(*toys.optargs);
+
+ if (s) {
+ if (!(toys.optflags & FLAG_q))
+ xprintf((toys.optflags & FLAG_n) ? "%s" : "%s\n", s);
+ if (CFG_TOYBOX_FREE) free(s);
+ } else toys.exitval = 1;
}
diff --git a/toys/other/rev.c b/toys/other/rev.c
index adfc90da..15066310 100644
--- a/toys/other/rev.c
+++ b/toys/other/rev.c
@@ -15,25 +15,27 @@ config REV
#include "toys.h"
-static void rev_line(char **pline, long len)
+static void do_rev(int fd, char *name)
{
- char *line;
- long i;
+ char *c;
- if (!pline) return;
- line = *pline;
- if (len && line[len-1]=='\n') line[--len] = 0;
+ for (;;) {
+ unsigned len, i;
- if (len--) for (i = 0; i <= len/2; i++) {
- char tmp = line[i];
+ if (!(c = get_line(fd))) break;
+ len = strlen(c);
+ if (len--) for (i = 0; i <= len/2; i++) {
+ char tmp = c[i];
- line[i] = line[len-i];
- line[len-i] = tmp;
+ c[i] = c[len-i];
+ c[len-i] = tmp;
+ }
+ xputs(c);
+ free(c);
}
- xputs(line);
}
void rev_main(void)
{
- loopfiles_lines(toys.optargs, rev_line);
+ loopfiles(toys.optargs, do_rev);
}
diff --git a/toys/other/stat.c b/toys/other/stat.c
index d99331b7..d828534c 100644
--- a/toys/other/stat.c
+++ b/toys/other/stat.c
@@ -20,15 +20,14 @@ config STAT
The valid format escape sequences for files:
%a Access bits (octal) |%A Access bits (flags)|%b Size/512
- %B Bytes per %b (512) |%C Security context |%d Device ID (dec)
- %D Device ID (hex) |%f All mode bits (hex)|%F File type
- %g Group ID |%G Group name |%h Hard links
- %i Inode |%m Mount point |%n Filename
- %N Long filename |%o I/O block size |%s Size (bytes)
- %t Devtype major (hex) |%T Devtype minor (hex)|%u User ID
- %U User name |%x Access time |%X Access unix time
- %y Modification time |%Y Mod unix time |%z Creation time
- %Z Creation unix time
+ %B Bytes per %b (512) |%d Device ID (dec) |%D Device ID (hex)
+ %f All mode bits (hex) |%F File type |%g Group ID
+ %G Group name |%h Hard links |%i Inode
+ %m Mount point |%n Filename |%N Long filename
+ %o I/O block size |%s Size (bytes) |%t Devtype major (hex)
+ %T Devtype minor (hex) |%u User ID |%U User name
+ %x Access time |%X Access unix time |%y Modification time
+ %Y Mod unix time |%z Creation time |%Z Creation unix time
The valid format escape sequences for filesystems:
%a Available blocks |%b Total blocks |%c Total inodes
@@ -83,12 +82,7 @@ static void print_stat(char type)
strout(str);
} else if (type == 'b') out('u', stat->st_blocks);
else if (type == 'B') out('d', 512);
- else if (type == 'C') {
- char *context = NULL;
-
- strout(lsm_get_context(TT.file, &context) != -1 ? context : "?");
- free(context);
- } else if (type == 'd') out('d', stat->st_dev);
+ else if (type == 'd') out('d', stat->st_dev);
else if (type == 'D') out('x', stat->st_dev);
else if (type == 'f') out('x', stat->st_mode);
else if (type == 'F') {
@@ -114,10 +108,10 @@ static void print_stat(char type)
}
llist_traverse(mt, free);
} else if (type == 'N') {
- printf("%s", TT.file);
+ xprintf("%s", TT.file);
if (S_ISLNK(stat->st_mode))
if (readlink0(TT.file, toybuf, sizeof(toybuf)))
- printf(" -> `%s'", toybuf);
+ xprintf(" -> `%s'", toybuf);
} else if (type == 'o') out('u', stat->st_blksize);
else if (type == 's') out('u', stat->st_size);
else if (type == 't') out('x', dev_major(stat->st_rdev));
@@ -130,7 +124,7 @@ static void print_stat(char type)
else if (type == 'Y') out('u', stat->st_mtime);
else if (type == 'z') date_stat_format(&stat->st_ctim);
else if (type == 'Z') out('u', stat->st_ctime);
- else putchar('?');
+ else xprintf("?");
}
static void print_statfs(char type) {
@@ -141,15 +135,8 @@ static void print_statfs(char type) {
else if (type == 'c') out('u', statfs->f_files);
else if (type == 'd') out('u', statfs->f_ffree);
else if (type == 'f') out('u', statfs->f_bfree);
- else if (type == 'l') {
-#ifdef __APPLE__
- // TODO: move this into portability.c somehow, or just use this everywhere?
- // (glibc and bionic will just re-do the statfs and return f_namelen.)
- out('d', pathconf(TT.file, _PC_NAME_MAX));
-#else
- out('d', statfs->f_namelen);
-#endif
- } else if (type == 't') out('x', statfs->f_type);
+ else if (type == 'l') out('d', statfs->f_namelen);
+ else if (type == 't') out('x', statfs->f_type);
else if (type == 'T') {
char *s = "unknown";
struct {unsigned num; char *name;} nn[] = {
@@ -168,10 +155,9 @@ static void print_statfs(char type) {
if (nn[i].num == statfs->f_type) s = nn[i].name;
strout(s);
} else if (type == 'i') {
- int *val = (int *) &statfs->f_fsid;
char buf[32];
- sprintf(buf, "%08x%08x", val[0], val[1]);
+ sprintf(buf, "%08x%08x", statfs->f_fsid.__val[0], statfs->f_fsid.__val[1]);
strout(buf);
} else if (type == 's') out('d', statfs->f_frsize);
else if (type == 'S') out('d', statfs->f_bsize);
@@ -180,43 +166,40 @@ static void print_statfs(char type) {
void stat_main(void)
{
- int flagf = FLAG(f), i;
+ int flagf = toys.optflags & FLAG_f, i;
char *format, *f;
- if (FLAG(t)) format = flagf
- ? "%n %i %l %t %s %S %b %f %a %c %d"
- : "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o";
- else format = flagf
+ if (toys.optflags&FLAG_t) {
+ format = flagf ? "%n %i %l %t %s %S %b %f %a %c %d" :
+ "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o";
+ } else format = flagf
? " File: \"%n\"\n ID: %i Namelen: %l Type: %T\n"
"Block Size: %s Fundamental block size: %S\n"
"Blocks: Total: %b\tFree: %f\tAvailable: %a\n"
"Inodes: Total: %c\tFree: %d"
- : " File: %N\n Size: %s\t Blocks: %b\t IO Blocks: %B\t %F\n"
- "Device: %Dh/%dd\t Inode: %i\t Links: %h\t Device type: %t,%T\n"
- "Access: (%04a/%A)\tUid: (%5u/%8U)\tGid: (%5g/%8G)\n"
+ : " File: %N\n Size: %s\t Blocks: %b\t IO Blocks: %B\t%F\n"
+ "Device: %Dh/%dd\t Inode: %i\t Links: %h\n"
+ "Access: (0%a/%A)\tUid: (%5u/%8U)\tGid: (%5g/%8G)\n"
"Access: %x\nModify: %y\nChange: %z";
- if (FLAG(c)) format = TT.c;
+ if (toys.optflags & FLAG_c) format = TT.c;
- // loop through files listed on command line
for (i = 0; toys.optargs[i]; i++) {
+ int L = toys.optflags & FLAG_L;
- // stat the file or filesystem
TT.file = toys.optargs[i];
if (flagf && !statfs(TT.file, (void *)&TT.stat));
- else if (flagf || (FLAG(L) ? stat : lstat)(TT.file, (void *)&TT.stat)) {
+ else if (flagf || (L ? stat : lstat)(TT.file, (void *)&TT.stat)) {
perror_msg("'%s'", TT.file);
continue;
}
- // parse format and print what it says
for (f = format; *f; f++) {
- if (*f != '%' || !f[1]) putchar(*f);
- else if (f[1]=='%') putchar(*f++);
+ if (*f != '%') putchar(*f);
else {
f = next_printf(f, &TT.pattern);
TT.patlen = f-TT.pattern;
- if (!*f || TT.patlen>99) error_exit("bad %s", TT.pattern);
+ if (TT.patlen>99) error_exit("bad %s", TT.pattern);
if (*f == 'n') strout(TT.file);
else if (flagf) print_statfs(*f);
else print_stat(*f);
diff --git a/toys/other/tac.c b/toys/other/tac.c
index 2a9e003d..d5f72fd2 100644
--- a/toys/other/tac.c
+++ b/toys/other/tac.c
@@ -13,28 +13,37 @@ config TAC
Output lines in reverse order.
*/
-#define FOR_tac
#include "toys.h"
-GLOBALS(
- struct double_list *dl;
-)
-
-static void do_tac(char **pline, long len)
+static void do_tac(int fd, char *name)
{
- if (pline) {
- dlist_add(&TT.dl, *pline);
- *pline = 0;
- } else while (TT.dl) {
- struct double_list *dl = dlist_lpop(&TT.dl);
-
- xprintf("%s", dl->data);
- free(dl->data);
- free(dl);
+ struct arg_list *list = NULL;
+ char *c;
+
+ // Read in lines
+ for (;;) {
+ struct arg_list *temp;
+ long len;
+
+ if (!(c = get_rawline(fd, &len, '\n'))) break;
+
+ temp = xmalloc(sizeof(struct arg_list));
+ temp->next = list;
+ temp->arg = c;
+ list = temp;
+ }
+
+ // Play them back.
+ while (list) {
+ struct arg_list *temp = list->next;
+ xprintf("%s", list->arg);
+ free(list->arg);
+ free(list);
+ list = temp;
}
}
void tac_main(void)
{
- loopfiles_lines(toys.optargs, do_tac);
+ loopfiles(toys.optargs, do_tac);
}
diff --git a/toys/other/timeout.c b/toys/other/timeout.c
index 55b3dca1..dc48f55b 100644
--- a/toys/other/timeout.c
+++ b/toys/other/timeout.c
@@ -42,8 +42,8 @@ static void handler(int i)
if (FLAG(v))
fprintf(stderr, "timeout pid %d signal %d\n", TT.pid, TT.nextsig);
- toys.exitval = (TT.nextsig==9) ? 137 : 124;
kill(TT.pid, TT.nextsig);
+
if (TT.k) {
TT.k = 0;
TT.nextsig = SIGKILL;
@@ -65,8 +65,9 @@ void xparsetimeval(char *s, struct timeval *tv)
void timeout_main(void)
{
- // Use same ARGFAIL value for any remaining parsing errors
toys.exitval = 125;
+
+ // Parse early to get any errors out of the way.
xparsetimeval(*toys.optargs, &TT.itv.it_value);
if (TT.k) xparsetimeval(TT.k, &TT.ktv);
@@ -76,7 +77,6 @@ void timeout_main(void)
if (!FLAG(foreground)) setpgid(0, 0);
- toys.exitval = 0;
if (!(TT.pid = XVFORK())) xexec(toys.optargs+1);
else {
int status;
@@ -84,7 +84,9 @@ void timeout_main(void)
xsignal(SIGALRM, handler);
setitimer(ITIMER_REAL, &TT.itv, (void *)toybuf);
- status = xwaitpid(TT.pid);
- if (FLAG(preserve_status) || !toys.exitval) toys.exitval = status;
+ while (-1 == waitpid(TT.pid, &status, 0) && errno == EINTR);
+ if (WIFEXITED(status)) toys.exitval = WEXITSTATUS(status);
+ else if (WTERMSIG(status)==SIGKILL) toys.exitval = 137;
+ else toys.exitval = FLAG(preserve_status) ? 128+WTERMSIG(status) : 124;
}
}
diff --git a/toys/pending/arping.c b/toys/pending/arping.c
index 68ee5eac..be43cab1 100644
--- a/toys/pending/arping.c
+++ b/toys/pending/arping.c
@@ -166,6 +166,7 @@ static void recv_from(struct sockaddr_ll *from, int *recv_len)
gettimeofday(&tval, NULL);
delta = (tval.tv_sec * 1000000ULL + (tval.tv_usec)) - TT.sent_at;
xprintf(" %u.%03ums\n", delta / 1000, delta % 1000);
+ xflush();
}
}
TT.rcvd_nr++;
@@ -242,13 +243,15 @@ void arping_main(void)
saddr.sin_family = AF_INET;
if (src_addr.s_addr) {
saddr.sin_addr = src_addr;
- xbind(p_fd, (struct sockaddr*)&saddr, sizeof(saddr));
+ if (bind(p_fd, (struct sockaddr*)&saddr, sizeof(saddr)))
+ perror_exit("bind");
} else {
uint32_t oip;
saddr.sin_port = htons(1025);
saddr.sin_addr = dest_addr;
- xconnect(p_fd, (struct sockaddr *) &saddr, sizeof(saddr));
+ if (connect(p_fd, (struct sockaddr *) &saddr, sizeof(saddr)))
+ perror_exit("cannot connect to remote host");
get_interface(TT.iface, NULL, &oip, NULL);
src_addr.s_addr = htonl(oip);
}
@@ -257,7 +260,8 @@ void arping_main(void)
src_pk.sll_family = AF_PACKET;
src_pk.sll_protocol = htons(ETH_P_ARP);
- xbind(TT.sockfd, (struct sockaddr *)&src_pk, sizeof(src_pk));
+ if (bind(TT.sockfd, (struct sockaddr *)&src_pk, sizeof(src_pk)))
+ perror_exit("bind");
socklen_t alen = sizeof(src_pk);
getsockname(TT.sockfd, (struct sockaddr *)&src_pk, &alen);
diff --git a/toys/pending/bc.c b/toys/pending/bc.c
index 5d0e98e9..bb5d86cb 100644
--- a/toys/pending/bc.c
+++ b/toys/pending/bc.c
@@ -536,7 +536,6 @@ BcStatus bc_lex_token(BcLex *l);
BcStatus bc_parse_parse(BcParse *p);
BcStatus bc_parse_expr_status(BcParse *p, uint8_t flags, BcParseNext next);
-void bc_parse_noElse(BcParse *p);
#define BC_PROG_ONE_CAP (1)
@@ -678,7 +677,7 @@ char *bc_err_msgs[] = {
"negative number",
"non integer number",
- "overflow",
+ "overflow; %s",
"divide by zero",
"could not open file: %s",
@@ -1722,7 +1721,6 @@ static BcStatus bc_num_p(BcNum *a, BcNum *b, BcNum *c, size_t scale) {
return BC_STATUS_SUCCESS;
}
if (!a->len) {
- if (b->neg) return bc_vm_err(BC_ERROR_MATH_DIVIDE_BY_ZERO);
bc_num_setToZero(c, scale);
return BC_STATUS_SUCCESS;
}
@@ -3594,8 +3592,6 @@ static BcStatus bc_parse_endBody(BcParse *p, int brace) {
new_else = (p->l.t == BC_LEX_KEY_ELSE);
if (new_else) s = bc_parse_else(p);
- else if (!has_brace && (!BC_PARSE_IF_END(p) || brace))
- bc_parse_noElse(p);
}
if (brace && has_brace) brace = 0;
@@ -3605,15 +3601,6 @@ static BcStatus bc_parse_endBody(BcParse *p, int brace) {
if (!s && p->flags.len == 1 && brace)
s = bc_parse_err(p, BC_ERROR_PARSE_TOKEN);
- else if (brace && BC_PARSE_BRACE(p)) {
- uint16_t flags = BC_PARSE_TOP_FLAG(p);
- if (!(flags & (BC_PARSE_FLAG_FUNC_INNER | BC_PARSE_FLAG_LOOP_INNER)) &&
- !(flags & (BC_PARSE_FLAG_IF | BC_PARSE_FLAG_ELSE)) &&
- !(flags & (BC_PARSE_FLAG_IF_END)))
- {
- bc_vec_pop(&p->flags);
- }
- }
return s;
}
@@ -3624,7 +3611,7 @@ static void bc_parse_startBody(BcParse *p, uint16_t flags) {
bc_vec_push(&p->flags, &flags);
}
-void bc_parse_noElse(BcParse *p) {
+static void bc_parse_noElse(BcParse *p) {
uint16_t *flag_ptr = BC_PARSE_TOP_FLAG_PTR(p);
*flag_ptr = (*flag_ptr & ~(BC_PARSE_FLAG_IF_END));
bc_parse_setLabel(p);
@@ -3983,10 +3970,8 @@ static BcStatus bc_parse_body(BcParse *p, int brace) {
if (p->l.t == BC_LEX_NLINE) s = bc_lex_next(&p->l);
}
else {
- size_t len = p->flags.len;
s = bc_parse_stmt(p);
- if (!s && !brace && !BC_PARSE_BODY(p) && len <= p->flags.len)
- s = bc_parse_endBody(p, 0);
+ if (!s && !brace && !BC_PARSE_BODY(p)) s = bc_parse_endBody(p, 0);
}
return s;
@@ -4805,9 +4790,8 @@ static void bc_program_printString(char *str)
if ((idx = stridx("ab\\efnqrt", c = str[i+1])) >= 0) {
if (c == 'n') TT.nchars = SIZE_MAX;
c = "\a\b\\\\\f\n\"\r\t"[idx];
+ i++;
}
- else putchar('\\');
- i++;
}
putchar(c);
@@ -5683,7 +5667,6 @@ static void bc_vm_clean()
static BcStatus bc_vm_process(char *text, int is_stdin) {
BcStatus s;
- uint16_t *flags;
s = bc_parse_text(&BC_VM->prs, text);
if (s) goto err;
@@ -5693,11 +5676,6 @@ static BcStatus bc_vm_process(char *text, int is_stdin) {
if (s) goto err;
}
- flags = BC_PARSE_TOP_FLAG_PTR(&BC_VM->prs);
-
- if (!is_stdin && BC_VM->prs.flags.len == 1 && *flags == BC_PARSE_FLAG_IF_END)
- bc_parse_noElse(&BC_VM->prs);
-
if (BC_PARSE_NO_EXEC(&BC_VM->prs)) goto err;
s = bc_program_exec(&BC_VM->prog);
@@ -5853,7 +5831,7 @@ void bc_main(void)
int i;
for (i = 0; !s && i < toys.optc; ++i) s = bc_vm_file(toys.optargs[i]);
- if (!s) s = bc_vm_stdin();
+ if (!s || s != BC_STATUS_QUIT) s = bc_vm_stdin();
}
if (CFG_TOYBOX_FREE) {
diff --git a/toys/pending/bootchartd.c b/toys/pending/bootchartd.c
index 1fe6aff6..7e5a136f 100644
--- a/toys/pending/bootchartd.c
+++ b/toys/pending/bootchartd.c
@@ -34,9 +34,24 @@ GLOBALS(
int proc_accounting;
int is_login;
- pid_t cur_pid;
+ void *head;
)
+struct pid_list {
+ struct pid_list *next, *prev;
+ int pid;
+};
+
+static int push_pids_in_list(pid_t pid, char *name)
+{
+ struct pid_list *new = xzalloc(sizeof(struct pid_list));
+
+ new->pid = pid;
+ dlist_add_nomalloc((void *)&TT.head, (void *)new);
+
+ return 0;
+}
+
static void dump_data_in_file(char *fname, int wfd)
{
int rfd = open(fname, O_RDONLY);
@@ -238,21 +253,13 @@ static void stop_logging(char *tmp_dir, char *prog)
}
}
-static int signal_pid(pid_t pid, char *name)
-{
- if (pid != TT.cur_pid) kill(pid, SIGUSR1);
- return 0;
-}
-
void bootchartd_main()
{
- pid_t lgr_pid;
+ pid_t lgr_pid, self_pid = getpid();
int bchartd_opt = 0; // 0=PID1, 1=start, 2=stop, 3=init
-
- TT.cur_pid = getpid();
TT.smpl_period_usec = 200 * 1000;
- TT.is_login = (TT.cur_pid == 1);
+ TT.is_login = (self_pid == 1);
if (*toys.optargs) {
if (!strcmp("start", *toys.optargs)) bchartd_opt = 1;
else if (!strcmp("stop", *toys.optargs)) bchartd_opt = 2;
@@ -260,9 +267,16 @@ void bootchartd_main()
else error_exit("Unknown option '%s'", *toys.optargs);
if (bchartd_opt == 2) {
+ struct pid_list *temp;
char *process_name[] = {"bootchartd", NULL};
- names_to_pid(process_name, signal_pid, 0);
+ names_to_pid(process_name, push_pids_in_list);
+ temp = TT.head;
+ if (temp) temp->prev->next = 0;
+ for (; temp; temp = temp->next)
+ if (temp->pid != self_pid) kill(temp->pid, SIGUSR1);
+ llist_traverse(TT.head, free);
+
return;
}
} else if (!TT.is_login) error_exit("not PID 1");
diff --git a/toys/pending/crontab.c b/toys/pending/crontab.c
index 6c1c65a2..0b1c47db 100644
--- a/toys/pending/crontab.c
+++ b/toys/pending/crontab.c
@@ -113,17 +113,15 @@ static int validate_component(int min, int max, char *src)
static int parse_crontab(char *fname)
{
- FILE *fp = xfopen(fname, "r");
- long len = 0;
- char *line = NULL;
- size_t allocated_length;
- int lno;
+ char *line;
+ int lno, fd = xopenro(fname);
+ long plen = 0;
- for (lno = 1; (len = getline(&line, &allocated_length, fp)) > 0; lno++) {
+ for (lno = 1; (line = get_rawline(fd, &plen, '\n')); lno++,free(line)) {
char *name, *val, *tokens[5] = {0,}, *ptr = line;
int count = 0;
- if (line[len - 1] == '\n') line[--len] = '\0';
+ if (line[plen - 1] == '\n') line[--plen] = '\0';
else {
snprintf(toybuf, sizeof(toybuf), "'%d': premature EOF\n", lno);
goto OUT;
@@ -202,13 +200,12 @@ static int parse_crontab(char *fname)
break;
}
}
- free(line);
- fclose(fp);
+ xclose(fd);
return 0;
OUT:
free(line);
printf("Error at line no %s", toybuf);
- fclose(fp);
+ xclose(fd);
return 1;
}
diff --git a/toys/pending/dd.c b/toys/pending/dd.c
index 5b624fd7..e37f8b28 100644
--- a/toys/pending/dd.c
+++ b/toys/pending/dd.c
@@ -4,6 +4,8 @@
* Copyright 2013 Kyungwan Han <asura321@gmail.com>
*
* See http://opengroup.org/onlinepubs/9699919799/utilities/dd.html
+ *
+ * todo: ctrl-c doesn't work, the read() is restarting.
USE_DD(NEWTOY(dd, 0, TOYFLAG_USR|TOYFLAG_BIN))
@@ -11,22 +13,19 @@ config DD
bool "dd"
default n
help
- usage: dd [if=FILE] [of=FILE] [ibs=N] [obs=N] [iflag=FLAGS] [oflag=FLAGS]
- [bs=N] [count=N] [seek=N] [skip=N]
- [conv=notrunc|noerror|sync|fsync] [status=noxfer|none]
+ usage: dd [if=FILE] [of=FILE] [ibs=N] [obs=N] [bs=N] [count=N] [skip=N]
+ [seek=N] [conv=notrunc|noerror|sync|fsync] [status=noxfer|none]
Copy/convert files.
if=FILE Read from FILE instead of stdin
of=FILE Write to FILE instead of stdout
bs=N Read and write N bytes at a time
- ibs=N Input block size
- obs=N Output block size
+ ibs=N Read N bytes at a time
+ obs=N Write N bytes at a time
count=N Copy only N input blocks
skip=N Skip N input blocks
seek=N Skip N output blocks
- iflag=FLAGS Set input flags
- oflag=FLAGS Set output flags
conv=notrunc Don't truncate output file
conv=noerror Continue after read errors
conv=sync Pad blocks with zeros
@@ -34,12 +33,6 @@ config DD
status=noxfer Don't show transfer rate
status=none Don't show transfer rate or records in/out
- FLAGS is a comma-separated list of:
-
- count_bytes (iflag) interpret count=N in bytes, not blocks
- seek_bytes (oflag) interpret seek=N in bytes, not blocks
- skip_bytes (iflag) interpret skip=N in bytes, not blocks
-
Numbers may be suffixed by c (*1), w (*2), b (*512), kD (*1000), k (*1024),
MD (*1000*1000), M (*1024*1024), GD (*1000*1000*1000) or G (*1024*1024*1024).
*/
@@ -58,24 +51,12 @@ GLOBALS(
long sz, count;
unsigned long long offset;
} in, out;
- unsigned conv, iflag, oflag;
);
-struct dd_flag {
- char *name;
-};
-
-static const struct dd_flag dd_conv[] = TAGGED_ARRAY(DD_conv,
- {"fsync"}, {"noerror"}, {"notrunc"}, {"sync"},
-);
-
-static const struct dd_flag dd_iflag[] = TAGGED_ARRAY(DD_iflag,
- {"count_bytes"}, {"skip_bytes"},
-);
-
-static const struct dd_flag dd_oflag[] = TAGGED_ARRAY(DD_oflag,
- {"seek_bytes"},
-);
+#define C_FSYNC 1
+#define C_NOERROR 2
+#define C_NOTRUNC 4
+#define C_SYNC 8
static void status()
{
@@ -98,12 +79,6 @@ static void status()
}
}
-static void dd_sigint(int sig) {
- status();
- toys.exitval = sig|128;
- xexit();
-}
-
static void write_out(int all)
{
TT.out.bp = TT.out.buff;
@@ -122,24 +97,18 @@ static void write_out(int all)
if (TT.out.count) memmove(TT.out.buff, TT.out.bp, TT.out.count); //move remainder to front
}
-static void parse_flags(char *what, char *arg,
- const struct dd_flag* flags, int flag_count, unsigned *result)
+int strstarteq(char **a, char *b)
{
- char *pre = xstrdup(arg);
- int i;
+ char *aa = *a;
- for (i=0; i<flag_count; ++i) {
- while (comma_remove(pre, flags[i].name)) *result |= 1<<i;
- }
- if (*pre) error_exit("bad %s=%s", what, pre);
- free(pre);
+ return strstart(&aa, b) && *aa == '=' && (*a = aa+1);
}
void dd_main()
{
char **args;
unsigned long long bs = 0;
- int trunc = O_TRUNC;
+ int trunc = O_TRUNC, conv = 0;
TT.show_xfer = TT.show_records = 1;
TT.c_count = ULLONG_MAX;
@@ -148,46 +117,51 @@ void dd_main()
for (args = toys.optargs; *args; args++) {
char *arg = *args;
- if (strstart(&arg, "bs=")) bs = atolx_range(arg, 1, LONG_MAX);
- else if (strstart(&arg, "ibs=")) TT.in.sz = atolx_range(arg, 1, LONG_MAX);
- else if (strstart(&arg, "obs=")) TT.out.sz = atolx_range(arg, 1, LONG_MAX);
- else if (strstart(&arg, "count="))
+ if (strstarteq(&arg, "bs")) bs = atolx_range(arg, 1, LONG_MAX);
+ else if (strstarteq(&arg, "ibs")) TT.in.sz = atolx_range(arg, 1, LONG_MAX);
+ else if (strstarteq(&arg, "obs")) TT.out.sz = atolx_range(arg, 1, LONG_MAX);
+ else if (strstarteq(&arg, "count"))
TT.c_count = atolx_range(arg, 0, LLONG_MAX);
- else if (strstart(&arg, "if=")) TT.in.name = arg;
- else if (strstart(&arg, "of=")) TT.out.name = arg;
- else if (strstart(&arg, "seek="))
+ else if (strstarteq(&arg, "if")) TT.in.name = arg;
+ else if (strstarteq(&arg, "of")) TT.out.name = arg;
+ else if (strstarteq(&arg, "seek"))
TT.out.offset = atolx_range(arg, 0, LLONG_MAX);
- else if (strstart(&arg, "skip="))
+ else if (strstarteq(&arg, "skip"))
TT.in.offset = atolx_range(arg, 0, LLONG_MAX);
- else if (strstart(&arg, "status=")) {
+ else if (strstarteq(&arg, "status")) {
if (!strcmp(arg, "noxfer")) TT.show_xfer = 0;
else if (!strcmp(arg, "none")) TT.show_xfer = TT.show_records = 0;
else error_exit("unknown status '%s'", arg);
- } else if (strstart(&arg, "conv=")) {
- parse_flags("conv", arg, dd_conv, ARRAY_LEN(dd_conv), &TT.conv);
- fprintf(stderr, "conv=%x\n", TT.conv);
- } else if (strstart(&arg, "iflag="))
- parse_flags("iflag", arg, dd_iflag, ARRAY_LEN(dd_iflag), &TT.iflag);
- else if (strstart(&arg, "oflag="))
- parse_flags("oflag", arg, dd_oflag, ARRAY_LEN(dd_oflag), &TT.oflag);
- else error_exit("bad arg %s", arg);
+ } else if (strstarteq(&arg, "conv")) {
+ char *ss, *convs[] = {"fsync", "noerror", "notrunc", "sync"};
+ int i, len;
+
+ while ((ss = comma_iterate(&arg, &len))) {
+ for (i = 0; i<ARRAY_LEN(convs); i++)
+ if (len == strlen(convs[i]) && !strncmp(ss, convs[i], len)) break;
+ if (i == ARRAY_LEN(convs)) error_exit("bad conv=%.*s", len, ss);
+ conv |= 1<<i;
+ }
+ } else error_exit("bad arg %s", arg);
}
if (bs) TT.in.sz = TT.out.sz = bs;
- signal(SIGINT, dd_sigint);
+ signal(SIGINT, generic_signal);
signal(SIGUSR1, generic_signal);
gettimeofday(&TT.start, NULL);
- // For bs=, in/out is done as it is. so only in.sz is enough.
- // With Single buffer there will be overflow in a read following partial read.
+ /* for bs=, in/out is done as it is. so only in.sz is enough.
+ * With Single buffer there will be overflow in a read following partial read
+ */
TT.in.buff = TT.out.buff = xmalloc(TT.in.sz + (bs ? 0 : TT.out.sz));
TT.in.bp = TT.out.bp = TT.in.buff;
-
+ //setup input
if (!TT.in.name) TT.in.name = "stdin";
else TT.in.fd = xopenro(TT.in.name);
- if (TT.conv & _DD_conv_notrunc) trunc = 0;
+ if (conv&C_NOTRUNC) trunc = 0;
+ //setup output
if (!TT.out.name) {
TT.out.name = "stdout";
TT.out.fd = 1;
@@ -196,43 +170,30 @@ void dd_main()
// Implement skip=
if (TT.in.offset) {
- off_t off = TT.in.offset;
-
- if (!(TT.iflag & _DD_iflag_skip_bytes)) off *= TT.in.sz;
- if (lseek(TT.in.fd, off, SEEK_CUR) < 0) {
- while (off > 0) {
- int chunk = off < TT.in.sz ? off : TT.in.sz;
- ssize_t n = read(TT.in.fd, TT.in.bp, chunk);
+ if (lseek(TT.in.fd, (off_t)(TT.in.offset * TT.in.sz), SEEK_CUR) < 0) {
+ while (TT.in.offset--) {
+ ssize_t n = read(TT.in.fd, TT.in.bp, TT.in.sz);
if (n < 0) {
perror_msg("%s", TT.in.name);
- if (TT.conv & _DD_conv_noerror) status();
+ if (conv&C_NOERROR) status();
else return;
} else if (!n) {
xprintf("%s: Can't skip\n", TT.in.name);
return;
}
- off -= n;
}
}
}
- // Implement seek= and truncate as necessary. We handled position zero
- // truncate with O_TRUNC on open, so output to /dev/null and such doesn't
- // error.
- bs = TT.out.offset;
- if (!(TT.oflag & _DD_oflag_seek_bytes)) bs *= TT.out.sz;
- if (bs) {
+ // seek/truncate as necessary. We handled position zero truncate with
+ // O_TRUNC on open, so output to /dev/null and such doesn't error.
+ if (TT.out.fd!=1 && (bs = TT.out.offset*TT.out.sz)) {
xlseek(TT.out.fd, bs, SEEK_CUR);
if (trunc && ftruncate(TT.out.fd, bs)) perror_exit("ftruncate");
}
- unsigned long long bytes_left = TT.c_count;
- if (TT.c_count != ULLONG_MAX && !(TT.iflag & _DD_iflag_count_bytes)) {
- bytes_left *= TT.in.sz;
- }
- while (bytes_left) {
- int chunk = bytes_left < TT.in.sz ? bytes_left : TT.in.sz;
+ while (TT.c_count==ULLONG_MAX || (TT.in_full + TT.in_part) < TT.c_count) {
ssize_t n;
// Show progress and exit on SIGINT or just continue on SIGUSR1.
@@ -243,16 +204,16 @@ void dd_main()
}
TT.in.bp = TT.in.buff + TT.in.count;
- if (TT.conv & _DD_conv_sync) memset(TT.in.bp, 0, TT.in.sz);
- if (!(n = read(TT.in.fd, TT.in.bp, chunk))) break;
- if (n < 0) {
+ if (conv&C_SYNC) memset(TT.in.bp, 0, TT.in.sz);
+ if (!(n = read(TT.in.fd, TT.in.bp, TT.in.sz))) break;
+ if (n < 0) {
if (errno == EINTR) continue;
//read error case.
perror_msg("%s: read error", TT.in.name);
- if (!(TT.conv & _DD_conv_noerror)) exit(1);
+ if (!(conv&C_NOERROR)) exit(1);
status();
xlseek(TT.in.fd, TT.in.sz, SEEK_CUR);
- if (!(TT.conv & _DD_conv_sync)) continue;
+ if (!(conv&C_SYNC)) continue;
// if SYNC, then treat as full block of nuls
n = TT.in.sz;
}
@@ -261,10 +222,9 @@ void dd_main()
TT.in.count += n;
} else {
TT.in_part++;
- if (TT.conv & _DD_conv_sync) TT.in.count += TT.in.sz;
+ if (conv&C_SYNC) TT.in.count += TT.in.sz;
else TT.in.count += n;
}
- bytes_left -= n;
TT.out.count = TT.in.count;
if (bs) {
@@ -279,7 +239,7 @@ void dd_main()
}
}
if (TT.out.count) write_out(1); //write any remaining input blocks
- if ((TT.conv & _DD_conv_fsync) && fsync(TT.out.fd)<0)
+ if ((conv&C_FSYNC) && fsync(TT.out.fd)<0)
perror_exit("%s: fsync", TT.out.name);
close(TT.in.fd);
diff --git a/toys/pending/dhcp6.c b/toys/pending/dhcp6.c
index 728dc7d1..c69c4aed 100644
--- a/toys/pending/dhcp6.c
+++ b/toys/pending/dhcp6.c
@@ -249,7 +249,10 @@ static void mode_raw()
sockll.sll_family = AF_PACKET;
sockll.sll_protocol = htons(ETH_P_IPV6);
sockll.sll_ifindex = if_nametoindex(TT.interface_name);
- xbind(TT.sock, (struct sockaddr *) &sockll, sizeof(sockll));
+ if (bind(TT.sock, (struct sockaddr *) &sockll, sizeof(sockll))) {
+ xclose(TT.sock);
+ error_exit("MODE RAW : Bind fail.\n");
+ }
if (setsockopt(TT.sock, SOL_PACKET, PACKET_HOST,&constone, sizeof(int)) < 0) {
if (errno != ENOPROTOOPT) error_exit("MODE RAW : Bind fail.\n");
}
@@ -572,7 +575,10 @@ void dhcp6_main(void)
xsetsockopt(TT.sock1, SOL_SOCKET, SO_REUSEADDR, &constone, sizeof(constone));
- xbind(TT.sock1, (struct sockaddr *)&sinaddr6, sizeof(sinaddr6));
+ if (bind(TT.sock1, (struct sockaddr *)&sinaddr6, sizeof(sinaddr6))) {
+ xclose(TT.sock1);
+ error_exit("bind failed");
+ }
mode_raw();
set_timeout(0);
diff --git a/toys/pending/diff.c b/toys/pending/diff.c
index d7bb43c4..4a528134 100644
--- a/toys/pending/diff.c
+++ b/toys/pending/diff.c
@@ -5,7 +5,7 @@
*
* See: http://cm.bell-labs.com/cm/cs/cstr/41.pdf
-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_DIFF(NEWTOY(diff, "<2>2(color)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)))
config DIFF
bool "diff"
@@ -13,25 +13,23 @@ config DIFF
help
usage: diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2
- -a Treat all files as text
- -b Ignore changes in the amount of whitespace
- -B Ignore changes whose lines are all blank
- -d Try hard to find a smaller set of changes
- -i Ignore case differences
- -L Use LABEL instead of the filename in the unified header
- -N Treat absent files as empty
- -q Output only whether files differ
- -r Recurse
- -S Start with FILE when comparing directories
- -T Make tabs line up by prefixing a tab when necessary
- -s Report when two files are the same
- -t Expand tabs to spaces in output
- -u Unified diff
- -U Output LINES lines of context
- -w Ignore all whitespace
-
- --color Colored output
- --strip-trailing-cr Strip trailing '\r's from input lines
+ -a Treat all files as text
+ -b Ignore changes in the amount of whitespace
+ -B Ignore changes whose lines are all blank
+ -d Try hard to find a smaller set of changes
+ -i Ignore case differences
+ -L Use LABEL instead of the filename in the unified header
+ -N Treat absent files as empty
+ -q Output only whether files differ
+ -r Recurse
+ -S Start with FILE when comparing directories
+ -T Make tabs line up by prefixing a tab when necessary
+ -s Report when two files are the same
+ -t Expand tabs to spaces in output
+ -U Output LINES lines of context
+ -w Ignore all whitespace
+
+ --color Colored output
*/
#define FOR_diff
@@ -182,13 +180,20 @@ static void do_merge(struct candidate **K, int *k, int i,
static FILE* read_stdin()
{
- char *tmp_name;
- int tmpfd = xtempfile("stdin", &tmp_name);
+ char tmp_name[] = "/tmp/diffXXXXXX";
+ int rd, wr, tmpfd = mkstemp(tmp_name);
+ if (tmpfd == -1) perror_exit("mkstemp");
unlink(tmp_name);
- free(tmp_name);
- xsendfile(0, tmpfd);
+ while (1) {
+ rd = xread(STDIN_FILENO, toybuf, sizeof(toybuf));
+
+ if (!rd) break;
+ if (rd < 0) perror_exit("read error");
+ wr = writeall(tmpfd, toybuf, rd);
+ if (wr < 0) perror_exit("write");
+ }
return fdopen(tmpfd, "r");
}
@@ -198,18 +203,8 @@ static int read_tok(FILE *fp, off_t *off, int tok)
tok |= empty;
while (!(tok & eol)) {
- t = fgetc(fp);
-
- if (FLAG(strip_trailing_cr) && t == '\r') {
- int t2 = fgetc(fp);
- if (t2 == '\n') {
- t = t2;
- if (off) (*off)++;
- } else {
- ungetc(t2, fp);
- }
- }
+ t = fgetc(fp);
if (off && t != EOF) *off += 1;
is_space = isspace(t) || (t == EOF);
tok |= (t & (eof + eol)); //set tok eof+eol when t is eof
@@ -524,64 +519,12 @@ static int cmp(const void *p1, const void *p2)
return strcmp(* (char * const *)p1, * (char * const *)p2);
}
-// quote and escape filenames that have awkward characters
-char *quote_filename(char *filename)
-{
- char *to = "abfnrtv\"\\", *from = "\a\b\f\n\r\t\v\"\\";
- char *result, *s, *t;
- size_t len = 0;
- int quote = 0;
-
- // calculate memory usage and presence of quotes
- for (s = filename; *s; s++) {
- if (*s == '\a' || *s == '\b' || *s == '\f' || *s == '\r' || *s == '\v'
- || *s == '\n' || *s == '\t' || *s == '"' || *s == '\\')
- {
- quote = 1;
- len += 2;
- } else if (*s == ' ') {
- quote = 1;
- len++;
- } else if (*s < 0x20 || *s >= 0x80) {
- quote = 1;
- len += 4;
- } else {
- len++;
- }
- }
-
- // construct the new string
- result = xmalloc(len + (quote ? 2 : 0) + 1);
- t = result;
- if (quote) *t++ = '"';
- for (s = filename; *s; s++) {
- if (*s == '\a' || *s == '\b' || *s == '\f' || *s == '\r' || *s == '\v'
- || *s == '\n' || *s == '\t' || *s == '"' || *s == '\\')
- {
- *t = '\\';
- t[1] = to[strchr(from, *s) - from];
- t += 2;
- } else if (*s < 0x20 || *s >= 0x80) {
- sprintf(t, "\\%.3o", *s);
- t += 4;
- } else {
- *t++ = *s;
- }
- }
- if (quote) *t++ = '"';
- *t = 0;
- return result;
-}
-
static void show_label(char *prefix, char *filename, struct stat *sb)
{
char date[36];
- char *quoted_file;
- quoted_file = quote_filename(filename);
- printf("%s %s\t%s\n", prefix, quoted_file,
+ printf("%s %s\t%s\n", prefix, filename,
format_iso_time(date, sizeof(date), &sb->st_mtim));
- free(quoted_file);
}
static void do_diff(char **files)
diff --git a/toys/lsb/gzip.c b/toys/pending/gzip.c
index 3038495e..bc059dd6 100644
--- a/toys/lsb/gzip.c
+++ b/toys/pending/gzip.c
@@ -2,13 +2,12 @@
*
* Copyright 2017 The Android Open Source Project
*
- * See http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/gzip.html
* GZIP RFC: http://www.ietf.org/rfc/rfc1952.txt
*
* todo: qtv --rsyncable
// gzip.net version allows all options for all commands.
-USE_GZIP(NEWTOY(gzip, "ncdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_GZIP(NEWTOY(gzip, "cdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
USE_GUNZIP(NEWTOY(gunzip, "cdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
USE_ZCAT(NEWTOY(zcat, "cdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
@@ -30,7 +29,7 @@ config GZIP
config GUNZIP
bool "gunzip"
- default y
+ default n
help
usage: gunzip [-cfk] [FILE...]
@@ -44,7 +43,7 @@ config GUNZIP
config ZCAT
bool "zcat"
- default y
+ default n
help
usage: zcat [FILE...]
@@ -65,7 +64,7 @@ GLOBALS(
#if CFG_TOYBOX_LIBZ
#include <zlib.h>
-// Read from in_fd, write to out_fd, decompress if dd else compress
+// Read fron in_fd, write to out_fd, decompress if dd else compress
static int do_deflate(int in_fd, int out_fd, int dd, int level)
{
int len, err = 0;
@@ -111,42 +110,48 @@ static int do_deflate(int in_fd, int out_fd, int dd, int level)
#endif
-static void do_gzip(int ifd, char *in)
+static void do_gzip(int in_fd, char *arg)
{
struct stat sb;
- char *out = 0;
- int ofd = 0;
+ int len, out_fd = 0;
+ char *out_name = 0;
// Are we writing to stdout?
- if (!ifd || FLAG(c)) ofd = 1;
- if (isatty(ifd)) {
- if (!FLAG(f)) return error_msg("%s:need -f to read TTY"+3*!!ifd, in);
- else ofd = 1;
+ if (!in_fd || (toys.optflags&FLAG_c)) out_fd = 1;
+ if (isatty(in_fd)) {
+ if (!(toys.optflags&FLAG_f))
+ return error_msg("%s:need -f to read TTY"+3*!!in_fd, arg);
+ else out_fd = 1;
}
// Are we reading file.gz to write to file?
- if (!ofd) {
- if (fstat(ifd, &sb)) return perror_msg("%s", in);
-
- // Add or remove .gz suffix as necessary
- if (!FLAG(d)) out = xmprintf("%s%s", in, ".gz");
- else if ((out = strend(in, ".gz"))>in) out = xstrndup(in, out-in);
- else return error_msg("no .gz: %s", in);
-
- ofd = xcreate(out, O_CREAT|O_WRONLY|WARN_ONLY|(O_EXCL*!FLAG(f)),sb.st_mode);
- if (ofd == -1) return;
+ if (!out_fd) {
+ if (fstat(in_fd, &sb)) return perror_msg("%s", arg);
+
+ if (!(toys.optflags&FLAG_d)) out_name = xmprintf("%s%s", arg, ".gz");
+ else {
+ // "gunzip x.gz" will decompress "x.gz" to "x".
+ if ((len = strlen(arg))<4 || strcmp(arg+len-3, ".gz"))
+ return error_msg("no .gz: %s", arg);
+ out_name = xstrdup(arg);
+ out_name[len-3] = 0;
+ }
+
+ out_fd = xcreate(out_name,
+ O_CREAT|O_WRONLY|WARN_ONLY|(O_EXCL*!(toys.optflags&FLAG_f)), sb.st_mode);
+ if (out_fd == -1) return;
}
- if (do_deflate(ifd, ofd, FLAG(d), TT.level)) in = out;
+ if (do_deflate(in_fd, out_fd, toys.optflags&FLAG_d, TT.level) && out_name)
+ arg = out_name;
+ if (out_fd != 1) close(out_fd);
- if (out) {
- struct timespec times[] = {sb.st_atim, sb.st_mtim};
+ if (out_name) {
+ struct timespec times[] = { sb.st_atim, sb.st_mtim };
- if (utimensat(AT_FDCWD, out, times, 0)) perror_exit("utimensat");
- if (chmod(out, sb.st_mode)) perror_exit("chmod");
- close(ofd);
- if (!FLAG(k) && in && unlink(in)) perror_msg("unlink %s", in);
- free(out);
+ if (utimensat(AT_FDCWD, out_name, times, 0)) perror_exit("utimensat");
+ if (!(toys.optflags&FLAG_k)) if (unlink(arg)) perror_msg("unlink %s", arg);
+ free(out_name);
}
}
diff --git a/toys/pending/host.c b/toys/pending/host.c
index 1610301e..fa830a7d 100644
--- a/toys/pending/host.c
+++ b/toys/pending/host.c
@@ -16,8 +16,8 @@ config HOST
or an IPv4 dotted or IPv6 colon-separated address to reverse lookup.
SERVER (if present) is the DNS server to use.
- -a -v -t ANY
- -t TYPE query records of type TYPE
+ -a no idea
+ -t not a clue
-v verbose
*/
@@ -68,13 +68,10 @@ static const char rct[16][32] = {
void host_main(void)
{
int verbose=(toys.optflags & (FLAG_a|FLAG_v)), type,
- i, j, ret, sec, count, rcode, qlen, alen, pllen = 0,
- abuf_len = 65536; // Largest TCP response.
+ i, j, ret, sec, count, rcode, qlen, alen, pllen = 0;
unsigned ttl, pri, v[5];
- unsigned char *abuf = xmalloc(abuf_len);
- char *rrname = xmalloc(MAXDNAME);
- unsigned char qbuf[280], *p;
- char *name, *nsname, plname[640], ptrbuf[128];
+ unsigned char qbuf[280], abuf[512], *p;
+ char *name, *nsname, rrname[256], plname[640], ptrbuf[128];
struct addrinfo *ai, iplit_hints = { .ai_flags = AI_NUMERICHOST };
name = *toys.optargs;
@@ -116,7 +113,7 @@ void host_main(void)
if (type < 0) error_exit("Invalid query type: %s", TT.type_str);
}
- qlen = res_mkquery(0, name, 1, type, 0, 0, 0, qbuf, sizeof(qbuf));
+ qlen = res_mkquery(0, name, 1, type, 0, 0, 0, qbuf, sizeof qbuf);
if (qlen < 0) error_exit("Invalid query parameters: %s", name);
if (nsname) {
@@ -124,14 +121,15 @@ void host_main(void)
if ((ret = getaddrinfo(nsname, "53", &ns_hints, &ai)) < 0)
error_exit("Error looking up server name: %s", gai_strerror(ret));
- int s = xsocket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
- xconnect(s, ai->ai_addr, ai->ai_addrlen);
+ int s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
+ if (s < 0 || connect(s, ai->ai_addr, ai->ai_addrlen) < 0)
+ perror_exit("Socket error");
setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &(struct timeval){ .tv_sec = 5 },
sizeof(struct timeval));
printf("Using domain server %s:\n", nsname);
send(s, qbuf, qlen, 0);
- alen = recv(s, abuf, abuf_len, 0);
- } else alen = res_send(qbuf, qlen, abuf, abuf_len);
+ alen = recv(s, abuf, sizeof abuf, 0);
+ } else alen = res_send(qbuf, qlen, abuf, sizeof abuf);
if (alen < 12) error_exit("Host not found.");
@@ -153,7 +151,7 @@ void host_main(void)
: "Additional information:");
for (; count--; p += pllen) {
- p += dn_expand(abuf, abuf+alen, p, rrname, MAXDNAME);
+ p += dn_expand(abuf, abuf+alen, p, rrname, sizeof(rrname));
type = (p[0]<<8) + p[1];
p += 4;
if (!sec) continue;
@@ -162,18 +160,18 @@ void host_main(void)
pllen = (p[0]<<8) + p[1];
p += 2;
- switch (type<ARRAY_LEN(rrt) ? rrt[type].pl : 0) {
+ switch (type<sizeof(rrt)/sizeof(*rrt) ? rrt[type].pl : 0) {
case PL_IP:
- inet_ntop(rrt[type].af, p, plname, sizeof(plname));
+ inet_ntop(rrt[type].af, p, plname, sizeof plname);
break;
case PL_NAME:
- dn_expand(abuf, abuf+alen, p, plname, sizeof(plname));
+ dn_expand(abuf, abuf+alen, p, plname, sizeof plname);
break;
case PL_TEXT:
- snprintf(plname, sizeof(plname), "\"%.*s\"", pllen, p);
+ snprintf(plname, sizeof plname, "\"%.*s\"", pllen, p);
break;
case PL_SOA:
- i = dn_expand(abuf, abuf+alen, p, plname, sizeof(plname) - 1);
+ i = dn_expand(abuf, abuf+alen, p, plname, sizeof plname - 1);
strcat(plname, " ");
i += dn_expand(abuf, abuf+alen, p+i, plname+strlen(plname),
sizeof(plname)-strlen(plname));
@@ -191,13 +189,13 @@ void host_main(void)
pri = (p[0]<<8)+p[1];
snprintf(plname, sizeof(plname), verbose ? "%d " : "(pri=%d) by ", pri);
dn_expand(abuf, abuf+alen, p+2, plname+strlen(plname),
- sizeof(plname) - strlen(plname));
+ sizeof plname - strlen(plname));
break;
case PL_SRV:
for (j=0; j<3; j++) v[j] = (p[2*j]<<8) + p[1+2*j];
snprintf(plname, sizeof(plname), "%u %u %u ", v[0], v[1], v[2]);
dn_expand(abuf, abuf+alen, p+6, plname+strlen(plname),
- sizeof(plname) - strlen(plname));
+ sizeof plname - strlen(plname));
break;
default:
printf("%s unsupported RR type %u\n", rrname, type);
@@ -212,9 +210,5 @@ void host_main(void)
if (!verbose && sec==1) break;
}
- if (CFG_TOYBOX_FREE) {
- free(abuf);
- free(rrname);
- }
toys.exitval = rcode;
}
diff --git a/toys/pending/ip.c b/toys/pending/ip.c
index 82e18fdb..66dd06fe 100644
--- a/toys/pending/ip.c
+++ b/toys/pending/ip.c
@@ -34,12 +34,9 @@ config IP
#include <net/if_arp.h>
#include <ifaddrs.h>
#include <fnmatch.h>
+#include <netinet/ip.h>
#include <linux/if_tunnel.h>
-#ifndef IP_DF
-#define IP_DF 0x4000 /* don't fragment flag. */
-#endif
-
GLOBALS(
char stats, singleline, flush, *filter_dev, gbuf[8192];
int sockfd, connected, from_ok, route_cmd;
@@ -103,23 +100,6 @@ static struct arglist rtmtypes[] = { {"none", RTN_UNSPEC},
static int filter_nlmesg(int (*fun)(struct nlmsghdr *mhdr, char **), char **);
static int ipaddr_print(struct linkdata *, int flg);
-// extended route attribute metrics.
-static const char *mx_names[RTAX_MAX + 1] = {
- [RTAX_MTU] = "mtu",
- [RTAX_WINDOW] = "window",
- [RTAX_RTT] = "rtt",
- [RTAX_RTTVAR] = "rttvar",
- [RTAX_SSTHRESH] = "ssthresh",
- [RTAX_CWND] = "cwnd",
- [RTAX_ADVMSS] = "advmss",
- [RTAX_REORDERING] = "reordering",
- [RTAX_HOPLIMIT] = "hoplimit",
- [RTAX_INITCWND] = "initcwnd",
- [RTAX_FEATURES] = "features",
- [RTAX_RTO_MIN] = "rto_min",
- [RTAX_INITRWND] = "initrwnd",
- [RTAX_QUICKACK] = "quickack",
- [RTAX_CC_ALGO] = "congctl"};
// ===========================================================================
// Common Code for IP Options (like: addr, link, route etc.)
@@ -444,35 +424,6 @@ static void parse_prefix(uint32_t *addr, uint32_t *netmask, uint8_t *len,
else *len = (af == AF_INET6) ? 16 : 4;
}
-/*
- * Add a route attribute to a buffer; this is primarily used for extended
- * attributes which get collected in a separate buffer from the normal route
- * attributes and later get added to the main rtm message.
- */
-static void add_varlen_rtattr_to_buffer(struct rtattr *rta, int maxlen,
- int type, void *data, int alen) {
- struct rtattr *subrta;
- int len = RTA_LENGTH(alen);
- if (RTA_ALIGN(rta->rta_len) + RTA_ALIGN(len) > maxlen) {
- error_exit("RTA exceeds max length %d", maxlen);
- }
- subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len));
- subrta->rta_type = type;
- subrta->rta_len = len;
- if (alen) {
- memcpy(RTA_DATA(subrta), data, alen);
- }
- rta->rta_len = NLMSG_ALIGN(rta->rta_len) + RTA_ALIGN(len);
-}
-
-static void add_uint32_rtattr_to_buffer(struct rtattr *rta, int maxlen,
- int type, uint32_t attr) {
- add_varlen_rtattr_to_buffer(rta, maxlen, type, (char*)&attr, sizeof(attr));
-}
-
-/*
- * Add a route attribute to a RTM message.
- */
static void add_string_to_rtattr(struct nlmsghdr *n, int maxlen,
int type, void *data, int alen)
{
@@ -1509,65 +1460,6 @@ static void show_iproute_help(void)
error_exit(errmsg);
}
-static void print_rta_metrics(char* out, const struct rtattr *mxattr)
-{
- int32_t tvar = RTA_PAYLOAD(mxattr);
- struct rtattr *rta, *mxrta[RTAX_MAX+1] = {0,};
- unsigned int mxlock = 0;
- int i;
-
- for (rta = RTA_DATA(mxattr); RTA_OK(rta, tvar); rta=RTA_NEXT(rta, tvar))
- if (rta->rta_type <= RTA_MAX) mxrta[rta->rta_type] = rta;
-
- if (mxrta[RTAX_LOCK])
- mxlock = *(u_int32_t *)RTA_DATA(mxrta[RTAX_LOCK]);
-
- for (i = 2; i <= RTAX_MAX; i++) {
- uint32_t val = 0;
-
- if (mxrta[i] == NULL && !(mxlock & (1 << i)))
- continue;
-
- if (mxrta[i] != NULL && i != RTAX_CC_ALGO)
- val = *(u_int32_t *)RTA_DATA(mxrta[i]);
-
- if (i == RTAX_HOPLIMIT && (int)val == -1)
- continue;
-
- if (i < sizeof(mx_names)/sizeof(char *) && mx_names[i])
- sprintf(out, "%s%s ", out, mx_names[i]);
- else
- sprintf(out, "%smetric %d ", out, i);
-
- if (mxlock & (1<<i))
- sprintf(out, "%slock ", out);
-
- switch (i) {
- case RTAX_RTT:
- case RTAX_RTTVAR:
- case RTAX_RTO_MIN:
- if (i == RTAX_RTT)
- val /= 8;
- else if (i == RTAX_RTTVAR)
- val /= 4;
-
- if (val >= 1000)
- sprintf(out, "%s%gs ", out, val / 1e3);
- else
- sprintf(out, "%s%ums ", out, val);
- break;
-
- case RTAX_CC_ALGO:
- sprintf(out, "%scongestion %s ", out, (const char*)RTA_DATA(mxrta[i]));
- break;
-
- default:
- sprintf(out, "%s%u ", out, val);
- break;
- }
- }
-}
-
static int display_route_info(struct nlmsghdr *mhdr, char **argv)
{
char *inetval = NULL, out[1024] = {0};
@@ -1697,10 +1589,6 @@ static int display_route_info(struct nlmsghdr *mhdr, char **argv)
if (attr[RTA_IIF] && !gfilter.idev)
sprintf(out, "%s iif %s", out,
if_indextoname(*(int*)RTA_DATA(attr[RTA_IIF]), toybuf));
-
- if (attr[RTA_METRICS])
- print_rta_metrics(out, attr[RTA_METRICS]);
-
if (TT.flush || (TT.connected && !TT.from_ok))
memcpy(toybuf, (void*)mhdr,mhdr->nlmsg_len);
@@ -2056,7 +1944,8 @@ static int route_update(char **argv, unsigned int route_flags)
if (!*++argv) show_iproute_help();
}
idx = atolx(*argv);
- add_uint32_rtattr_to_buffer(mxrta, sizeof(mxbuf), RTAX_MTU, idx);
+ add_string_to_rtattr(&req.hdr, sizeof(req),
+ RTAX_MTU, (char*)&idx, sizeof(idx));
} else if (idx == 4) {
if (!*++argv) show_iproute_help();
if ((idx = idxfromRPDB(*argv,RPDB_rtprotos)) < 0)
@@ -2106,7 +1995,8 @@ static int route_update(char **argv, unsigned int route_flags)
}
if (mxrta->rta_len > RTA_LENGTH(0)) {
if (mxlock)
- add_uint32_rtattr_to_buffer(mxrta, sizeof(mxbuf), RTAX_LOCK, mxlock);
+ add_string_to_rtattr(&req.hdr, sizeof(req),
+ RTAX_LOCK, (char*)&mxlock, sizeof(mxlock));
add_string_to_rtattr(&req.hdr, sizeof(req),
RTA_METRICS, RTA_DATA(mxrta), RTA_PAYLOAD(mxrta));
}
diff --git a/toys/pending/lsof.c b/toys/pending/lsof.c
index 5ab3af90..2852f41f 100644
--- a/toys/pending/lsof.c
+++ b/toys/pending/lsof.c
@@ -261,7 +261,7 @@ static void fill_stat(struct file_info *fi, const char *path)
case S_IFREG: strcpy(fi->type, "REG"); break;
case S_IFSOCK: strcpy(fi->type, "sock"); break;
default:
- snprintf(fi->type, sizeof(fi->type), "%04o", sb.st_mode & S_IFMT);
+ snprintf(fi->type, sizeof(fi->type), "0%03o", sb.st_mode & S_IFMT);
break;
}
diff --git a/toys/pending/man.c b/toys/pending/man.c
deleted file mode 100644
index 892d367c..00000000
--- a/toys/pending/man.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/* man.c - Read system documentation
- *
- * Copyright 2019 makepost <makepost@firemail.cc>
- *
- * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/man.html
-
-USE_MAN(NEWTOY(man, "k:M:", TOYFLAG_USR|TOYFLAG_BIN))
-
-config MAN
- bool "man"
- default n
- help
- usage: man [-M PATH] [-k STRING] | [SECTION] COMMAND
-
- Read manual page for system command.
-
- -k List pages with STRING in their short description
- -M Override $MANPATH
-
- Man pages are divided into 8 sections:
- 1 commands 2 system calls 3 library functions 4 /dev files
- 5 file formats 6 games 7 miscellaneous 8 system management
-
- Sections are searched in the order 1 8 3 2 5 4 6 7 unless you specify a
- section. Each section has a page called "intro", and there's a global
- introduction under "man-pages".
-*/
-
-#define FOR_man
-#include <toys.h>
-
-GLOBALS(
- char *M, *k;
-
- char any, cell, ex, *f, k_done, *line, *m, **sct, **scts, **sufs;
- regex_t reg;
-)
-
-static void newln()
-{
- if (FLAG(k)) return;
- if (TT.any) putchar('\n');
- if (TT.any && TT.cell != 2) putchar('\n'); // gawk alias
- TT.any = TT.cell = 0;
-}
-
-static void put(char *x)
-{
- while (*x && (TT.ex || *x != '\n')) TT.any = putchar(*x++);
-}
-
-// Substitute with same length or shorter.
-static void s(char *x, char *y)
-{
- int i = strlen(x), j = strlen(y), k, l;
-
- for (k = 0; TT.line[k]; k++) if (!strncmp(x, &TT.line[k], i)) {
- memmove(&TT.line[k], y, j);
- for (l = k += j; TT.line[l]; l++) TT.line[l] = TT.line[l + i - j];
- k--;
- }
-}
-
-static char start(char *x)
-{
- return !strncmp(x, TT.line, strlen(x));
-}
-
-static void trim(char *x)
-{
- if (start(x)) while (*x++) TT.line++;
-}
-
-static char k(char *s) {
- TT.k_done = 2;
- if (s) TT.line = s;
- return !regexec(&TT.reg, TT.k, 0, 0, 0)||!regexec(&TT.reg, TT.line, 0, 0, 0);
-}
-
-static void do_man(char **pline, long len)
-{
- if (!pline) return newln();
- TT.line = *pline;
-
- if (FLAG(k)) {
- if (!TT.k_done && !start(".") && !start("'") && k(strstr(*pline, "- ")))
- printf("%-20s %s%s", TT.k, "- "+2*(TT.line!=*pline), TT.line);
- else if (!TT.k_done && start(".so") && k(basename(*pline + 4)))
- printf("%s - See %s", TT.k, TT.line);
- } else {
- s("\\fB", ""), s("\\fI", ""), s("\\fP", ""), s("\\fR", ""); // bash bold,ita
- s("\\(aq", "'"), s("\\(cq", "'"), s("\\(dq", "\""); // bash,rsync quote
- s("\\*(lq", "\""), s("\\*(rq", "\""); // gawk quote
- s("\\(bu", "*"), s("\\(bv", "|"); // bash symbol
- s("\\&", ""), s("\\f(CW", ""); // gawk,rsync fancy
- s("\\-", "-"), s("\\(", ""), s("\\^", ""), s("\\e", "\\"); // bash escape
- s("\\*(", "#"); // gawk var
-
- if (start(".BR")) trim(".BR "), s(" ", ""); // bash boldpunct
- if (start(".IP")) newln(), trim(".IP "); // bash list
- if (start(".IR")) trim(".IR "), s(" ", ""); // bash itapunct
-
- trim(".B "); // bash bold
- trim(".BI "); // gawk boldita
- trim(".FN "); // bash filename
- trim(".I "); // bash ita
- trim(".if n "); // bash nroff
- if (start(".E")) TT.ex = TT.line[2] == 'X'; // stat example
- else if (start(".PP")) newln(); // bash paragraph
- else if (start(".SM")); // bash small
- else if (start(".S")) newln(), put(TT.line + 4), newln(); // bash section
- else if (start(".so")) put("See "), put(basename(TT.line + 4)); // lastb
- else if (start(".TH")) s("\"", " "), put(TT.line + 4); // gawk,git head
- else if (start(".TP")) newln(), TT.cell = 1; // bash table
- else if (start(".") || start("\'")); // bash,git garbage
- else if (!*TT.line); // emerge
- else {
- if (TT.cell) TT.cell++;
- if (!TT.ex) put(" ");
- put(TT.line);
- }
- }
-}
-
-// Open file, decompressing if suffix known.
-static int zopen(char *s)
-{
- int fds[] = {-1, -1};
- char **known = TT.sufs, *suf = strrchr(s, '.');
-
- if ((*fds = open(s, O_RDONLY)) == -1) return -1;
- while (suf && *known && strcmp(suf, *known++));
- if (!suf || !*known) return *fds;
- sprintf(toybuf, "%czcat"+2*(suf[1]=='g'), suf[1]);
- xpopen_both((char *[]){toybuf, s, 0}, fds);
- close(fds[0]);
- return fds[1];
-}
-
-static char manpath()
-{
- if (*++TT.sct) return 0;
- if (!(TT.m = strsep(&TT.M, ":"))) return 1;
- TT.sct = TT.scts;
- return 0;
-}
-
-// Try opening all the possible file extensions.
-static int tryfile(char *name)
-{
- int dotnum, fd = -1;
- char *s = xmprintf("%s/man%s/%s.%s.bz2", TT.m, *TT.sct, name, *TT.sct), **suf;
- size_t len = strlen(s) - 4;
-
- for (dotnum = 0; dotnum <= 2; dotnum += 2) {
- suf = TT.sufs;
- while ((fd == -1) && *suf) strcpy(s + len - dotnum, *suf++), fd = zopen(s);
- // Recheck suf in zopen, because for x.1.gz name here it is "".
- }
- free(s);
- return fd;
-}
-
-void man_main(void)
-{
- int fd = -1;
- TT.scts = (char *[]) {"1", "8", "3", "2", "5", "4", "6", "7", 0};
- TT.sct = TT.scts - 1; // First manpath() read increments.
- TT.sufs = (char *[]) {".bz2", ".gz", ".xz", "", 0};
-
- if (!TT.M) TT.M = getenv("MANPATH");
- if (!TT.M) TT.M = "/usr/share/man";
-
- if (FLAG(k)) {
- char *d, *f;
- DIR *dp;
- struct dirent *entry;
-
- xregcomp(&TT.reg, TT.k, REG_ICASE|REG_NOSUB);
- while (!manpath()) {
- d = xmprintf("%s/man%s", TT.m, *TT.sct);
- if (!(dp = opendir(d))) continue;
- while ((entry = readdir(dp))) {
- if (entry->d_name[0] == '.') continue;
- f = xmprintf("%s/%s", d, TT.k = entry->d_name);
- if (-1 != (fd = zopen(f))) {
- TT.k_done = 0;
- do_lines(fd, '\n', do_man);
- }
- free(f);
- }
- closedir(dp);
- free(d);
- }
- return regfree(&TT.reg);
- }
-
- if (!toys.optc) help_exit("which page?");
-
- if (toys.optc == 1) {
- if (strchr(*toys.optargs, '/')) fd = zopen(*toys.optargs);
- else while ((fd == -1) && !manpath()) fd = tryfile(*toys.optargs);
- if (fd == -1) error_exit("no %s", *toys.optargs);
-
- // If they specified a section, look for file in that section
- } else {
- TT.scts = (char *[]){*toys.optargs, 0}, TT.sct = TT.scts - 1;
- while ((fd == -1) && !manpath()) fd = tryfile(toys.optargs[1]);
- if (fd == -1) error_exit("section %s no %s", *--TT.sct, toys.optargs[1]);
- }
-
- do_lines(fd, '\n', do_man);
-}
diff --git a/toys/pending/more.c b/toys/pending/more.c
index dbd429b4..79bb7bf9 100644
--- a/toys/pending/more.c
+++ b/toys/pending/more.c
@@ -39,7 +39,7 @@ static void signal_handler(int sig)
static void show_file_header(const char *name)
{
- printf("::::::::::::::\n%s\n::::::::::::::\n", name);
+ printf(":::::::::::::::::::::::\n%s\n:::::::::::::::::::::::\n", name);
}
static int prompt(FILE *cin, const char* fmt, ...)
@@ -65,31 +65,17 @@ static int prompt(FILE *cin, const char* fmt, ...)
}
}
-static int more_directory(char *path, struct stat *st)
-{
- if (!stat(path, st) && S_ISDIR(st->st_mode)) {
- printf("\n*** %s: directory ***\n\n", path);
- return 1;
- }
- return 0;
-}
-
static void do_cat_operation(int fd, char *name)
{
- struct stat st;
-
- if (!more_directory(name, &st)) {
- show_file_header(name);
- fflush(stdout);
- xsendfile(fd, 1);
- }
+ if (toys.optc > 1) show_file_header(name);
+ xsendfile(fd, 1);
}
void more_main()
{
int ch, input_key = 0, show_prompt;
unsigned rows = 24, cols = 80, row = 0, col = 0;
- struct stat st;
+ struct stat st;
struct termios newf;
FILE *fp, *cin;
@@ -111,23 +97,18 @@ void more_main()
sigatexit(signal_handler);
do {
- char *filename = *toys.optargs;
-
- st.st_size = show_prompt = col = row = 0;
- if (!filename) fp = stdin;
- else {
- if (more_directory(filename, &st)) goto next_file;
- if (!(fp = fopen(filename, "r"))) {
- perror_msg("%s", filename);
+ fp = stdin;
+ if (*toys.optargs && !(fp = fopen(*toys.optargs, "r"))) {
+ perror_msg("%s", *toys.optargs);
goto next_file;
- }
}
-
+ st.st_size = show_prompt = col = row = 0;
+ fstat(fileno(fp), &st);
terminal_size(&cols, &rows);
rows--;
if (toys.optc > 1) {
- show_file_header(filename);
+ show_file_header(*toys.optargs);
row += 3;
}
@@ -139,7 +120,7 @@ void more_main()
(long long)st.st_size);
else
input_key = prompt(cin, "--More--");
- if (input_key == 'q') goto stop;
+ if (input_key == 'q') goto stop;
col = row = show_prompt = 0;
terminal_size(&cols, &rows);
diff --git a/toys/pending/sh.c b/toys/pending/sh.c
index 147f5e7d..8a9e93b6 100644
--- a/toys/pending/sh.c
+++ b/toys/pending/sh.c
@@ -24,7 +24,7 @@
* TODO: make fake pty wrapper for test infrastructure
* TODO: // Handle embedded NUL bytes in the command line.
* TODO: var=val command
- * existing but considered builtins: false kill pwd true time
+ * existing but considered builtins: false kill pwd true
* buitins: alias bg command fc fg getopts jobs newgrp read umask unalias wait
* "special" builtins: break continue : . eval exec export readonly return set
* shift times trap unset
@@ -36,26 +36,15 @@
* ENV HOME IFS LANG LC_ALL LINENO PATH PPID PS1 PS2 PS4 PWD
* label:
* TODO: test exit from "trap EXIT" doesn't recurse
- * TODO: ! history expansion
- *
- * bash man page:
- * control operators || & && ; ;; ;& ;;& ( ) | |& <newline>
- * reserved words
- * ! case coproc do done elif else esac fi for function if in select
- * then until while { } time [[ ]]
-
-
USE_SH(NEWTOY(cd, NULL, TOYFLAG_NOFORK))
USE_SH(NEWTOY(exit, NULL, TOYFLAG_NOFORK))
USE_SH(NEWTOY(sh, "c:i", TOYFLAG_BIN))
USE_SH(OLDTOY(toysh, sh, TOYFLAG_BIN))
-USE_SH(OLDTOY(bash, sh, TOYFLAG_BIN))
// Login lies in argv[0], so add some aliases to catch that
USE_SH(OLDTOY(-sh, sh, 0))
USE_SH(OLDTOY(-toysh, sh, 0))
-USE_SH(OLDTOY(-bash, sh, 0))
config SH
bool "sh (toysh)"
@@ -69,7 +58,6 @@ config SH
-c command line to execute
-i interactive mode (default when STDIN is a tty)
-# These are here for the help text, they're not selectable and control nothing
config CD
bool
default n
@@ -100,39 +88,30 @@ GLOBALS(
char *command;
long lineno;
-
- struct double_list functions;
- unsigned options;
-
- // Running jobs.
- struct sh_job {
- struct sh_job *next, *prev;
- unsigned jobno;
-
- // Every pipeline has at least one set of arguments or it's Not A Thing
- struct sh_arg {
- char **v;
- int c;
- } pipeline;
-
- // null terminated array of running processes in pipeline
- struct sh_process {
- struct string_list *delete; // expanded strings
- int pid, exit; // status? Stopped? Exited?
- struct sh_arg arg;
- } *procs, *proc;
- } *jobs, *job;
- unsigned jobcnt;
)
-#define SH_NOCLOBBER 1 // set -C
+// What we know about a single process.
+struct command {
+ struct command *next;
+ int flags; // exit, suspend, && ||
+ int pid; // pid (or exit code)
+ int argc;
+ char *argv[0];
+};
+
+// A collection of processes piped into/waiting on each other.
+struct pipeline {
+ struct pipeline *next;
+ int job_id;
+ struct command *cmd;
+ char *cmdline; // Unparsed line for display purposes
+ int cmdlinelen; // How long is cmdline?
+};
void cd_main(void)
{
char *dest = *toys.optargs ? *toys.optargs : getenv("HOME");
-// TODO: -LPE@
-// TODO: cd .. goes up $PWD path we used to get here, not ./..
xchdir(dest ? dest : "/");
}
@@ -141,337 +120,90 @@ void exit_main(void)
exit(*toys.optargs ? atoi(*toys.optargs) : 0);
}
-// like error_msg() but exit from shell scripts
-void syntax_err(char *msg, ...)
-{
- va_list va;
-
- va_start(va, msg);
- verror_msg(msg, 0, va);
- va_end(va);
-
- if (*toys.optargs) xexit();
-}
-
-// Print prompt, parsing escapes
-static void do_prompt(char *prompt)
-{
- char *s, c, cc;
-
- if (!prompt) prompt = "\\$ ";
- while (*prompt) {
- c = *(prompt++);
-
- if (c=='!') {
- if (*prompt=='!') prompt++;
- else {
- printf("%ld", TT.lineno);
- continue;
- }
- } else if (c=='\\') {
- int i = 0;
-
- cc = *(prompt++);
- if (!cc) goto down;
-
- // \nnn \dD{}hHjlstT@AuvVwW!#$
- // Ignore bash's "nonprintable" hack; query our cursor position instead.
- if (cc=='[' || cc==']') continue;
- else if (cc=='$') putchar(getuid() ? '$' : '#');
- else if (cc=='h' || cc=='H') {
- *toybuf = 0;
- gethostname(toybuf, sizeof(toybuf)-1);
- if (cc=='h' && (s = strchr(toybuf, '.'))) *s = 0;
- fputs(toybuf, stdout);
- } else if (cc=='s') fputs(getbasename(*toys.argv), stdout);
- else {
- if (!(c = unescape(cc))) {
- c = '\\';
- prompt--;
- }
- i++;
- }
- if (!i) continue;
- }
-down:
- putchar(c);
- }
- fflush(stdout);
-}
-
-// quote removal, brace, tilde, parameter/variable, $(command),
-// $((arithmetic)), split, path
-#define NO_PATH (1<<0)
-#define NO_SPLIT (1<<1)
-// TODO: ${name:?error} causes an error/abort here (syntax_err longjmp?)
-// TODO: $1 $@ $* need args marshalled down here: function+structure?
-// arg = append to this
-// new = string to expand
-// flags = type of expansions (not) to do
-// delete = append new allocations to this so they can be freed later
-// TODO: at_args: $1 $2 $3 $* $@
-static void expand_arg(struct sh_arg *arg, char *new, unsigned flags,
- struct string_list **delete)
-{
- if (!(arg->c&32)) arg->v = xrealloc(arg->v, sizeof(void *)*(arg->c+33));
-
- arg->v[arg->c++] = new;
- arg->v[arg->c] = 0;
-
-/*
- char *s = word, *new = 0;
-
- // replacement
- while (*s) {
- if (*s == '$') {
- s++;
- } else if (*strchr("*?[{", *s)) {
- s++;
- } else if (*s == '<' || *s == '>') {
- s++;
- } else s++;
- }
-
- return new;
-*/
-}
-
-// Assign one variable
-// s: key=val
-// type: 0 = whatever it was before, local otherwise
-#define TAKE_MEM 0x80000000
-// declare -aAilnrux
-// ft
-void setvar(char *s, unsigned type)
-{
- if (type&TAKE_MEM) type ^= TAKE_MEM;
- else s = xstrdup(s);
-
- // local, export, readonly, integer...
- xsetenv(s, 0);
-}
-
-char *getvar(char *s)
-{
- return getenv(s);
-}
-
-// return length of match found at this point
-static int anystart(char *s, char **try)
+// Parse one word from the command line, appending one or more argv[] entries
+// to struct command. Handles environment variable substitution and
+// substrings. Returns pointer to next used byte, or NULL if it
+// hit an ending token.
+static char *parse_word(char *start, struct command **cmd)
{
- while (*try) {
- if (strstart(&s, *try)) return strlen(*try);
- try++;
- }
-
- return 0;
-}
-
-static int anystr(char *s, char **try)
-{
- while (*try) if (!strcmp(s, *try++)) return 1;
+ char *end;
- return 0;
-}
+ // Detect end of line (and truncate line at comment)
+ if (strchr("><&|(;", *start)) return 0;
-// return length of valid prefix that could go before redirect
-int redir_prefix(char *word)
-{
- char *s = word;
+ // Grab next word. (Add dequote and envvar logic here)
+ end = start;
+ while (*end && !isspace(*end)) end++;
+ (*cmd)->argv[(*cmd)->argc++] = xstrndup(start, end-start);
- if (*s == '{') {
- for (s++; isalnum(*s) || *s=='_'; s++);
- if (*s == '}' && s != word+1) s++;
- else s = word;
- } else while (isdigit(*s)) s++;
+ // Allocate more space if there's no room for NULL terminator.
- return s-word;
+ if (!((*cmd)->argc & 7))
+ *cmd=xrealloc(*cmd,
+ sizeof(struct command) + ((*cmd)->argc+8)*sizeof(char *));
+ (*cmd)->argv[(*cmd)->argc] = 0;
+ return end;
}
-// TODO |&
+// Parse a line of text into a pipeline.
+// Returns a pointer to the next line.
-// rd[0] = next, 1 = prev, 2 = len, 3-x = to/from redirection pairs.
-// Execute the commands in a pipeline segment
-struct sh_process *run_command(struct sh_arg *arg, int **rdlist)
+static char *parse_pipeline(char *cmdline, struct pipeline *line)
{
- struct sh_process *pp = xzalloc(sizeof(struct sh_process));
- struct toy_list *tl;
- char *s, *ss, *sss;
- unsigned envlen, j;
- int fd, here = 0, rdcount = 0, *rd = 0, *rr, hfd = 0;
-
- // Grab variable assignments
- for (envlen = 0; envlen<arg->c; envlen++) {
- s = arg->v[envlen];
- for (j=0; s[j] && (s[j]=='_' || !ispunct(s[j])); j++);
- if (!j || s[j] != '=') break;
- }
+ struct command **cmd = &(line->cmd);
+ char *start = line->cmdline = cmdline;
- // perform assignments locally if there's no command
- if (envlen == arg->c) {
- for (j = 0; j<envlen; j++) {
- struct sh_arg aa;
+ if (!cmdline) return 0;
- aa.c = 0;
- expand_arg(&aa, arg->v[j], NO_PATH|NO_SPLIT, 0);
- setvar(*aa.v, TAKE_MEM);
- free(aa.v);
- }
- free(pp);
+ line->cmdline = cmdline;
- return 0;
- }
-
- // We vfork() instead of fork to support nommu systems, and do
- // redirection setup in the parent process. Open new filehandles
- // and move them to temporary values >10. The rd[] array has pairs of
- // filehandles: child replaces fd1 with fd2 via dup2() and close() after
- // the vfork(). fd2 is <<1, if bottom bit set don't close it (dup instead).
- // If fd2 < 0 it's a here document (parent process writes to a pipe later).
-
- // Expand arguments and perform redirections
- for (j = envlen; j<arg->c; j++) {
-
- // Is this a redirect?
- ss = (s = arg->v[j]) + redir_prefix(arg->v[j]);
- if (!anystr(ss, (char *[]){"<<<", "<<-", "<<", "<&", "<>", "<", ">>", ">&",
- ">|", ">", "&>>", "&>", 0}))
- {
- // Nope: save/expand argument and loop
- expand_arg(&pp->arg, s, 0, 0);
-
- continue;
- }
+ // Parse command into argv[]
+ for (;;) {
+ char *end;
- // Yes. Expand rd[] and find first unused filehandle >10
- if (!(rdcount&31)) {
- if (rd) dlist_lpop((void *)rdlist);
- rd = xrealloc(rd, (2*rdcount+3+2*32)*sizeof(int *));
- dlist_add_nomalloc((void *)rdlist, (void *)rd);
+ // Skip leading whitespace and detect end of line.
+ while (isspace(*start)) start++;
+ if (!*start || *start=='#') {
+ line->cmdlinelen = start-cmdline;
+ return 0;
}
- rr = rd+3+rdcount;
- if (!hfd)
- for (hfd = 10; hfd<99999; hfd++) if (-1 == fcntl(hfd, F_GETFL)) break;
-
- // error check: premature EOF, target fd too high, or redirect file splits
- if (++j == arg->c || (isdigit(*s) && ss-s>5)) goto flush;
- fd = pp->arg.c;
- // expand arguments for everything but << and <<-
- if (strncmp(ss, "<<", 2) || ss[2] == '<') {
- expand_arg(&pp->arg, arg->v[j], NO_PATH|(NO_SPLIT*!strcmp(ss, "<<<")), 0);
- if (fd+1 != pp->arg.c) goto flush;
- sss = pp->arg.v[--pp->arg.c];
- } else dlist_add((void *)&pp->delete, sss = xstrdup(arg->v[j]));
+ // Allocate next command structure if necessary
+ if (!*cmd) *cmd = xzalloc(sizeof(struct command)+8*sizeof(char *));
- // rd[] entries come in pairs: first is which fd gets redirected after
- // vfork(), I.E. the [n] part of [n]<word
+ // Parse next argument and add the results to argv[]
+ end = parse_word(start, cmd);
- if (isdigit(*ss)) fd = atoi(ss);
- else if (*ss == '{') {
- ss++;
- // when we close a filehandle, we _read_ from {var}, not write to it
- if ((!strcmp(s, "<&") || !strcmp(s, ">&")) && !strcmp(sss, "-")) {
- ss = xstrndup(ss, (s-ss)-1);
- sss = getvar(ss);
- free(ss);
- fd = -1;
- if (sss) fd = atoi(sss);
- if (fd<0) goto flush;
- if (fd>2) {
- rr[0] = fd;
- rr[1] = fd<<1; // close it
- rdcount++;
+ // If we hit the end of this command, how did it end?
+ if (!end) {
+ if (*start) {
+ if (*start==';') {
+ start++;
+ break;
}
- continue;
- } else setvar(xmprintf("%.*s=%d", (int)(s-ss), ss, hfd), TAKE_MEM);
- } else fd = *ss != '<';
- *rr = fd;
-
- // at this point for [n]<word s = start of [n], ss = start of <, sss = word
-
- // second entry in this rd[] pair is new fd to dup2() after vfork(),
- // I.E. for [n]<word the fd if you open("word"). It's stored <<1 and the
- // low bit set means don't close(rr[1]) after dup2(rr[1]>>1, rr[0]);
-
- // fd<0 means HERE document. Canned input stored earlier, becomes pipe later
- if (!strcmp(s, "<<<") || !strcmp(s, "<<-") || !strcmp(s, "<<")) {
- fd = --here<<2;
- if (s[2] == '-') fd += 1; // zap tabs
- if (s[strcspn(s, "\"'")]) fd += 2; // it was quoted so no expansion
- rr[1] = fd;
- rdcount++;
-
- continue;
- }
-
- // Handle file descriptor duplication/close (&> &>> <& >& with number or -)
- if (strchr(ss, '&') && ss[2] != '>') {
- char *dig = sss;
-
- // These redirect existing fd so nothing to open()
- while (isdigit(dig)) dig++;
- if (dig-sss>5) {
- s = sss;
- goto flush;
- }
-
-// TODO can't check if fd is open here, must do it when actual redirects happen
- if (!*dig || (*dig=='-' && !dig[1])) {
- rr[1] = (((dig==sss) ? *rr : atoi(sss))<<1)+(*dig != '-');
- rdcount++;
-
- continue;
- }
- }
-
- // Permissions to open external file with: < > >> <& >& <> >| &>> &>
- if (!strcmp(ss, "<>")) fd = O_CREAT|O_RDWR;
- else if (strstr(ss, ">>")) fd = O_CREAT|O_APPEND;
- else {
- fd = (*ss != '<') ? O_CREAT|O_WRONLY|O_TRUNC : O_RDONLY;
- if (!strcmp(ss, ">") && (TT.options&SH_NOCLOBBER)) {
- struct stat st;
-
- // Not _just_ O_EXCL: > /dev/null allowed
- if (stat(sss, &st) || !S_ISREG(st.st_mode)) fd |= O_EXCL;
+ // handle | & < > >> << || &&
}
+ break;
}
-
- // Open the file
-// TODO: /dev/fd/# /dev/{stdin,stdout,stderr} /dev/{tcp,udp}/host/port
- if (-1 == (fd = xcreate(sss, fd|WARN_ONLY, 777)) || hfd != dup2(fd, hfd)) {
- pp->exit = 1;
- s = 0;
-
- goto flush;
- }
- if (fd != hfd) close(fd);
- rr[1] = hfd<<1;
- rdcount++;
-
- // queue up a 2>&1 ?
- if (strchr(ss, '&')) {
- if (!(31&++rdcount)) rd = xrealloc(rd, (2*rdcount+66)*sizeof(int *));
- rr = rd+3+rdcount;
- rr[0] = 2;
- rr[1] = 1+(1<<1);
- rdcount++;
- }
+ start = end;
}
- if (rd) rd[2] = rdcount;
-// TODO: ok, now _use_ in_rd[in_rdcount] and rd[rdcount]. :)
+ line->cmdlinelen = start-cmdline;
-// TODO: handle ((math)) here
+ return start;
+}
-// TODO use envlen
-// TODO: check for functions
+// Execute the commands in a pipeline
+static void run_pipeline(struct pipeline *line)
+{
+ struct toy_list *tl;
+ struct command *cmd = line->cmd;
+ if (!cmd || !cmd->argc) return;
+
+ tl = toy_find(cmd->argv[0]);
// Is this command a builtin that should run in this process?
- if ((tl = toy_find(*pp->arg.v))
- && (tl->flags & (TOYFLAG_NOFORK|TOYFLAG_MAYFORK)))
- {
+ if (tl && (tl->flags & TOYFLAG_NOFORK)) {
struct toy_context temp;
sigjmp_buf rebound;
@@ -479,807 +211,125 @@ struct sh_process *run_command(struct sh_arg *arg, int **rdlist)
memcpy(&temp, &toys, sizeof(struct toy_context));
memset(&toys, 0, sizeof(struct toy_context));
-// TODO: redirect stdin/out
if (!sigsetjmp(rebound, 1)) {
toys.rebound = &rebound;
-// must be null terminated
- toy_init(tl, pp->arg.v);
+ toy_init(tl, cmd->argv);
tl->toy_main();
}
- pp->exit = toys.exitval;
+ cmd->pid = toys.exitval;
if (toys.optargs != toys.argv+1) free(toys.optargs);
if (toys.old_umask) umask(toys.old_umask);
memcpy(&toys, &temp, sizeof(struct toy_context));
} else {
- int pipe[2];
+ int status;
- pipe[0] = 0;
- pipe[1] = 1;
-// TODO: redirect and pipe
-// TODO: redirecting stderr needs xpopen3() or rethink
- if (-1 == (pp->pid = xpopen_both(pp->arg.v, pipe)))
- perror_msg("%s: vfork", *pp->arg.v);
-// TODO: don't close stdin/stdout!
- else pp->exit = xpclose_both(pp->pid, 0);
- }
+ cmd->pid = vfork();
+ if (!cmd->pid) xexec(cmd->argv);
+ else waitpid(cmd->pid, &status, 0);
- s = 0;
-flush:
- if (s) {
- syntax_err("bad %s", s);
- if (!pp->exit) pp->exit = 1;
+ if (WIFEXITED(status)) cmd->pid = WEXITSTATUS(status);
+ if (WIFSIGNALED(status)) cmd->pid = WTERMSIG(status);
}
- for (j = 0; j<rdcount; j++) if (rd[4+2*j]>6) close(rd[4+2*j]>>1);
- if (rdcount) free(dlist_lpop((void *)rdlist));
- return pp;
+ return;
}
-// parse next word from command line. Returns end, or 0 if need continuation
-// caller eats leading spaces
-static char *parse_word(char *start)
+// Free the contents of a command structure
+static void free_cmd(void *data)
{
- int i, j, quote = 0, q, qc = 0;
- char *end = start, *s;
-
- // (( is a special quote at the start of a word
- if (strstart(&end, "((")) toybuf[quote++] = 255;
-
- // find end of this word
- while (*end) {
- i = 0;
-
- // barf if we're near overloading quote stack (nesting ridiculously deep)
- if (quote>4000) {
- syntax_err("tilt");
- return (void *)1;
- }
-
- q = quote ? toybuf[quote-1] : 0;
- // Handle quote contexts
- if (q) {
-
- // when waiting for parentheses, they nest
- if ((q == ')' || q == '\xff') && (*end == '(' || *end == ')')) {
- if (*end == '(') qc++;
- else if (qc) qc--;
- else if (q == '\xff') {
- // (( can end with )) or retroactively become two (( if we hit one )
- if (strstart(&end, "))")) quote--;
- else return start+1;
- }
- end++;
-
- // end quote?
- } else if (*end == q) quote--, end++;
-
- // single quote claims everything
- else if (q == '\'') end++;
- else i++;
-
- // loop if we already handled a symbol
- if (!i) continue;
- } else {
- // Things that only matter when unquoted
+ struct command *cmd=(struct command *)data;
- if (isspace(*end)) break;
-
- // Things we should only return at the _start_ of a word
-
- // Redirections. 123<<file- parses as 2 args: "123<<" "file-".
- // Greedy matching: >&; becomes >& ; not > &;
- s = end + redir_prefix(end);
- j = anystart(s, (char *[]){"<<<", "<<-", "<<", "<&", "<>", "<", ">>",
- ">&", ">|", ">", 0});
- if (j) s += j;
-
- // Control characters
- else s = end + anystart(end, (char *[]){";;&", ";;", ";&", ";", "||",
- "|&", "|", "&&", "&>>", "&>", "&", "(", ")", 0});
- if (s != end) return (end == start) ? s : end;
- i++;
- }
-
- // Things the same unquoted or in most non-single-quote contexts
-
- // start new quote context?
- if (strchr("\"'`", *end)) toybuf[quote++] = *end++;
- else if (q != '"' && (strstart(&end, "<(") || strstart(&end,">(")))
- toybuf[quote++]=')';
-
- // backslash escapes
- else if (*end == '\\') {
- if (!end[1] || (end[1]=='\n' && !end[2])) return 0;
- end += 2;
- } else if (*end++ == '$') {
- if (-1 != (i = stridx("({[", *end))) {
- toybuf[quote++] = ")}]"[i];
- end++;
- }
- }
- }
-
- return quote ? 0 : end;
+ while(cmd->argc) free(cmd->argv[--cmd->argc]);
}
-// if then fi for while until select done done case esac break continue return
-// Allocate more space for arg, and possibly terminator
-void argxtend(struct sh_arg *arg)
+// Parse a command line and do what it says to do.
+static void handle(char *command)
{
- if (!(arg->c&31)) arg->v = xrealloc(arg->v, (33+arg->c)*sizeof(void *));
-}
-
-// Pipeline segments
-struct sh_pipeline {
- struct sh_pipeline *next, *prev;
- int count, here, type;
- struct sh_arg arg[1];
-};
+ struct pipeline line;
+ char *start = command;
-// run a series of "command | command && command" with redirects.
-int run_pipeline(struct sh_pipeline **pl, int *rd)
-{
- struct sh_process *pp;
- int rc = 0;
+ // Loop through commands in this line
for (;;) {
-// TODO job control
- if (!(pp = run_command((*pl)->arg, &rd))) rc = 0;
- else {
-//wait4(pp);
- llist_traverse(pp->delete, free);
- rc = pp->exit;
- free(pp);
- }
-
- if ((*pl)->next && !(*pl)->next->type) *pl = (*pl)->next;
- else return rc;
- }
-}
-
-
-
-// scratch space (state held between calls). Don't want to make it global yet
-// because this could be reentrant.
-struct sh_function {
- char *name;
- struct sh_pipeline *pipeline;
- struct double_list *expect;
-// TODO: lifetime rules for arg? remember "shift" command.
- struct sh_arg *arg; // arguments to function call
- char *end;
-};
-// Free one pipeline segment.
-void free_pipeline(void *pipeline)
-{
- struct sh_pipeline *pl = pipeline;
- int i, j;
+ // Parse a group of connected commands
- if (pl) for (j=0; j<=pl->count; j++) {
- for (i = 0; i<=pl->arg->c; i++) free(pl->arg[j].v[i]);
- free(pl->arg[j].v);
- }
- free(pl);
-}
+ memset(&line,0,sizeof(struct pipeline));
+ start = parse_pipeline(start, &line);
+ if (!line.cmd) break;
-// Return end of current block, or NULL if we weren't in block and fell off end.
-struct sh_pipeline *block_end(struct sh_pipeline *pl)
-{
- int i = 0;
+ // Run those commands
- while (pl) {
- if (pl->type == 1 || pl->type == 'f') i++;
- else if (pl->type == 3) if (--i<1) break;
- pl = pl->next;
+ run_pipeline(&line);
+ llist_traverse(line.cmd, free_cmd);
}
-
- return 0;
-}
-
-void free_function(struct sh_function *sp)
-{
- llist_traverse(sp->pipeline, free_pipeline);
- llist_traverse(sp->expect, free);
- memset(sp, 0, sizeof(struct sh_function));
-}
-
-// TODO this has to add to a namespace context. Functions within functions...
-struct sh_pipeline *add_function(char *name, struct sh_pipeline *pl)
-{
-dprintf(2, "stub add_function");
-
- return block_end(pl->next);
}
-// Add a line of shell script to a shell function. Returns 0 if finished,
-// 1 to request another line of input (> prompt), -1 for syntax err
-static int parse_line(char *line, struct sh_function *sp)
+static void do_prompt(void)
{
- char *start = line, *delete = 0, *end, *last = 0, *s, *ex, done = 0;
- struct sh_pipeline *pl = sp->pipeline ? sp->pipeline->prev : 0;
- struct sh_arg *arg = 0;
- long i;
-
- // Resume appending to last statement?
- if (pl) {
- arg = pl->arg;
-
- // Extend/resume quoted block
- if (arg->c<0) {
- delete = start = xmprintf("%s%s", arg->v[arg->c = (-arg->c)-1], start);
- free(arg->v[arg->c]);
- arg->v[arg->c] = 0;
-
- // is a HERE document in progress?
- } else if (pl->count != pl->here) {
- arg += 1+pl->here;
-
- argxtend(arg);
- if (strcmp(line, arg->v[arg->c])) {
- // Add this line
- arg->v[arg->c+1] = arg->v[arg->c];
- arg->v[arg->c++] = xstrdup(line);
- // EOF hit, end HERE document
- } else {
- arg->v[arg->c] = 0;
- pl->here++;
- }
- start = 0;
-
- // Nope, new segment
- } else pl = 0;
- }
-
- // Parse words, assemble argv[] pipelines, check flow control and HERE docs
- if (start) for (;;) {
- ex = sp->expect ? sp->expect->prev->data : 0;
+ char *prompt = getenv("PS1"), *s, c, cc;
- // Look for << HERE redirections in completed pipeline segment
- if (pl && pl->count == -1) {
- pl->count = 0;
- arg = pl->arg;
-
- // find arguments of the form [{n}]<<[-] with another one after it
- for (i = 0; i<arg->c; i++) {
- s = arg->v[i] + redir_prefix(arg->v[i]);
- if (strcmp(s, "<<") && strcmp(s, "<<-") && strcmp(s, "<<<")) continue;
- if (i+1 == arg->c) goto flush;
-
- // Add another arg[] to the pipeline segment (removing/readding to list
- // because realloc can move pointer)
- dlist_lpop(&sp->pipeline);
- pl = xrealloc(pl, sizeof(*pl) + ++pl->count*sizeof(struct sh_arg));
- dlist_add_nomalloc((void *)&sp->pipeline, (void *)pl);
-
- // queue up HERE EOF so input loop asks for more lines.
- arg[pl->count].v = xzalloc(2*sizeof(void *));
- *arg[pl->count].v = arg->v[++i];
- arg[pl->count].c = -(s[2] == '<'); // note <<< as c = -1
- }
- pl = 0;
- }
- if (done) break;
- s = 0;
-
- // skip leading whitespace/comment here to know where next word starts
- for (;;) {
- if (isspace(*start)) ++start;
- else if (*start=='#') while (*start && *start != '\n') ++start;
- else break;
- }
-
- // Parse next word and detect overflow (too many nested quotes).
- if ((end = parse_word(start)) == (void *)1)
- goto flush;
-
- // Is this a new pipeline segment?
- if (!pl) {
- pl = xzalloc(sizeof(struct sh_pipeline));
- arg = pl->arg;
- dlist_add_nomalloc((void *)&sp->pipeline, (void *)pl);
- }
- argxtend(arg);
-
- // Do we need to request another line to finish word (find ending quote)?
- if (!end) {
- // Save unparsed bit of this line, we'll need to re-parse it.
- arg->v[arg->c] = xstrndup(start, strlen(start));
- arg->c = -(arg->c+1);
- free(delete);
-
- return 1;
- }
-
- // Ok, we have a word. What does it _mean_?
-
- // Did we hit end of line or ) outside a function declaration?
- // ) is only saved at start of a statement, ends current statement
- if (end == start || (arg->c && *start == ')' && pl->type!='f')) {
- arg->v[arg->c] = 0;
-
- if (pl->type == 'f' && arg->c<3) {
- s = "function()";
- goto flush;
- }
-
- // "for" on its own line is an error.
- if (arg->c == 1 && ex && !memcmp(ex, "do\0A", 4)) {
- s = "newline";
- goto flush;
- }
-
- // don't save blank pipeline segments
- if (!arg->c) free_pipeline(dlist_lpop(&sp->pipeline));
-
- // stop at EOL, else continue with new pipeline segment for )
- if (end == start) done++;
- pl->count = -1;
- last = 0;
-
- continue;
- }
-
- // Save argument (strdup) and check for flow control
- s = arg->v[arg->c] = xstrndup(start, end-start);
- start = end;
- if (strchr(";|&", *s)) {
-
- // flow control without a statement is an error
- if (!arg->c) goto flush;
-
- // treat ; as newline so we don't have to check both elsewhere.
- if (!strcmp(s, ";")) {
- arg->v[arg->c] = 0;
- free(s);
- s = 0;
- }
- last = s;
- pl->count = -1;
-
- continue;
- } else arg->v[++arg->c] = 0;
-
- // is a function() in progress?
- if (arg->c>1 && !strcmp(s, "(")) pl->type = 'f';
- if (pl->type=='f') {
- if (arg->c == 2 && strcmp(s, "(")) goto flush;
- if (arg->c == 3) {
- if (strcmp(s, ")")) goto flush;
-
- // end function segment, expect function body
- pl->count = -1;
- last = 0;
- dlist_add(&sp->expect, "}");
- dlist_add(&sp->expect, 0);
- dlist_add(&sp->expect, "{");
-
- continue;
- }
-
- // a for/select must have at least one additional argument on same line
- } else if (ex && !memcmp(ex, "do\0A", 4)) {
-
- // Sanity check and break the segment
- if (strncmp(s, "((", 2) && strchr(s, '=')) goto flush;
- pl->count = -1;
- sp->expect->prev->data = "do\0C";
-
- continue;
-
- // flow control is the first word of a pipeline segment
- } else if (arg->c>1) continue;
-
- // Do we expect something that _must_ come next? (no multiple statements)
- if (ex) {
- // When waiting for { it must be next symbol, but can be on a new line.
- if (!strcmp(ex, "{")) {
- if (strcmp(s, "{")) goto flush;
- free(arg->v[--arg->c]); // don't save the {, function starts the block
- free(dlist_lpop(&sp->expect));
-
- continue;
-
- // The "test" part of for/select loops can have (at most) one "in" line,
- // for {((;;))|name [in...]} do
- } else if (!memcmp(ex, "do\0C", 4)) {
- if (strcmp(s, "do")) {
- // can only have one "in" line between for/do, but not with for(())
- if (!pl->prev->type) goto flush;
- if (!strncmp(pl->prev->arg->v[1], "((", 2)) goto flush;
- else if (strcmp(s, "in")) goto flush;
-
- continue;
- }
- }
- }
-
- // start of a new block?
-
- // for/select requires variable name on same line, can't break segment yet
- if (!strcmp(s, "for") || !strcmp(s, "select")) {
- if (!pl->type) pl->type = 1;
- dlist_add(&sp->expect, "do\0A");
-
- continue;
- }
-
- end = 0;
- if (!strcmp(s, "if")) end = "then";
- else if (!strcmp(s, "while") || !strcmp(s, "until")) end = "do\0B";
- else if (!strcmp(s, "case")) end = "esac";
- else if (!strcmp(s, "{")) end = "}";
- else if (!strcmp(s, "[[")) end = "]]";
- else if (!strcmp(s, "(")) end = ")";
-
- // Expecting NULL means a statement: I.E. any otherwise unrecognized word
- else if (sp->expect && !ex) {
- free(dlist_lpop(&sp->expect));
- continue;
- } else if (!ex) goto check;
-
- // Did we start a new statement?
- if (end) {
- pl->type = 1;
-
- // Only innermost statement needed in { { { echo ;} ;} ;} and such
- if (sp->expect && !sp->expect->prev->data) free(dlist_lpop(&sp->expect));
-
- // If we got here we expect a specific word to end this block: is this it?
- } else if (!strcmp(s, ex)) {
- // can't "if | then" or "while && do", only ; & or newline works
- if (last && (strcmp(ex, "then") || strcmp(last, "&"))) {
- s = end;
- goto flush;
- }
-
- free(dlist_lpop(&sp->expect));
- pl->type = anystr(s, (char *[]){"fi", "done", "esac", "}", "]]", ")", 0})
- ? 3 : 2;
-
- // if it's a multipart block, what comes next?
- if (!strcmp(s, "do")) end = "done";
- else if (!strcmp(s, "then")) end = "fi\0A";
-
- // fi could have elif, which queues a then.
- } else if (!strcmp(ex, "fi")) {
- if (!strcmp(s, "elif")) {
- free(dlist_lpop(&sp->expect));
- end = "then";
- // catch duplicate else while we're here
- } else if (!strcmp(s, "else")) {
- if (ex[3] != 'A') {
- s = "2 else";
- goto flush;
- }
- free(dlist_lpop(&sp->expect));
- end = "fi\0B";
- }
- }
-
- // Do we need to queue up the next thing to expect?
- if (end) {
- if (!pl->type) pl->type = 2;
- dlist_add(&sp->expect, end);
- dlist_add(&sp->expect, 0); // they're all preceded by a statement
- pl->count = -1;
- }
-
-check:
- // syntax error check: these can't be the first word in an unexpected place
- if (!pl->type && anystr(s, (char *[]){"then", "do", "esac", "}", "]]", ")",
- "done", "fi", "elif", "else", 0})) goto flush;
- }
- free(delete);
-
- // advance past <<< arguments (stored as here documents, but no new input)
- pl = sp->pipeline->prev;
- while (pl->count<pl->here && pl->arg[pl->count].c<0)
- pl->arg[pl->count++].c = 0;
-
- // return if HERE document pending or more flow control needed to complete
- if (sp->expect) return 1;
- if (sp->pipeline && pl->count != pl->here) return 1;
- dlist_terminate(sp->pipeline);
-
- // Don't need more input, can start executing.
-
- return 0;
-
-flush:
- if (s) syntax_err("bad %s", s);
- free_function(sp);
-
- return 0-!!s;
-}
-
-static void dump_state(struct sh_function *sp)
-{
- struct sh_pipeline *pl;
- int q = 0;
- long i;
-
- if (sp->expect) {
- struct double_list *dl;
-
- for (dl = sp->expect; dl; dl = (dl->next == sp->expect) ? 0 : dl->next)
- dprintf(2, "expecting %s\n", dl->data);
- if (sp->pipeline)
- dprintf(2, "pipeline count=%d here=%d\n", sp->pipeline->prev->count,
- sp->pipeline->prev->here);
- }
-
- for (pl = sp->pipeline; pl ; pl = (pl->next == sp->pipeline) ? 0 : pl->next) {
- for (i = 0; i<pl->arg->c; i++)
- printf("arg[%d][%ld]=%s\n", q, i, pl->arg->v[i]);
- printf("type=%d term[%d]=%s\n", pl->type, q++, pl->arg->v[pl->arg->c]);
- }
-}
-
-/* Flow control statements:
-
- if/then/elif/else/fi, for select while until/do/done, case/esac,
- {/}, [[/]], (/), function assignment
-*/
-
-
-
-// run a shell function, handling flow control statements
-static void run_function(struct sh_function *sp)
-{
- struct sh_pipeline *pl = sp->pipeline, *end;
- struct blockstack {
- struct blockstack *next;
- struct sh_pipeline *start, *end;
- int run, loop, *redir;
-
- struct sh_arg farg; // for/select arg stack
- struct string_list *fdelete; // farg's cleanup list
- char *fvar; // for/select's iteration variable name
- } *blk = 0, *new;
- long i;
-
- // iterate through the commands
- while (pl) {
- char *s = *pl->arg->v, *ss = pl->arg->v[1];
-//dprintf(2, "s=%s %s %d %s %d\n", s, ss, pl->type, blk ? blk->start->arg->v[0] : "X", blk ? blk->run : 0);
- // Normal executable statement?
- if (!pl->type) {
-// TODO: break & is supported? Seriously? Also break > potato
-// TODO: break multiple aguments
- if (!strcmp(s, "break") || !strcmp(s, "continue")) {
-
- // How many layers to peel off?
- i = ss ? atol(ss) : 0;
- if (i<1) i = 1;
- if (!blk || pl->arg->c>2 || ss[strspn(ss, "0123456789")]) {
- syntax_err("bad %s", s);
- break;
- }
- i = atol(ss);
- if (!i) i++;
- while (i && blk) {
- if (--i && *s == 'c') {
- pl = blk->start;
- break;
- }
- pl = blk->end;
- llist_traverse(blk->fdelete, free);
- free(llist_pop(&blk));
- }
- pl = pl->next;
+ if (!prompt) prompt = "\\$ ";
+ while (*prompt) {
+ c = *(prompt++);
+ if (c=='!') {
+ if (*prompt=='!') prompt++;
+ else {
+ printf("%ld", TT.lineno);
continue;
}
+ } else if (c=='\\') {
+ cc = *(prompt++);
+ if (!cc) goto down;
-// inherit redirects?
-// returns last statement of pipeline
- if (!blk) toys.exitval = run_pipeline(&pl, 0);
- else if (blk->run) toys.exitval = run_pipeline(&pl, blk->redir);
- else while (pl->next && !pl->next->type) pl = pl->next;
-
- // Starting a new block?
- } else if (pl->type == 1) {
-
- // are we entering this block (rather than looping back to it)?
- if (!blk || blk->start != pl) {
-
- // If it's a nested block we're not running, skip ahead.
- end = block_end(pl->next);
- if (blk && !blk->run) {
- pl = end;
- if (pl) pl = pl->next;
- continue;
- }
-
- // It's a new block we're running, save context and add it to the stack.
- new = xzalloc(sizeof(*blk));
- new->next = blk;
- blk = new;
- blk->start = pl;
- blk->end = end;
- blk->run = 1;
-// TODO perform block end redirects to blk->redir
- }
-
- // What flow control statement is this?
-
- // if/then/elif/else/fi, while until/do/done - no special handling needed
-
- // for select/do/done
- if (!strcmp(s, "for") || !strcmp(s, "select")) {
- if (blk->loop);
- else if (!strncmp(blk->fvar = ss, "((", 2)) {
- blk->loop = 1;
-dprintf(2, "TODO skipped init for((;;)), need math parser\n");
- } else {
-
- // populate blk->farg with expanded arguments
- if (!pl->next->type) {
- for (i = 1; i<pl->next->arg->c; i++)
- expand_arg(&blk->farg, pl->next->arg->v[i], 0, &blk->fdelete);
- } else expand_arg(&blk->farg, "\"$@\"", 0, &blk->fdelete);
+ // \nnn \dD{}hHjlstT@AuvVwW!#$
+ // Ignore bash's "nonprintable" hack; query our cursor position instead.
+ if (cc=='[' || cc==']') continue;
+ else if (cc=='$') putchar(getuid() ? '$' : '#');
+ else if (cc=='h' || cc=='H') {
+ *toybuf = 0;
+ gethostname(toybuf, sizeof(toybuf)-1);
+ if (cc=='h' && (s = strchr(toybuf, '.'))) *s = 0;
+ fputs(toybuf, stdout);
+ } else if (cc=='s') fputs(getbasename(*toys.argv), stdout);
+ else {
+ if (!(c = unescape(cc))) {
+ c = '\\';
+ prompt--;
}
- pl = pl->next;
- }
-
-/* TODO
-case/esac
-{/}
-[[/]]
-(/)
-((/))
-function/}
-*/
- // gearshift from block start to block body
- } else if (pl->type == 2) {
-
- // Handle if statement
- if (!strcmp(s, "then")) blk->run = blk->run && !toys.exitval;
- else if (!strcmp(s, "else") || !strcmp(s, "elif")) blk->run = !blk->run;
- else if (!strcmp(s, "do")) {
- ss = *blk->start->arg->v;
- if (!strcmp(ss, "while")) blk->run = blk->run && !toys.exitval;
- else if (!strcmp(ss, "until")) blk->run = blk->run && toys.exitval;
- else if (blk->loop >= blk->farg.c) {
- blk->run = 0;
- pl = block_end(pl);
- continue;
- } else if (!strncmp(blk->fvar, "((", 2)) {
-dprintf(2, "TODO skipped running for((;;)), need math parser\n");
- } else setvar(xmprintf("%s=%s", blk->fvar, blk->farg.v[blk->loop++]),
- TAKE_MEM);
- }
-
- // end of block
- } else if (pl->type == 3) {
-
- // repeating block?
- if (blk->run && !strcmp(s, "done")) {
- pl = blk->start;
- continue;
+ goto down;
}
-
- // if ending a block, pop stack.
- llist_traverse(blk->fdelete, free);
- free(llist_pop(&blk));
-
-// TODO unwind redirects (cleanup blk->redir)
-
- } else if (pl->type == 'f') pl = add_function(s, pl);
-
- pl = pl->next;
- }
-
- // Cleanup from syntax_err();
- while (blk) {
- llist_traverse(blk->fdelete, free);
- free(llist_pop(&blk));
- }
-
- return;
-}
-
-void subshell_imports(void)
-{
-/*
- // TODO cull local variables because 'env "()=42" env | grep 42' works.
-
- // vfork() means subshells have to export and then re-import locals/functions
- sprintf(toybuf, "(%d#%d)", getpid(), getppid());
- if ((s = getenv(toybuf))) {
- char *from, *to, *ss;
-
- unsetenv(toybuf);
- ss = s;
-
- // Loop through packing \\ until \0
- for (from = to = s; *from; from++, to++) {
- *to = *from;
- if (*from != '\\') continue;
- if (from[1] == '\\' || from[1] == '0') from++;
- if (from[1] != '0') continue;
- *to = 0;
-
- // save chunk
- for (ss = s; ss<to; ss++) {
- if (*ss == '=') {
- // first char of name is variable type ala declare
- if (s+1<ss && strchr("aAilnru", *s)) {
- setvar(ss, *s);
-
- break;
- }
- } else if (!strncmp(ss, "(){", 3)) {
- FILE *ff = fmemopen(s, to-s, "r");
-
- while ((new = xgetline(ff, 0))) {
- if ((prompt = parse_line(new, &scratch))<0) break;
- free(new);
- }
- if (!prompt) {
- add_function(s, scratch.pipeline);
- free_function(&scratch);
- break;
- }
- fclose(ff);
- } else if (!isspace(*s) && !ispunct(*s)) continue;
-
- error_exit("bad locals");
- }
- s = from+1;
+ continue;
}
+down:
+ putchar(c);
}
-*/
}
void sh_main(void)
{
- FILE *f;
- char *new;
- struct sh_function scratch;
- int prompt = 0;
+ FILE *f = 0;
// Set up signal handlers and grab control of this tty.
+ if (isatty(0)) toys.optflags |= FLAG_i;
- // Read environment for exports from parent shell
- subshell_imports();
-
- memset(&scratch, 0, sizeof(scratch));
- if (TT.command) f = fmemopen(TT.command, strlen(TT.command), "r");
- else if (*toys.optargs) f = xfopen(*toys.optargs, "r");
+ if (*toys.optargs) f = xfopen(*toys.optargs, "r");
+ if (TT.command) handle(xstrdup(TT.command));
else {
- f = stdin;
- if (isatty(0)) toys.optflags |= FLAG_i;
- }
-
- for (;;) {
-
- // Prompt and read line
- if (f == stdin) {
- char *s = getenv(prompt ? "PS2" : "PS1");
-
- if (!s) s = prompt ? "> " : (getpid() ? "\\$ " : "# ");
- do_prompt(s);
- } else TT.lineno++;
- if (!(new = xgetline(f ? f : stdin, 0))) break;
-
-// TODO if (!isspace(*new)) add_to_history(line);
+ size_t cmdlen = 0;
+ for (;;) {
+ char *command = 0;
- // returns 0 if line consumed, command if it needs more data
- prompt = parse_line(new, &scratch);
-if (0) dump_state(&scratch);
- if (prompt != 1) {
-// TODO: ./blah.sh one two three: put one two three in scratch.arg
- if (!prompt) run_function(&scratch);
- free_function(&scratch);
- prompt = 0;
+ // TODO: parse escapes in prompt
+ if (!f) do_prompt();
+ if (1 > getline(&command, &cmdlen, f ? f : stdin)) break;
+ handle(command);
+ free(command);
}
- free(new);
}
- if (prompt) error_exit("%ld:unfinished line"+4*!TT.lineno, TT.lineno);
- toys.exitval = f && ferror(f);
+ toys.exitval = 1;
}
diff --git a/toys/pending/tar.c b/toys/pending/tar.c
new file mode 100644
index 00000000..c2946225
--- /dev/null
+++ b/toys/pending/tar.c
@@ -0,0 +1,815 @@
+/* tar.c - create/extract archives
+ *
+ * Copyright 2014 Ashwini Kumar <ak.ashwini81@gmail.com>
+ *
+ * USTAR interchange format is of interest in
+ * See http://http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html
+ * For writing to external program
+ * http://www.gnu.org/software/tar/manual/html_node/Writing-to-an-External-Program.html
+
+USE_TAR(NEWTOY(tar, "&(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)j(bzip2)z(gzip)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):[!txc][!jz]", TOYFLAG_USR|TOYFLAG_BIN))
+
+config TAR
+ bool "tar"
+ default n
+ help
+ usage: tar -[cxtjzhmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR]
+
+ Create, extract, or list files from a tar file
+
+ Operation:
+ c Create
+ f Name of TARFILE ('-' for stdin/out)
+ h Follow symlinks
+ j (De)compress using bzip2
+ m Don't restore mtime
+ t List
+ v Verbose
+ x Extract
+ z (De)compress using gzip
+ C Change to DIR before operation
+ O Extract to stdout
+ exclude=FILE File to exclude
+ X File with names to exclude
+ T File with names to include
+*/
+
+#define FOR_tar
+#include "toys.h"
+
+GLOBALS(
+ char *fname;
+ char *dir;
+ struct arg_list *inc_file;
+ struct arg_list *exc_file;
+ char *tocmd;
+ struct arg_list *exc;
+
+ struct arg_list *inc, *pass;
+ void *inodes, *handle;
+)
+
+struct tar_hdr {
+ char name[100], mode[8], uid[8], gid[8],size[12], mtime[12], chksum[8],
+ type, link[100], magic[8], uname[32], gname[32], major[8], minor[8],
+ prefix[155], padd[12];
+};
+
+struct file_header {
+ char *name, *link_target, *uname, *gname;
+ off_t size;
+ uid_t uid;
+ gid_t gid;
+ mode_t mode;
+ time_t mtime;
+ dev_t device;
+};
+
+struct archive_handler {
+ int src_fd;
+ struct file_header file_hdr;
+ off_t offset;
+ void (*extract_handler)(struct archive_handler*);
+};
+
+struct inode_list {
+ struct inode_list *next;
+ char *arg;
+ ino_t ino;
+ dev_t dev;
+};
+
+static void copy_in_out(int src, int dst, off_t size)
+{
+ int i, rd, rem = size%512, cnt;
+
+ cnt = size/512 + (rem?1:0);
+
+ for (i = 0; i < cnt; i++) {
+ rd = (i == cnt-1 && rem) ? rem : 512;
+ xreadall(src, toybuf, rd);
+ writeall(dst, toybuf, rd);
+ }
+}
+
+//convert to octal
+static void itoo(char *str, int len, off_t val)
+{
+ char *t, tmp[sizeof(off_t)*3+1];
+ int cnt = sprintf(tmp, "%0*llo", len, (unsigned long long)val);
+
+ t = tmp + cnt - len;
+ if (*t == '0') t++;
+ memcpy(str, t, len);
+}
+
+static struct inode_list *seen_inode(void **list, struct stat *st, char *name)
+{
+ if (!st) llist_traverse(*list, llist_free_arg);
+ else if (!S_ISDIR(st->st_mode) && st->st_nlink > 1) {
+ struct inode_list *new;
+
+ for (new = *list; new; new = new->next)
+ if(new->ino == st->st_ino && new->dev == st->st_dev)
+ return new;
+
+ new = xzalloc(sizeof(*new));
+ new->ino = st->st_ino;
+ new->dev = st->st_dev;
+ new->arg = xstrdup(name);
+ new->next = *list;
+ *list = new;
+ }
+ return 0;
+}
+
+static void write_longname(struct archive_handler *tar, char *name, char type)
+{
+ struct tar_hdr tmp;
+ unsigned int sum = 0;
+ int i, sz = strlen(name) +1;
+ char buf[512] = {0,};
+
+ memset(&tmp, 0, sizeof(tmp));
+ strcpy(tmp.name, "././@LongLink");
+ sprintf(tmp.mode, "%0*d", (int)sizeof(tmp.mode)-1, 0);
+ sprintf(tmp.uid, "%0*d", (int)sizeof(tmp.uid)-1, 0);
+ sprintf(tmp.gid, "%0*d", (int)sizeof(tmp.gid)-1, 0);
+ sprintf(tmp.size, "%0*d", (int)sizeof(tmp.size)-1, 0);
+ sprintf(tmp.mtime, "%0*d", (int)sizeof(tmp.mtime)-1, 0);
+ itoo(tmp.size, sizeof(tmp.size), sz);
+ tmp.type = type;
+ memset(tmp.chksum, ' ', 8);
+ strcpy(tmp.magic, "ustar ");
+ for (i= 0; i < 512; i++) sum += (unsigned int)((char*)&tmp)[i];
+ itoo(tmp.chksum, sizeof(tmp.chksum)-1, sum);
+
+ writeall(tar->src_fd, (void*) &tmp, sizeof(tmp));
+ //write name to archive
+ writeall(tar->src_fd, name, sz);
+ if (sz%512) writeall(tar->src_fd, buf, (512-(sz%512)));
+}
+
+static int filter(struct arg_list *lst, char *name)
+{
+ struct arg_list *cur;
+
+ for (cur = lst; cur; cur = cur->next)
+ if (!fnmatch(cur->arg, name, 1<<3)) return 1;
+ return 0;
+}
+
+static void add_file(struct archive_handler *tar, char **nam, struct stat *st)
+{
+ struct tar_hdr hdr;
+ struct passwd *pw;
+ struct group *gr;
+ struct inode_list *node;
+ int i, fd =-1;
+ char *c, *p, *name = *nam, *lnk, *hname, buf[512] = {0,};
+ unsigned int sum = 0;
+ static int warn = 1;
+
+ for (p = name; *p; p++)
+ if ((p == name || p[-1] == '/') && *p != '/'
+ && filter(TT.exc, p)) return;
+
+ if (S_ISDIR(st->st_mode) && name[strlen(name)-1] != '/') {
+ lnk = xmprintf("%s/",name);
+ free(name);
+ *nam = name = lnk;
+ }
+ hname = name;
+ //remove leading '/' or relative path '../' component
+ if (*hname == '/') hname++;
+ if (!*hname) return;
+ while ((c = strstr(hname, "../"))) hname = c + 3;
+ if (warn && hname != name) {
+ fprintf(stderr, "removing leading '%.*s' "
+ "from member names\n", (int)(hname-name), name);
+ warn = 0;
+ }
+
+ memset(&hdr, 0, sizeof(hdr));
+ strncpy(hdr.name, hname, sizeof(hdr.name));
+ itoo(hdr.mode, sizeof(hdr.mode), st->st_mode &07777);
+ itoo(hdr.uid, sizeof(hdr.uid), st->st_uid);
+ itoo(hdr.gid, sizeof(hdr.gid), st->st_gid);
+ itoo(hdr.size, sizeof(hdr.size), 0); //set size later
+ itoo(hdr.mtime, sizeof(hdr.mtime), st->st_mtime);
+ for (i=0; i<sizeof(hdr.chksum); i++) hdr.chksum[i] = ' ';
+
+ if ((node = seen_inode(&TT.inodes, st, hname))) {
+ //this is a hard link
+ hdr.type = '1';
+ if (strlen(node->arg) > sizeof(hdr.link))
+ write_longname(tar, hname, 'K'); //write longname LINK
+ xstrncpy(hdr.link, node->arg, sizeof(hdr.link));
+ } else if (S_ISREG(st->st_mode)) {
+ hdr.type = '0';
+ if (st->st_size <= (off_t)0777777777777LL)
+ itoo(hdr.size, sizeof(hdr.size), st->st_size);
+ else {
+ error_msg("can't store file '%s' of size '%lld'\n",
+ hname, (unsigned long long)st->st_size);
+ return;
+ }
+ } else if (S_ISLNK(st->st_mode)) {
+ hdr.type = '2'; //'K' long link
+ if (!(lnk = xreadlink(name))) {
+ perror_msg("readlink");
+ return;
+ }
+ if (strlen(lnk) > sizeof(hdr.link))
+ write_longname(tar, hname, 'K'); //write longname LINK
+ xstrncpy(hdr.link, lnk, sizeof(hdr.link));
+ free(lnk);
+ }
+ else if (S_ISDIR(st->st_mode)) hdr.type = '5';
+ else if (S_ISFIFO(st->st_mode)) hdr.type = '6';
+ else if (S_ISBLK(st->st_mode) || S_ISCHR(st->st_mode)) {
+ hdr.type = (S_ISCHR(st->st_mode))?'3':'4';
+ itoo(hdr.major, sizeof(hdr.major), dev_major(st->st_rdev));
+ itoo(hdr.minor, sizeof(hdr.minor), dev_minor(st->st_rdev));
+ } else {
+ error_msg("unknown file type '%o'", st->st_mode & S_IFMT);
+ return;
+ }
+ if (strlen(hname) > sizeof(hdr.name))
+ write_longname(tar, hname, 'L'); //write longname NAME
+ strcpy(hdr.magic, "ustar ");
+ if ((pw = getpwuid(st->st_uid)))
+ snprintf(hdr.uname, sizeof(hdr.uname), "%s", pw->pw_name);
+ else snprintf(hdr.uname, sizeof(hdr.uname), "%d", st->st_uid);
+
+ if ((gr = getgrgid(st->st_gid)))
+ snprintf(hdr.gname, sizeof(hdr.gname), "%s", gr->gr_name);
+ else snprintf(hdr.gname, sizeof(hdr.gname), "%d", st->st_gid);
+
+ //calculate chksum.
+ for (i= 0; i < 512; i++) sum += (unsigned int)((char*)&hdr)[i];
+ itoo(hdr.chksum, sizeof(hdr.chksum)-1, sum);
+ if (toys.optflags & FLAG_v) printf("%s\n",hname);
+ writeall(tar->src_fd, (void*)&hdr, 512);
+
+ //write actual data to archive
+ if (hdr.type != '0') return; //nothing to write
+ if ((fd = open(name, O_RDONLY)) < 0) {
+ perror_msg("can't open '%s'", name);
+ return;
+ }
+ copy_in_out(fd, tar->src_fd, st->st_size);
+ if (st->st_size%512) writeall(tar->src_fd, buf, (512-(st->st_size%512)));
+ close(fd);
+}
+
+static int add_to_tar(struct dirtree *node)
+{
+ struct stat st;
+ char *path;
+ struct archive_handler *hdl = (struct archive_handler*)TT.handle;
+
+ if (!fstat(hdl->src_fd, &st) && st.st_dev == node->st.st_dev
+ && st.st_ino == node->st.st_ino) {
+ error_msg("'%s' file is the archive; not dumped", TT.fname);
+ return ((DIRTREE_RECURSE | ((toys.optflags & FLAG_h)?DIRTREE_SYMFOLLOW:0)));
+ }
+
+ if (!dirtree_notdotdot(node)) return 0;
+ path = dirtree_path(node, 0);
+ add_file(hdl, &path, &(node->st)); //path may be modified
+ free(path);
+ if (toys.optflags & FLAG_no_recursion) return 0;
+ return ((DIRTREE_RECURSE | ((toys.optflags & FLAG_h)?DIRTREE_SYMFOLLOW:0)));
+}
+
+static void compress_stream(struct archive_handler *tar_hdl)
+{
+ int pipefd[2];
+ pid_t cpid;
+
+ xpipe(pipefd);
+
+ signal(SIGPIPE, SIG_IGN);
+ cpid = fork();
+ if (cpid == -1) perror_exit("fork");
+
+ if (!cpid) { /* Child reads from pipe */
+ char *argv[] = {(toys.optflags&FLAG_z)?"gzip":"bzip2", "-f", NULL};
+ xclose(pipefd[1]); /* Close unused write*/
+ dup2(pipefd[0], 0);
+ dup2(tar_hdl->src_fd, 1); //write to tar fd
+ xexec(argv);
+ } else {
+ xclose(pipefd[0]); /* Close unused read end */
+ dup2(pipefd[1], tar_hdl->src_fd); //write to pipe
+ }
+}
+
+static void extract_to_stdout(struct archive_handler *tar)
+{
+ struct file_header *file_hdr = &tar->file_hdr;
+
+ copy_in_out(tar->src_fd, 0, file_hdr->size);
+ tar->offset += file_hdr->size;
+}
+
+static void extract_to_command(struct archive_handler *tar)
+{
+ int pipefd[2], status = 0;
+ pid_t cpid;
+ struct file_header *file_hdr = &tar->file_hdr;
+
+ xpipe(pipefd);
+ if (!S_ISREG(file_hdr->mode)) return; //only regular files are supported.
+
+ cpid = fork();
+ if (cpid == -1) perror_exit("fork");
+
+ if (!cpid) { // Child reads from pipe
+ char buf[64], *argv[4] = {"sh", "-c", TT.tocmd, NULL};
+
+ setenv("TAR_FILETYPE", "f", 1);
+ sprintf(buf, "%0o", file_hdr->mode);
+ setenv("TAR_MODE", buf, 1);
+ sprintf(buf, "%ld", (long)file_hdr->size);
+ setenv("TAR_SIZE", buf, 1);
+ setenv("TAR_FILENAME", file_hdr->name, 1);
+ setenv("TAR_UNAME", file_hdr->uname, 1);
+ setenv("TAR_GNAME", file_hdr->gname, 1);
+ sprintf(buf, "%0o", (int)file_hdr->mtime);
+ setenv("TAR_MTIME", buf, 1);
+ sprintf(buf, "%0o", file_hdr->uid);
+ setenv("TAR_UID", buf, 1);
+ sprintf(buf, "%0o", file_hdr->gid);
+ setenv("TAR_GID", buf, 1);
+
+ xclose(pipefd[1]); // Close unused write
+ dup2(pipefd[0], 0);
+ signal(SIGPIPE, SIG_DFL);
+ xexec(argv);
+ } else {
+ xclose(pipefd[0]); // Close unused read end
+ copy_in_out(tar->src_fd, pipefd[1], file_hdr->size);
+ tar->offset += file_hdr->size;
+ xclose(pipefd[1]);
+ waitpid(cpid, &status, 0);
+ if (WIFSIGNALED(status))
+ xprintf("tar : %d: child returned %d\n", cpid, WTERMSIG(status));
+ }
+}
+
+static void extract_to_disk(struct archive_handler *tar)
+{
+ int flags, dst_fd = -1;
+ char *s;
+ struct stat ex;
+ struct file_header *file_hdr = &tar->file_hdr;
+
+ flags = strlen(file_hdr->name);
+ if (flags>2) {
+ if (strstr(file_hdr->name, "/../") || !strcmp(file_hdr->name, "../") ||
+ !strcmp(file_hdr->name+flags-3, "/.."))
+ {
+ error_msg("drop %s", file_hdr->name);
+ }
+ }
+
+ if (file_hdr->name[flags-1] == '/') file_hdr->name[flags-1] = 0;
+ //Regular file with preceding path
+ if ((s = strrchr(file_hdr->name, '/'))) {
+ if (mkpath(file_hdr->name) && errno !=EEXIST) {
+ error_msg(":%s: not created", file_hdr->name);
+ return;
+ }
+ }
+
+ //remove old file, if exists
+ if (!(toys.optflags & FLAG_k) && !S_ISDIR(file_hdr->mode)
+ && !lstat( file_hdr->name, &ex)) {
+ if (unlink(file_hdr->name)) {
+ perror_msg("can't remove: %s",file_hdr->name);
+ }
+ }
+
+ //hard link
+ if (S_ISREG(file_hdr->mode) && file_hdr->link_target) {
+ if (link(file_hdr->link_target, file_hdr->name))
+ perror_msg("can't link '%s' -> '%s'",file_hdr->name, file_hdr->link_target);
+ goto COPY;
+ }
+
+ switch (file_hdr->mode & S_IFMT) {
+ case S_IFREG:
+ flags = O_WRONLY|O_CREAT|O_EXCL;
+ if (toys.optflags & FLAG_overwrite) flags = O_WRONLY|O_CREAT|O_TRUNC;
+ dst_fd = open(file_hdr->name, flags, file_hdr->mode & 07777);
+ if (dst_fd == -1) perror_msg("%s: can't open", file_hdr->name);
+ break;
+ case S_IFDIR:
+ if ((mkdir(file_hdr->name, file_hdr->mode) == -1) && errno != EEXIST)
+ perror_msg("%s: can't create", file_hdr->name);
+ break;
+ case S_IFLNK:
+ if (symlink(file_hdr->link_target, file_hdr->name))
+ perror_msg("can't link '%s' -> '%s'",file_hdr->name, file_hdr->link_target);
+ break;
+ case S_IFBLK:
+ case S_IFCHR:
+ case S_IFIFO:
+ if (mknod(file_hdr->name, file_hdr->mode, file_hdr->device))
+ perror_msg("can't create '%s'", file_hdr->name);
+ break;
+ default:
+ printf("type not yet supported\n");
+ break;
+ }
+
+ //copy file....
+COPY:
+ copy_in_out(tar->src_fd, dst_fd, file_hdr->size);
+ tar->offset += file_hdr->size;
+ close(dst_fd);
+
+ if (S_ISLNK(file_hdr->mode)) return;
+ if (!(toys.optflags & FLAG_o)) {
+ //set ownership..., --no-same-owner, --numeric-owner
+ uid_t u = file_hdr->uid;
+ gid_t g = file_hdr->gid;
+
+ if (!(toys.optflags & FLAG_numeric_owner)) {
+ struct group *gr = getgrnam(file_hdr->gname);
+ struct passwd *pw = getpwnam(file_hdr->uname);
+ if (pw) u = pw->pw_uid;
+ if (gr) g = gr->gr_gid;
+ }
+ if (chown(file_hdr->name, u, g))
+ perror_msg("chown %d:%d '%s'", u, g, file_hdr->name);;
+ }
+
+ if (toys.optflags & FLAG_p) // || !(toys.optflags & FLAG_no_same_permissions))
+ chmod(file_hdr->name, file_hdr->mode);
+
+ //apply mtime
+ if (!(toys.optflags & FLAG_m)) {
+ struct timeval times[2] = {{file_hdr->mtime, 0},{file_hdr->mtime, 0}};
+ utimes(file_hdr->name, times);
+ }
+}
+
+static void add_to_list(struct arg_list **llist, char *name)
+{
+ struct arg_list **list = llist;
+
+ while (*list) list=&((*list)->next);
+ *list = xzalloc(sizeof(struct arg_list));
+ (*list)->arg = name;
+ if ((name[strlen(name)-1] == '/') && strlen(name) != 1)
+ name[strlen(name)-1] = '\0';
+}
+
+static void add_from_file(struct arg_list **llist, struct arg_list *flist)
+{
+ char *line = NULL;
+
+ while (flist) {
+ int fd = 0;
+
+ if (strcmp((char *)flist->arg, "-"))
+ fd = xopen((char *)flist->arg, O_RDONLY);
+
+ while ((line = get_line(fd))) {
+ add_to_list(llist, line);
+ }
+ if (fd) close(fd);
+ flist = flist->next;
+ }
+}
+
+static struct archive_handler *init_handler()
+{
+ struct archive_handler *tar_hdl = xzalloc(sizeof(struct archive_handler));
+ tar_hdl->extract_handler = extract_to_disk;
+ return tar_hdl;
+}
+
+//convert octal to int
+static int otoi(char *str, int len)
+{
+ long val;
+ char *endp, inp[len+1]; //1 for NUL termination
+
+ memcpy(inp, str, len);
+ inp[len] = '\0'; //nul-termination made sure
+ val = strtol(inp, &endp, 8);
+ if (*endp && *endp != ' ') error_exit("invalid param");
+ return (int)val;
+}
+
+static void extract_stream(struct archive_handler *tar_hdl)
+{
+ int pipefd[2];
+ pid_t cpid;
+
+ xpipe(pipefd);
+
+ cpid = fork();
+ if (cpid == -1) perror_exit("fork");
+
+ if (!cpid) { /* Child reads from pipe */
+ char *argv[] =
+ {(toys.optflags&FLAG_z)?"gunzip":"bunzip2", "-cf", "-", NULL};
+ xclose(pipefd[0]); /* Close unused read*/
+ dup2(tar_hdl->src_fd, 0);
+ dup2(pipefd[1], 1); //write to pipe
+ xexec(argv);
+ } else {
+ xclose(pipefd[1]); /* Close unused read end */
+ dup2(pipefd[0], tar_hdl->src_fd); //read from pipe
+ }
+}
+
+static char *process_extended_hdr(struct archive_handler *tar, int size)
+{
+ char *value = NULL, *p, *buf = xzalloc(size+1);
+
+ if (readall(tar->src_fd, buf, size) != size) error_exit("short read");
+ buf[size] = 0;
+ tar->offset += size;
+ p = buf;
+
+ while (size) {
+ char *key;
+ int len, n;
+
+ // extended records are of the format: "LEN NAME=VALUE\n"
+ sscanf(p, "%d %n", &len, &n);
+ key = p + n;
+ p += len;
+ size -= len;
+ p[-1] = 0;
+ if (size < 0) {
+ error_msg("corrupted extended header");
+ break;
+ }
+
+ len = strlen("path=");
+ if (!strncmp(key, "path=", len)) {
+ value = key + strlen("path=");
+ break;
+ }
+ }
+ if (value) value = xstrdup(value);
+ free(buf);
+ return value;
+}
+
+static void tar_skip(struct archive_handler *tar, int sz)
+{
+ int x;
+
+ while ((x = lskip(tar->src_fd, sz))) {
+ tar->offset += sz - x;
+ sz = x;
+ }
+ tar->offset += sz;
+}
+
+static void unpack_tar(struct archive_handler *tar_hdl)
+{
+ struct tar_hdr tar;
+ struct file_header *file_hdr;
+ int i, j, maj, min, sz, e = 0;
+ unsigned int cksum;
+ char *longname = NULL, *longlink = NULL;
+
+ while (1) {
+ cksum = 0;
+ if (tar_hdl->offset % 512) {
+ sz = 512 - tar_hdl->offset % 512;
+ tar_skip(tar_hdl, sz);
+ }
+ i = readall(tar_hdl->src_fd, &tar, 512);
+ tar_hdl->offset += i;
+ if (i != 512) {
+ if (i >= 2) goto CHECK_MAGIC; //may be a small (<512 byte)zipped file
+ error_exit("read error");
+ }
+
+ if (!tar.name[0]) {
+ if (e) return; //end of tar 2 empty blocks
+ e = 1;//empty jump to next block
+ continue;
+ }
+ if (strncmp(tar.magic, "ustar", 5)) {
+ // Try detecting .gz or .bz2 by looking for their magic.
+CHECK_MAGIC:
+ if ((!strncmp(tar.name, "\x1f\x8b", 2) || !strncmp(tar.name, "BZh", 3))
+ && !lseek(tar_hdl->src_fd, -i, SEEK_CUR)) {
+ toys.optflags |= (*tar.name == 'B') ? FLAG_j : FLAG_z;
+ tar_hdl->offset -= i;
+ extract_stream(tar_hdl);
+ continue;
+ }
+ error_exit("invalid tar format");
+ }
+
+ for (j = 0; j<148; j++) cksum += (unsigned int)((char*)&tar)[j];
+ for (j = 156; j<500; j++) cksum += (unsigned int)((char*)&tar)[j];
+ //cksum field itself treated as ' '
+ for ( j= 0; j<8; j++) cksum += (unsigned int)' ';
+
+ if (cksum != otoi(tar.chksum, sizeof(tar.chksum))) error_exit("wrong cksum");
+
+ file_hdr = &tar_hdl->file_hdr;
+ memset(file_hdr, 0, sizeof(struct file_header));
+ file_hdr->mode = otoi(tar.mode, sizeof(tar.mode));
+ file_hdr->uid = otoi(tar.uid, sizeof(tar.uid));
+ file_hdr->gid = otoi(tar.gid, sizeof(tar.gid));
+ file_hdr->size = otoi(tar.size, sizeof(tar.size));
+ file_hdr->mtime = otoi(tar.mtime, sizeof(tar.mtime));
+ file_hdr->uname = xstrdup(tar.uname);
+ file_hdr->gname = xstrdup(tar.gname);
+ maj = otoi(tar.major, sizeof(tar.major));
+ min = otoi(tar.minor, sizeof(tar.minor));
+ file_hdr->device = dev_makedev(maj, min);
+
+ if (tar.type <= '7') {
+ if (tar.link[0]) {
+ sz = sizeof(tar.link);
+ file_hdr->link_target = xmalloc(sz + 1);
+ memcpy(file_hdr->link_target, tar.link, sz);
+ file_hdr->link_target[sz] = '\0';
+ }
+
+ file_hdr->name = xzalloc(256);// pathname supported size
+ if (tar.prefix[0]) {
+ memcpy(file_hdr->name, tar.prefix, sizeof(tar.prefix));
+ sz = strlen(file_hdr->name);
+ if (file_hdr->name[sz-1] != '/') file_hdr->name[sz] = '/';
+ }
+ sz = strlen(file_hdr->name);
+ memcpy(file_hdr->name + sz, tar.name, sizeof(tar.name));
+ if (file_hdr->name[255]) error_exit("filename too long");
+ }
+
+ switch (tar.type) {
+ // case '\0':
+ case '0':
+ case '7':
+ case '1': //Hard Link
+ file_hdr->mode |= S_IFREG;
+ break;
+ case '2':
+ file_hdr->mode |= S_IFLNK;
+ break;
+ case '3':
+ file_hdr->mode |= S_IFCHR;
+ break;
+ case '4':
+ file_hdr->mode |= S_IFBLK;
+ break;
+ case '5':
+ file_hdr->mode |= S_IFDIR;
+ break;
+ case '6':
+ file_hdr->mode |= S_IFIFO;
+ break;
+ case 'K':
+ longlink = xzalloc(file_hdr->size +1);
+ xread(tar_hdl->src_fd, longlink, file_hdr->size);
+ tar_hdl->offset += file_hdr->size;
+ continue;
+ case 'L':
+ free(longname);
+ longname = xzalloc(file_hdr->size +1);
+ xread(tar_hdl->src_fd, longname, file_hdr->size);
+ tar_hdl->offset += file_hdr->size;
+ continue;
+ case 'D':
+ case 'M':
+ case 'N':
+ case 'S':
+ case 'V':
+ case 'g': // pax global header
+ tar_skip(tar_hdl, file_hdr->size);
+ continue;
+ case 'x': // pax extended header
+ free(longname);
+ longname = process_extended_hdr(tar_hdl, file_hdr->size);
+ continue;
+ default: break;
+ }
+
+ if (longname) {
+ free(file_hdr->name);
+ file_hdr->name = longname;
+ longname = NULL;
+ }
+ if (longlink) {
+ free(file_hdr->link_target);
+ file_hdr->link_target = longlink;
+ longlink = NULL;
+ }
+
+ if ((file_hdr->mode & S_IFREG) &&
+ file_hdr->name[strlen(file_hdr->name)-1] == '/') {
+ file_hdr->name[strlen(file_hdr->name)-1] = '\0';
+ file_hdr->mode &= ~S_IFREG;
+ file_hdr->mode |= S_IFDIR;
+ }
+
+ if ((file_hdr->link_target && *(file_hdr->link_target))
+ || S_ISLNK(file_hdr->mode) || S_ISDIR(file_hdr->mode))
+ file_hdr->size = 0;
+
+ if (filter(TT.exc, file_hdr->name) ||
+ (TT.inc && !filter(TT.inc, file_hdr->name))) goto SKIP;
+ add_to_list(&TT.pass, xstrdup(file_hdr->name));
+
+ if (toys.optflags & FLAG_t) {
+ if (toys.optflags & FLAG_v) {
+ char perm[11];
+ struct tm *lc = localtime((const time_t*)&(file_hdr->mtime));
+
+ mode_to_string(file_hdr->mode, perm);
+ printf("%s %s/%s %9ld %d-%02d-%02d %02d:%02d:%02d ",perm,file_hdr->uname,
+ file_hdr->gname, (long)file_hdr->size, 1900+lc->tm_year,
+ 1+lc->tm_mon, lc->tm_mday, lc->tm_hour, lc->tm_min, lc->tm_sec);
+ }
+ printf("%s",file_hdr->name);
+ if (file_hdr->link_target) printf(" -> %s",file_hdr->link_target);
+ xputc('\n');
+SKIP:
+ tar_skip(tar_hdl, file_hdr->size);
+ } else {
+ if (toys.optflags & FLAG_v) printf("%s\n",file_hdr->name);
+ tar_hdl->extract_handler(tar_hdl);
+ }
+ free(file_hdr->name);
+ free(file_hdr->link_target);
+ free(file_hdr->uname);
+ free(file_hdr->gname);
+ }
+}
+
+void tar_main(void)
+{
+ struct archive_handler *tar_hdl;
+ int fd = 0;
+ struct arg_list *tmp;
+ char **args = toys.optargs;
+
+ if (!geteuid()) toys.optflags |= FLAG_p;
+
+ for (tmp = TT.exc; tmp; tmp = tmp->next)
+ tmp->arg = xstrdup(tmp->arg); //freeing at the end fails otherwise
+
+ while(*args) add_to_list(&TT.inc, xstrdup(*args++));
+ if (toys.optflags & FLAG_X) add_from_file(&TT.exc, TT.exc_file);
+ if (toys.optflags & FLAG_T) add_from_file(&TT.inc, TT.inc_file);
+
+ if (toys.optflags & FLAG_c) {
+ if (!TT.inc) error_exit("empty archive");
+ fd = 1;
+ }
+ if ((toys.optflags & FLAG_f) && strcmp(TT.fname, "-"))
+ fd = xcreate(TT.fname, fd*(O_WRONLY|O_CREAT|O_TRUNC), 0666);
+ if (toys.optflags & FLAG_C) xchdir(TT.dir);
+
+ tar_hdl = init_handler();
+ tar_hdl->src_fd = fd;
+
+ if ((toys.optflags & FLAG_x) || (toys.optflags & FLAG_t)) {
+ if (toys.optflags & FLAG_O) tar_hdl->extract_handler = extract_to_stdout;
+ if (toys.optflags & FLAG_to_command) {
+ signal(SIGPIPE, SIG_IGN); //will be using pipe between child & parent
+ tar_hdl->extract_handler = extract_to_command;
+ }
+ if (toys.optflags & FLAG_z) extract_stream(tar_hdl);
+ unpack_tar(tar_hdl);
+ for (tmp = TT.inc; tmp; tmp = tmp->next)
+ if (!filter(TT.exc, tmp->arg) && !filter(TT.pass, tmp->arg))
+ error_msg("'%s' not in archive", tmp->arg);
+ } else if (toys.optflags & FLAG_c) {
+ //create the tar here.
+ if (toys.optflags & (FLAG_j|FLAG_z)) compress_stream(tar_hdl);
+ for (tmp = TT.inc; tmp; tmp = tmp->next) {
+ TT.handle = tar_hdl;
+ //recurse thru dir and add files to archive
+ dirtree_flagread(tmp->arg, DIRTREE_SYMFOLLOW*!!(toys.optflags&FLAG_h),
+ add_to_tar);
+ }
+ memset(toybuf, 0, 1024);
+ writeall(tar_hdl->src_fd, toybuf, 1024);
+ seen_inode(&TT.inodes, 0, 0);
+ }
+
+ if (CFG_TOYBOX_FREE) {
+ close(tar_hdl->src_fd);
+ free(tar_hdl);
+ llist_traverse(TT.exc, llist_free_arg);
+ llist_traverse(TT.inc, llist_free_arg);
+ llist_traverse(TT.pass, llist_free_arg);
+ }
+}
diff --git a/toys/pending/tcpsvd.c b/toys/pending/tcpsvd.c
index e5bd76b5..31c27610 100644
--- a/toys/pending/tcpsvd.c
+++ b/toys/pending/tcpsvd.c
@@ -248,7 +248,7 @@ static int create_bind_sock(char *host, struct sockaddr *haddr)
sockfd = xsocket(rp->ai_family, TT.udp ?SOCK_DGRAM :SOCK_STREAM, 0);
setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &set, sizeof(set));
if (TT.udp) setsockopt(sockfd, IPPROTO_IP, IP_PKTINFO, &set, sizeof(set));
- xbind(sockfd, rp->ai_addr, rp->ai_addrlen);
+ if ((bind(sockfd, rp->ai_addr, rp->ai_addrlen)) < 0) perror_exit("Bind failed");
if(haddr) memcpy(haddr, rp->ai_addr, rp->ai_addrlen);
freeaddrinfo(res);
return sockfd;
@@ -386,7 +386,8 @@ void tcpsvd_main(void)
free(serv);
free(clie);
}
- if (TT.udp) xconnect(newfd, (struct sockaddr *)buf, sizeof(buf));
+ if (TT.udp && (connect(newfd, (struct sockaddr *)buf, sizeof(buf)) < 0))
+ perror_exit("connect");
close(0);
close(1);
diff --git a/toys/pending/telnet.c b/toys/pending/telnet.c
index b8c9c140..e37b982c 100644
--- a/toys/pending/telnet.c
+++ b/toys/pending/telnet.c
@@ -306,7 +306,7 @@ void telnet_main(void)
}
terminal_size(&TT.win_width, &TT.win_height);
- TT.sfd = xconnectany(xgetaddrinfo(*toys.optargs, port, 0, SOCK_STREAM,
+ TT.sfd = xconnect(xgetaddrinfo(*toys.optargs, port, 0, SOCK_STREAM,
IPPROTO_TCP, 0));
setsockopt(TT.sfd, SOL_SOCKET, SO_REUSEADDR, &set, sizeof(set));
setsockopt(TT.sfd, SOL_SOCKET, SO_KEEPALIVE, &set, sizeof(set));
diff --git a/toys/pending/telnetd.c b/toys/pending/telnetd.c
index ad39d8c0..4198e63f 100644
--- a/toys/pending/telnetd.c
+++ b/toys/pending/telnetd.c
@@ -143,8 +143,11 @@ static int listen_socket(void)
if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&yes, sizeof(yes)) == -1)
perror_exit("setsockopt");
- xbind(s, (struct sockaddr *)buf, ((af == AF_INET)?
- (sizeof(struct sockaddr_in)):(sizeof(struct sockaddr_in6))));
+ if (bind(s, (struct sockaddr *)buf, ((af == AF_INET)?
+ (sizeof(struct sockaddr_in)):(sizeof(struct sockaddr_in6)))) == -1) {
+ close(s);
+ perror_exit("bind");
+ }
if (listen(s, 1) < 0) perror_exit("listen");
return s;
diff --git a/toys/pending/tftpd.c b/toys/pending/tftpd.c
index b5d0558f..9791ae41 100644
--- a/toys/pending/tftpd.c
+++ b/toys/pending/tftpd.c
@@ -252,8 +252,9 @@ void tftpd_main(void)
TT.sfd = xsocket(dstaddr.ss_family, SOCK_DGRAM, 0);
if (setsockopt(TT.sfd, SOL_SOCKET, SO_REUSEADDR, (const void *)&set,
sizeof(set)) < 0) perror_exit("setsockopt failed");
- xbind(TT.sfd, (void *)&srcaddr, socklen);
- xconnect(TT.sfd, (void *)&dstaddr, socklen);
+ if (bind(TT.sfd, (void *)&srcaddr, socklen)) perror_exit("bind");
+ if (connect(TT.sfd, (void *)&dstaddr, socklen) < 0)
+ perror_exit("can't connect to remote host");
// Error condition.
if (recvmsg_len<4 || recvmsg_len>TFTPD_BLKSIZE || toybuf[recvmsg_len-1]) {
send_errpkt((struct sockaddr*)&dstaddr, socklen, "packet format error");
diff --git a/toys/pending/traceroute.c b/toys/pending/traceroute.c
index 1cfdc480..d5ead9e2 100644
--- a/toys/pending/traceroute.c
+++ b/toys/pending/traceroute.c
@@ -587,7 +587,8 @@ void traceroute_main(void)
if (setsockopt(TT.snd_sock, IPPROTO_IP, IP_MULTICAST_IF,
(struct sockaddr*)&source, sizeof(struct sockaddr_in)))
perror_exit("can't set multicast source interface");
- xbind(TT.snd_sock,(struct sockaddr*)&source, sizeof(struct sockaddr_in));
+ if (bind(TT.snd_sock,(struct sockaddr*)&source,
+ sizeof(struct sockaddr_in)) < 0) perror_exit("bind");
}
if(TT.first_ttl > TT.max_ttl)
@@ -606,7 +607,9 @@ void traceroute_main(void)
if(inet_pton(AF_INET6, TT.src_ip, &(source.sin6_addr)) <= 0)
error_exit("bad address: %s", TT.src_ip);
- xbind(TT.snd_sock,(struct sockaddr*)&source, sizeof(struct sockaddr_in6));
+ if (bind(TT.snd_sock,(struct sockaddr*)&source,
+ sizeof(struct sockaddr_in6)) < 0)
+ error_exit("bind: Cannot assign requested address");
} else {
struct sockaddr_in6 prb;
socklen_t len = sizeof(prb);
@@ -614,13 +617,16 @@ void traceroute_main(void)
if (toys.optflags & FLAG_i) bind_to_interface(p_fd);
((struct sockaddr_in6 *)&dest)->sin6_port = htons(1025);
- xconnect(p_fd, (struct sockaddr *)&dest, sizeof(struct sockaddr_in6));
+ if (connect(p_fd, (struct sockaddr *)&dest, sizeof(struct sockaddr_in6)) < 0)
+ perror_exit("can't connect to remote host");
if(getsockname(p_fd, (struct sockaddr *)&prb, &len))
error_exit("probe addr failed");
close(p_fd);
prb.sin6_port = 0;
- xbind(TT.snd_sock, (struct sockaddr*)&prb, sizeof(struct sockaddr_in6));
- xbind(TT.recv_sock, (struct sockaddr*)&prb, sizeof(struct sockaddr_in6));
+ if (bind(TT.snd_sock, (struct sockaddr*)&prb,
+ sizeof(struct sockaddr_in6))) perror_exit("bind");
+ if (bind(TT.recv_sock, (struct sockaddr*)&prb,
+ sizeof(struct sockaddr_in6))) perror_exit("bind");
}
inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&dest)->sin6_addr,
diff --git a/toys/pending/vi.c b/toys/pending/vi.c
index 1cf8bc7b..c5c87507 100644
--- a/toys/pending/vi.c
+++ b/toys/pending/vi.c
@@ -22,82 +22,76 @@ config VI
GLOBALS(
int cur_col;
int cur_row;
- int scr_row;
- int drawn_row;
- int drawn_col;
unsigned screen_height;
unsigned screen_width;
int vi_mode;
- int count0;
- int count1;
- int vi_mov_flag;
- int modified;
- char vi_reg;
- char *last_search;
- int tabstop;
- int list;
)
-struct str_line {
- int alloc;
- int len;
- char *data;
-};
-//yank buffer
-struct yank_buf {
- char reg;
- int alloc;
- char* data;
-};
-
-
-//lib dllist uses next and prev kinda opposite what im used to so I just
-//renamed both ends to up and down
-struct linelist {
- struct linelist *up;//next
- struct linelist *down;//prev
- struct str_line *line;
+/*
+ *
+ * TODO:
+ * BUGS: screen pos adjust does not cover "widelines"
+ *
+ *
+ * REFACTOR: use dllist functions where possible.
+ * draw_page dont draw full page at time if nothing changed...
+ * ex callbacks
+ *
+ * FEATURE: ex: / ? % //atleast easy cases
+ * vi: x dw d$ d0
+ * vi: yw yy (y0 y$)
+ * vi+ex: gg G //line movements
+ * ex: r
+ * ex: !external programs
+ * ex: w filename //only writes to same file now
+ * big file support?
+ */
+
+
+struct linestack_show {
+ struct linestack_show *next;
+ long top, left;
+ int x, width, y, height;
};
static void draw_page();
-
+static int draw_str_until(int *drawn, char *str, int width, int bytes);
+static void draw_char(char c, int x, int y, int highlight);
//utf8 support
static int utf8_lnw(int* width, char* str, int bytes);
-static int utf8_dec(char key, char *utf8_scratch, int *sta_p);
+static int utf8_dec(char key, char *utf8_scratch, int *sta_p) ;
static int utf8_len(char *str);
static int utf8_width(char *str, int bytes);
-static char* utf8_last(char* str, int size);
+static int draw_rune(char *c, int x, int y, int highlight);
-static int cur_left(int count0, int count1, char* unused);
-static int cur_right(int count0, int count1, char* unused);
-static int cur_up(int count0, int count1, char* unused);
-static int cur_down(int count0, int count1, char* unused);
+static void cur_left();
+static void cur_right();
+static void cur_up();
+static void cur_down();
static void check_cursor_bounds();
static void adjust_screen_buffer();
-static int search_str(char *s);
-static int vi_yank(char reg, struct linelist *row, int col, int flags);
-static int vi_delete(char reg, struct linelist *row, int col, int flags);
+struct str_line {
+ int alloc_len;
+ int str_len;
+ char *str_data;
+};
+
+//lib dllist uses next and prev kinda opposite what im used to so I just
+//renamed both ends to up and down
+struct linelist {
+ struct linelist *up;//next
+ struct linelist *down;//prev
+ struct str_line *line;
+};
//inserted line not yet pushed to buffer
struct str_line *il;
struct linelist *text; //file loaded into buffer
-struct linelist *screen;//current screen coord 0 row
+struct linelist *scr_r;//current screen coord 0 row
struct linelist *c_r;//cursor position row
-
-struct yank_buf yank; //single yank
-
-// TT.vi_mov_flag is used for special cases when certain move
-// acts differently depending is there DELETE/YANK or NOP
-// Also commands such as G does not default to count0=1
-// 0x1 = Command needs argument (f,F,r...)
-// 0x2 = Move 1 right on yank/delete/insert (e, $...)
-// 0x4 = yank/delete last line fully
-// 0x10000000 = redraw after cursor needed
-// 0x20000000 = full redraw needed
-// 0x40000000 = count0 not given
-// 0x80000000 = move was reverse
+int modified;
void dlist_insert_nomalloc(struct double_list **list, struct double_list *new)
{
@@ -119,32 +113,23 @@ struct double_list *dlist_insert(struct double_list **list, char *data)
return new;
}
-
-void linelist_free(void *node)
-{
- struct linelist *lst = (struct linelist *)node;
- free(lst->line->data), free(lst->line), free(lst);
-}
-
void linelist_unload()
{
- void* list = 0;
- for (;text->down; text = text->down);
- list = (void*)text;
- text = screen = c_r = 0;
- llist_traverse(list, linelist_free);
+
}
void write_file(char *filename)
{
struct linelist *lst = text;
FILE *fp = 0;
- if (!filename) filename = (char*)*toys.optargs;
- if (!(fp = fopen(filename, "w")) ) return;
-
- for (;lst; lst = lst->down)
- fprintf(fp, "%s\n", lst->line->data);
-
+ if (!filename)
+ filename = (char*)*toys.optargs;
+ fp = fopen(filename, "w");
+ if (!fp) return ;
+ while (lst) {
+ fprintf(fp, "%s\n", lst->line->str_data);
+ lst = lst->down;
+ }
fclose(fp);
}
@@ -161,9 +146,9 @@ int linelist_load(char *filename)
ssize_t alc = 80;
lst = (struct linelist*)dlist_add((struct double_list**)&lst,
xzalloc(sizeof(struct str_line)));
- lst->line->alloc = alc;
- lst->line->len = 0;
- lst->line->data = line;
+ lst->line->alloc_len = alc;
+ lst->line->str_len = 0;
+ lst->line->str_data = line;
text = lst;
dlist_terminate(text->up);
return 1;
@@ -182,144 +167,160 @@ int linelist_load(char *filename)
}
lst = (struct linelist*)dlist_add((struct double_list**)&lst,
xzalloc(sizeof(struct str_line)));
- lst->line->alloc = alc;
- lst->line->len = len;
- lst->line->data = line;
+ lst->line->alloc_len = alc;
+ lst->line->str_len = len;
+ lst->line->str_data = line;
- if (lst->line->data[len-1] == '\n') {
- lst->line->data[len-1] = 0;
- lst->line->len--;
+ if (lst->line->str_data[len-1] == '\n') {
+ lst->line->str_data[len-1] = 0;
+ lst->line->str_len--;
+ }
+ if (text == 0) {
+ text = lst;
}
- if (text == 0) text = lst;
- }
-
- if (text) dlist_terminate(text->up);
+ }
+ if (text) {
+ dlist_terminate(text->up);
+ }
fclose(fp);
return 1;
}
-
-int vi_yy(char reg, int count0, int count1)
+//TODO this is overly complicated refactor with lib dllist
+int ex_dd(int count)
{
- struct linelist *pos = c_r;
- int col = TT.cur_col;
- TT.cur_col = 0;
- TT.vi_mov_flag |= 0x4;
-
- if (count0>1) cur_down(count0-1, 1, 0);
-
- vi_yank(reg, pos, 0, 0);
+ struct linelist *lst = c_r;
+ if (c_r == text && text == scr_r) {
+ if (!text->down && !text->up && text->line) {
+ text->line->str_len = 1;
+ sprintf(text->line->str_data, " ");
+ goto success_exit;
+ }
+ if (text->down) {
+ text = text->down;
+ text->up = 0;
+ c_r = text;
+ scr_r = text;
+ free(lst->line->str_data);
+ free(lst->line);
+ free(lst);
+ }
+ goto recursion_exit;
+ }
+ //TODO use lib dllist stuff
+ if (lst)
+ {
+ if (lst->down) {
+ lst->down->up = lst->up;
+ }
+ if (lst->up) {
+ lst->up->down = lst->down;
+ }
+ if (scr_r == c_r) {
+ scr_r = c_r->down ? c_r->down : c_r->up;
+ }
+ if (c_r->down)
+ c_r = c_r->down;
+ else {
+ c_r = c_r->up;
+ count = 1;
+ }
+ free(lst->line->str_data);
+ free(lst->line);
+ free(lst);
+ }
- TT.cur_col = col, c_r = pos;
+recursion_exit:
+ count--;
+ //make this recursive
+ if (count)
+ return ex_dd(count);
+success_exit:
+ check_cursor_bounds();
+ adjust_screen_buffer();
return 1;
}
-int vi_dd(char reg, int count0, int count1)
+int ex_dw(int count)
{
- struct linelist *pos = c_r;
- TT.cur_col = 0;
- TT.vi_mov_flag |= 0x4;
- if (count0>1) cur_down(count0-1, 1, 0);
-
- vi_delete(reg, pos, 0, 0);
- check_cursor_bounds();
return 1;
}
-static int vi_x(char reg, int count0, int count1)
+int ex_deol(int count)
{
- char *last = 0, *cpos = 0, *start = 0;
- int len = 0;
- struct linelist *pos = c_r;
- int col = TT.cur_col;
- if (!c_r) return 0;
-
- start = c_r->line->data;
- len = c_r->line->len;
-
- last = utf8_last(start, len);
- cpos = start+TT.cur_col;
- if (cpos == last) {
- cur_left(count0-1, 1, 0);
- col = strlen(start);
- }
- else {
- cur_right(count0-1, 1, 0);
- cpos = start+TT.cur_col;
- if (cpos == last) TT.vi_mov_flag |= 2;
- else cur_right(1, 1, 0);
- }
-
- vi_delete(reg, pos, col, 0);
- check_cursor_bounds();
return 1;
}
-//move commands does not behave correct way yet.
-int vi_movw(int count0, int count1, char* unused)
+//does not work with utf8 yet
+int vi_x(int count)
{
- int count = count0*count1;
- const char *empties = " \t\n\r";
- const char *specials = ",.=-+*/(){}<>[]";
-// char *current = 0;
+ char *s;
+ int *l;
+ int *p;
if (!c_r)
return 0;
- if (TT.cur_col == c_r->line->len-1 || !c_r->line->len)
- goto next_line;
- if (strchr(empties, c_r->line->data[TT.cur_col]))
- goto find_non_empty;
- if (strchr(specials, c_r->line->data[TT.cur_col])) {
- for (;strchr(specials, c_r->line->data[TT.cur_col]); ) {
- TT.cur_col++;
- if (TT.cur_col == c_r->line->len-1)
- goto next_line;
- }
- } else for (;!strchr(specials, c_r->line->data[TT.cur_col]) &&
- !strchr(empties, c_r->line->data[TT.cur_col]);) {
- TT.cur_col++;
- if (TT.cur_col == c_r->line->len-1)
- goto next_line;
+ s = c_r->line->str_data;
+ l = &c_r->line->str_len;
+ p = &TT.cur_col;
+ if (!(*l)) return 0;
+ if ((*p) == (*l)-1) {
+ s[*p] = 0;
+ if (*p) (*p)--;
+ (*l)--;
+ } else {
+ memmove(s+(*p), s+(*p)+1, (*l)-(*p));
+ s[*l] = 0;
+ (*l)--;
}
+ count--;
+ return (count) ? vi_x(count) : 1;
+}
- for (;strchr(empties, c_r->line->data[TT.cur_col]); ) {
+//move commands does not behave correct way yet.
+//only jump to next space for now.
+int vi_movw(int count)
+{
+ if (!c_r)
+ return 0;
+ //could we call moveend first
+ while (c_r->line->str_data[TT.cur_col] > ' ')
+ TT.cur_col++;
+ while (c_r->line->str_data[TT.cur_col] <= ' ') {
TT.cur_col++;
-find_non_empty:
- if (TT.cur_col == c_r->line->len-1) {
-next_line:
+ if (!c_r->line->str_data[TT.cur_col]) {
//we could call j and g0
if (!c_r->down) return 0;
c_r = c_r->down;
TT.cur_col = 0;
- if (!c_r->line->len) break;
}
}
count--;
- if (count>0)
- return vi_movw(count, 1, 0);
+ if (count>1)
+ return vi_movw(count);
check_cursor_bounds();
+ adjust_screen_buffer();
return 1;
}
-static int vi_movb(int count0, int count1, char* unused)
+int vi_movb(int count)
{
- int count = count0*count1;
if (!c_r)
return 0;
if (!TT.cur_col) {
if (!c_r->up) return 0;
c_r = c_r->up;
- TT.cur_col = (c_r->line->len) ? c_r->line->len-1 : 0;
+ TT.cur_col = (c_r->line->str_len) ? c_r->line->str_len-1 : 0;
goto exit_function;
}
if (TT.cur_col)
TT.cur_col--;
- while (c_r->line->data[TT.cur_col] <= ' ') {
+ while (c_r->line->str_data[TT.cur_col] <= ' ') {
if (TT.cur_col) TT.cur_col--;
else goto exit_function;
}
- while (c_r->line->data[TT.cur_col] > ' ') {
+ while (c_r->line->str_data[TT.cur_col] > ' ') {
if (TT.cur_col)TT.cur_col--;
else goto exit_function;
}
@@ -327,531 +328,143 @@ static int vi_movb(int count0, int count1, char* unused)
exit_function:
count--;
if (count>1)
- return vi_movb(count, 1, 0);
- TT.vi_mov_flag |= 0x80000000;
+ return vi_movb(count);
check_cursor_bounds();
+ adjust_screen_buffer();
return 1;
}
-static int vi_move(int count0, int count1, char *unused)
+int vi_move(int count)
{
- int count = count0*count1;
if (!c_r)
return 0;
- if (TT.cur_col < c_r->line->len)
+ if (TT.cur_col < c_r->line->str_len)
TT.cur_col++;
- if (c_r->line->data[TT.cur_col] <= ' ' || count > 1)
- vi_movw(count, 1, 0); //find next word;
- while (c_r->line->data[TT.cur_col] > ' ')
+ if (c_r->line->str_data[TT.cur_col] <= ' ' || count > 1)
+ vi_movw(count); //find next word;
+ while (c_r->line->str_data[TT.cur_col] > ' ')
TT.cur_col++;
if (TT.cur_col) TT.cur_col--;
- TT.vi_mov_flag |= 2;
check_cursor_bounds();
+ adjust_screen_buffer();
return 1;
}
-
-static void i_insert(char* str, int len)
+void i_insert()
{
- char *t = xzalloc(c_r->line->alloc);
- char *s = c_r->line->data;
- int sel = c_r->line->len-TT.cur_col;
+ char *t = xzalloc(c_r->line->alloc_len);
+ char *s = c_r->line->str_data;
+ int sel = c_r->line->str_len-TT.cur_col;
strncpy(t, &s[TT.cur_col], sel);
t[sel+1] = 0;
- if (c_r->line->alloc < c_r->line->len+len+5) {
- c_r->line->data = xrealloc(c_r->line->data,
- (c_r->line->alloc+len)<<1);
+ if (c_r->line->alloc_len < c_r->line->str_len+il->str_len+5) {
+ c_r->line->str_data = xrealloc(c_r->line->str_data,
+ c_r->line->alloc_len*2+il->alloc_len*2);
- c_r->line->alloc = (c_r->line->alloc+len)<<1;
- memset(&c_r->line->data[c_r->line->len], 0,
- c_r->line->alloc-c_r->line->len);
+ c_r->line->alloc_len = c_r->line->alloc_len*2+2*il->alloc_len;
+ memset(&c_r->line->str_data[c_r->line->str_len], 0,
+ c_r->line->alloc_len-c_r->line->str_len);
- s = c_r->line->data;
+ s = c_r->line->str_data;
}
- strncpy(&s[TT.cur_col], str, len);
- strcpy(&s[TT.cur_col+len], t);
- TT.cur_col += len;
+ strcpy(&s[TT.cur_col], il->str_data);
+ strcpy(&s[TT.cur_col+il->str_len], t);
+ TT.cur_col += il->str_len;
if (TT.cur_col) TT.cur_col--;
-
- c_r->line->len += len;
+ c_r->line->str_len += il->str_len;
free(t);
- TT.vi_mov_flag |= 0x30000000;
}
//new line at split pos;
void i_split()
{
- int alloc = 0, len = 0, idx = 0;
struct str_line *l = xmalloc(sizeof(struct str_line));
- alloc = c_r->line->alloc;
-
- if (TT.cur_col) len = c_r->line->len-TT.cur_col-1;
- else len = c_r->line->len;
- if (len < 0) len = 0;
-
- l->data = xzalloc(alloc);
- l->alloc = alloc;
- l->len = len;
- idx = c_r->line->len - len;
-
- strncpy(l->data, &c_r->line->data[idx], len);
- memset(&l->data[len], 0, alloc-len);
-
- c_r->line->len -= len;
- if (c_r->line->len <= 0) c_r->line->len = 0;
-
- len = c_r->line->len;
-
- memset(&c_r->line->data[len], 0, alloc-len);
+ int l_a = c_r->line->alloc_len;
+ int l_len = c_r->line->str_len-TT.cur_col;
+ l->str_data = xzalloc(l_a);
+ l->alloc_len = l_a;
+ l->str_len = l_len;
+ strncpy(l->str_data, &c_r->line->str_data[TT.cur_col], l_len);
+ l->str_data[l_len] = 0;
+ c_r->line->str_len -= l_len;
+ c_r->line->str_data[c_r->line->str_len] = 0;
c_r = (struct linelist*)dlist_insert((struct double_list**)&c_r, (char*)l);
c_r->line = l;
TT.cur_col = 0;
-}
-
-
-static int vi_zero(int count0, int count1, char *unused)
-{
- TT.cur_col = 0;
- TT.vi_mov_flag |= 0x80000000;
- return 1;
-}
-
-static int vi_eol(int count0, int count1, char *unused)
-{
- int count = count0*count1;
- for (;count > 1 && c_r->down; count--)
- c_r = c_r->down;
-
- if (c_r && c_r->line->len)
- TT.cur_col = c_r->line->len-1;
- TT.vi_mov_flag |= 2;
check_cursor_bounds();
- return 1;
-}
-
-//TODO check register where to push from
-static int vi_push(char reg, int count0, int count1)
-{
- char *start = yank.data, *end = yank.data+strlen(yank.data);
- struct linelist *cursor = c_r;
- int col = TT.cur_col;
- //insert into new lines
- if (*(end-1) == '\n') for (;start != end;) {
- TT.vi_mov_flag |= 0x10000000;
- char *next = strchr(start, '\n');
- TT.cur_col = (c_r->line->len) ? c_r->line->len-1: 0;
- i_split();
- if (next) {
- i_insert(start, next-start);
- start = next+1;
- } else start = end; //??
- }
-
- //insert into cursor
- else for (;start != end;) {
- char *next = strchr(start, '\n');
- if (next) {
- TT.vi_mov_flag |= 0x10000000;
- i_insert(start, next-start);
- i_split();
- start = next+1;
- } else {
- i_insert(start, strlen(start));
- start = end;
- }
- }
- //if row changes during push original cursor position is kept
- //vi inconsistancy
- if (c_r != cursor) c_r = cursor, TT.cur_col = col;
-
- return 1;
-}
-
-static int vi_find_c(int count0, int count1, char *symbol)
-{
- int count = count0*count1;
- if (c_r && c_r->line->len) {
- while (count--) {
- char* pos = strstr(&c_r->line->data[TT.cur_col], symbol);
- if (pos) {
- TT.cur_col = pos-c_r->line->data;
- return 1;
- }
- }
- }
- return 0;
-}
-
-static int vi_find_cb(int count0, int count1, char *symbol)
-{
- //do backward search
- return 1;
-}
-
-//if count is not spesified should go to last line
-static int vi_go(int count0, int count1, char *symbol)
-{
- int prev_row = TT.cur_row;
- c_r = text;
-
- if (TT.vi_mov_flag&0x40000000) for (;c_r && c_r->down; c_r = c_r->down);
- else for (;c_r && c_r->down && --count0; c_r = c_r->down);
-
- TT.cur_col = 0;
- check_cursor_bounds(); //adjusts cursor column
- if (prev_row>TT.cur_row) TT.vi_mov_flag |= 0x80000000;
-
- return 1;
-}
-
-//need to refactor when implementing yank buffers
-static int vi_delete(char reg, struct linelist *row, int col, int flags)
-{
- struct linelist *start = 0, *end = 0;
- int col_s = 0, col_e = 0, bytes = 0;
-
- vi_yank(reg, row, col, flags);
-
- if (TT.vi_mov_flag&0x80000000) {
- start = c_r, end = row;
- col_s = TT.cur_col, col_e = col;
- } else {
- start = row, end = c_r;
- col_s = col, col_e = TT.cur_col;
- }
- if (start == end) goto last_line_delete;
- if (!col_s) goto full_line_delete;
-
- memset(start->line->data+col_s, 0, start->line->len-col_s);
- row->line->len = col_s;
- col_s = 0;
- start = start->down;
-
-full_line_delete:
- TT.vi_mov_flag |= 0x10000000;
- for (;start != end;) {
- struct linelist* lst = start;
- //struct linelist *lst = dlist_pop(&start);
- start = start->down;
- if (lst->down) lst->down->up = lst->up;
- if (lst->up) lst->up->down = lst->down;
- if (screen == lst) screen = lst->down ? lst->down : lst->up;
- if (text == lst) text = lst->down;
- free(lst->line->data);
- free(lst->line);
- free(lst);
- }
-last_line_delete:
- TT.vi_mov_flag |= 0x10000000;
- if (TT.vi_mov_flag&2) col_e = start->line->len;
- if (TT.vi_mov_flag&4) {
- if (!end->down && !end->up)
- col_e = start->line->len;
- else {
- col_e = 0, col_s = 0;
- if (end->down) end->down->up = end->up;
- if (end->up) end->up->down = end->down;
- if (screen == end) screen = end->down ? end->down : end->up;
- //if (text == end) text = end->down;
- start = end->down ? end->down : end->up;
- free(end->line->data);
- free(end->line);
- free(end);
-
- }
- }
- if (col_s < col_e) {
- bytes = col_s + start->line->len - col_e;
- memmove(start->line->data+col_s, start->line->data+col_e,
- start->line->len-col_e);
- memset(start->line->data+bytes, 0, start->line->len-bytes);
- start->line->len = bytes;
- }
- c_r = start;
- TT.cur_col = col_s;
- return 1;
-}
-
-static int vi_D(char reg, int count0, int count1)
-{
- int prev_col = TT.cur_col;
- struct linelist *pos = c_r;
- if (!count0) return 1;
- vi_eol(1, 1, 0);
- vi_delete(reg, pos, prev_col, 0);
- count0--;
- if (count0 && c_r->down) {
- c_r = c_r->down;
- vi_dd(reg, count0, 1);
- }
- check_cursor_bounds();
- return 1;
-}
-
-static int vi_join(char reg, int count0, int count1)
-{
- while (count0--) {
- if (c_r && c_r->down) {
- int size = c_r->line->len+c_r->down->line->len;
- if (size > c_r->line->alloc) {
- if (size > c_r->down->line->alloc) {
- c_r->line->data = xrealloc(c_r->line->data,
- c_r->line->alloc*2+il->alloc*2);
- memmove(&c_r->line->data[c_r->line->len],
- c_r->down->line->data,c_r->down->line->len);
- c_r->line->len = size;
- c_r = c_r->down;
- c_r->line->alloc = c_r->line->alloc*2+2*il->alloc;
- vi_dd(0,1,1);
- } else {
- memmove(&c_r->down->line->data[c_r->line->len],
- c_r->down->line->data,c_r->down->line->len);
- memmove(c_r->down->line->data,c_r->line->data,
- c_r->line->len);
- c_r->down->line->len = size;
- vi_dd(0,1,1);
- }
- } else {
- memmove(&c_r->line->data[c_r->line->len],
- c_r->down->line->data,c_r->down->line->len);
- c_r->line->len = size;
- c_r = c_r->down;
- vi_dd(0,1,1);
- }
- c_r = c_r->up;
-
- }
- }
- return 1;
-}
-
-static int vi_find_next(char reg, int count0, int count1)
-{
- if (TT.last_search) search_str(TT.last_search);
- return 1;
-}
-
-static int vi_change(char reg, struct linelist *row, int col, int flags)
-{
- vi_delete(reg, row, col, flags);
- TT.vi_mode = 2;
- return 1;
-}
-
-//TODO search yank buffer by register
-//now only supports default register
-static int vi_yank(char reg, struct linelist *row, int col, int flags)
-{
- struct linelist *start = 0, *end = 0;
- int col_s = 0, col_e = 0, bytes = 0;
-
- memset(yank.data, 0, yank.alloc);
- if (TT.vi_mov_flag&0x80000000) {
- start = c_r, end = row;
- col_s = TT.cur_col, col_e = col;
- } else {
- start = row, end = c_r;
- col_s = col, col_e = TT.cur_col;
- }
- if (start == end) goto last_line_yank;
- if (!col_s) goto full_line_yank;
-
- if (yank.alloc < start->line->alloc) {
- yank.data = xrealloc(yank.data, start->line->alloc*2);
- yank.alloc = start->line->alloc*2;
- }
-
- sprintf(yank.data, "%s\n", start->line->data+col_s);
- col_s = 0;
- start = start->down;
-
-full_line_yank:
- for (;start != end;) {
- while (yank.alloc-1 < strlen(yank.data)+start->line->len)
- yank.data = xrealloc(yank.data, yank.alloc*2), yank.alloc *= 2;
-
-
- sprintf(yank.data+strlen(yank.data), "%s\n", start->line->data);
- start = start->down;
- }
-last_line_yank:
- while (yank.alloc-1 < strlen(yank.data)+end->line->len)
- yank.data = xrealloc(yank.data, yank.alloc*2), yank.alloc *= 2;
-
- if (TT.vi_mov_flag & 0x4)
- sprintf(yank.data+strlen(yank.data), "%s\n", start->line->data);
- else {
- bytes = strlen(yank.data)+col_e-col_s;
- strncpy(yank.data+strlen(yank.data), end->line->data+col_s, col_e-col_s);
- yank.data[bytes] = 0;
- }
- return 1;
+ adjust_screen_buffer();
}
-//NOTES
-//vi-mode cmd syntax is
-//("[REG])[COUNT0]CMD[COUNT1](MOV)
-//where:
-//-------------------------------------------------------------
-//"[REG] is optional buffer where deleted/yanked text goes REG can be
-// atleast 0-9, a-z or default "
-//[COUNT] is optional multiplier for cmd execution if there is 2 COUNT
-// operations they are multiplied together
-//CMD is operation to be executed
-//(MOV) is movement operation, some CMD does not require MOV and some
-// have special cases such as dd, yy, also movements can work without
-// CMD
-//ex commands can be even more complicated than this....
-//
struct vi_cmd_param {
- const char* cmd;
- unsigned flags;
- int (*vi_cmd)(char, struct linelist*, int, int);//REG,row,col,FLAGS
-};
-struct vi_mov_param {
- const char* mov;
- unsigned flags;
- int (*vi_mov)(int, int, char*);//COUNT0,COUNT1,params
-};
-//special cases without MOV and such
-struct vi_special_param {
const char *cmd;
- int (*vi_special)(char, int, int);//REG,COUNT0,COUNT1
+ int (*vi_cmd_ptr)(int);
};
-struct vi_special_param vi_special[] =
+
+struct vi_cmd_param vi_cmds[7] =
{
- {"dd", &vi_dd},
- {"yy", &vi_yy},
- {"D", &vi_D},
- {"J", &vi_join},
- {"n", &vi_find_next},
+ {"dd", &ex_dd},
+ {"dw", &ex_dw},
+ {"d$", &ex_deol},
+ {"w", &vi_movw},
+ {"b", &vi_movb},
+ {"e", &vi_move},
{"x", &vi_x},
- {"p", &vi_push}
-};
-//there is around ~47 vi moves
-//some of them need extra params
-//such as f and '
-struct vi_mov_param vi_movs[] =
-{
- {"0", 0, &vi_zero},
- {"b", 0, &vi_movb},
- {"e", 0, &vi_move},
- {"G", 0, &vi_go},
- {"h", 0, &cur_left},
- {"j", 0, &cur_down},
- {"k", 0, &cur_up},
- {"l", 0, &cur_right},
- {"w", 0, &vi_movw},
- {"$", 0, &vi_eol},
- {"f", 1, &vi_find_c},
- {"F", 1, &vi_find_cb},
-};
-//change and delete unfortunately behave different depending on move command,
-//such as ce cw are same, but dw and de are not...
-//also dw stops at w position and cw seem to stop at e pos+1...
-//so after movement we need to possibly set up some flags before executing
-//command, and command needs to adjust...
-struct vi_cmd_param vi_cmds[] =
-{
- {"c", 1, &vi_change},
- {"d", 1, &vi_delete},
- {"y", 1, &vi_yank},
};
int run_vi_cmd(char *cmd)
{
- int i = 0, val = 0;
+ int val = 0;
char *cmd_e;
- int (*vi_cmd)(char, struct linelist*, int, int) = 0;
- int (*vi_mov)(int, int, char*) = 0;
-
- TT.count0 = 0, TT.count1 = 0, TT.vi_mov_flag = 0;
- TT.vi_reg = '"';
-
- if (*cmd == '"') {
- cmd++;
- TT.vi_reg = *cmd; //TODO check validity
- cmd++;
- }
errno = 0;
+ int i = 0;
val = strtol(cmd, &cmd_e, 10);
- if (errno || val == 0) val = 1, TT.vi_mov_flag |= 0x40000000;
- else cmd = cmd_e;
- TT.count0 = val;
-
- for (i = 0; i < ARRAY_LEN(vi_special); i++) {
- if (strstr(cmd, vi_special[i].cmd)) {
- return vi_special[i].vi_special(TT.vi_reg, TT.count0, TT.count1);
- }
+ if (errno || val == 0) {
+ val = 1;
}
-
- for (i = 0; i < ARRAY_LEN(vi_cmds); i++) {
- if (!strncmp(cmd, vi_cmds[i].cmd, strlen(vi_cmds[i].cmd))) {
- vi_cmd = vi_cmds[i].vi_cmd;
- cmd += strlen(vi_cmds[i].cmd);
- break;
- }
+ else {
+ cmd = cmd_e;
}
- errno = 0;
- val = strtol(cmd, &cmd_e, 10);
- if (errno || val == 0) val = 1;
- else cmd = cmd_e;
- TT.count1 = val;
-
- for (i = 0; i < ARRAY_LEN(vi_movs); i++) {
- if (!strncmp(cmd, vi_movs[i].mov, strlen(vi_movs[i].mov))) {
- vi_mov = vi_movs[i].vi_mov;
- TT.vi_mov_flag |= vi_movs[i].flags;
- cmd++;
- if (TT.vi_mov_flag&1 && !(*cmd)) return 0;
- break;
+ for (; i<7; i++) {
+ if (strstr(cmd, vi_cmds[i].cmd)) {
+ return vi_cmds[i].vi_cmd_ptr(val);
}
}
- if (vi_mov) {
- int prev_col = TT.cur_col;
- struct linelist *pos = c_r;
- if (vi_mov(TT.count0, TT.count1, cmd)) {
- if (vi_cmd) return (vi_cmd(TT.vi_reg, pos, prev_col, TT.vi_mov_flag));
- else return 1;
- } else return 0; //return some error
- }
return 0;
+
}
-static int search_str(char *s)
+int search_str(char *s)
{
struct linelist *lst = c_r;
- char *c = strstr(&c_r->line->data[TT.cur_col+1], s);
-
- if (TT.last_search != s) {
- free(TT.last_search);
- TT.last_search = xstrdup(s);
- }
-
+ char *c = strstr(&c_r->line->str_data[TT.cur_col], s);
if (c) {
- TT.cur_col = c-c_r->line->data;
- } else for (; !c;) {
+ TT.cur_col = c_r->line->str_data-c;
+ TT.cur_col = c-c_r->line->str_data;
+ }
+ else for (; !c;) {
lst = lst->down;
if (!lst) return 1;
- c = strstr(lst->line->data, s);
+ c = strstr(&lst->line->str_data[TT.cur_col], s);
}
c_r = lst;
- TT.cur_col = c-c_r->line->data;
- check_cursor_bounds();
+ TT.cur_col = c-c_r->line->str_data;
return 0;
}
int run_ex_cmd(char *cmd)
{
if (cmd[0] == '/') {
- search_str(&cmd[1]);
+ //search pattern
+ if (!search_str(&cmd[1]) ) {
+ check_cursor_bounds();
+ adjust_screen_buffer();
+ }
} else if (cmd[0] == '?') {
- // TODO: backwards search.
+
} else if (cmd[0] == ':') {
- if (!strcmp(&cmd[1], "q") || !strcmp(&cmd[1], "q!")) {
- // TODO: if no !, check whether file modified.
+ if (strstr(&cmd[1], "q!")) {
//exit_application;
return -1;
}
@@ -863,16 +476,6 @@ int run_ex_cmd(char *cmd)
write_file(0);
return 1;
}
- else if (strstr(&cmd[1], "set list")) {
- TT.list = 1;
- TT.vi_mov_flag |= 0x30000000;
- return 1;
- }
- else if (strstr(&cmd[1], "set nolist")) {
- TT.list = 0;
- TT.vi_mov_flag |= 0x30000000;
- return 1;
- }
}
return 0;
@@ -880,53 +483,38 @@ int run_ex_cmd(char *cmd)
void vi_main(void)
{
- char keybuf[16] = {0};
- char vi_buf[16] = {0};
- char utf8_code[8] = {0};
- int utf8_dec_p = 0, vi_buf_pos = 0;
-
+ char keybuf[16];
+ char utf8_code[8];
+ int utf8_dec_p = 0;
+ int key = 0;
+ char vi_buf[16];
+ int vi_buf_pos = 0;
il = xzalloc(sizeof(struct str_line));
- il->data = xzalloc(80);
- yank.data = xzalloc(128);
-
- il->alloc = 80, yank.alloc = 128;
-
+ il->str_data = xzalloc(80);
+ il->alloc_len = 80;
+ keybuf[0] = 0;
+ memset(vi_buf, 0, 16);
+ memset(utf8_code, 0, 8);
linelist_load(0);
- screen = c_r = text;
-
- TT.vi_mov_flag = 0x20000000;
- TT.vi_mode = 1, TT.tabstop = 8;
- TT.screen_width = 80, TT.screen_height = 24;
-
+ scr_r = text;
+ c_r = text;
+ TT.cur_row = 0;
+ TT.cur_col = 0;
+ TT.screen_width = 80;
+ TT.screen_height = 24;
+ TT.vi_mode = 1;
terminal_size(&TT.screen_width, &TT.screen_height);
TT.screen_height -= 2; //TODO this is hack fix visual alignment
-
set_terminal(0, 1, 0, 0);
//writes stdout into different xterm buffer so when we exit
//we dont get scroll log full of junk
tty_esc("?1049h");
tty_esc("H");
- xflush(1);
-
-
+ xflush();
draw_page();
while(1) {
- int key = scan_key(keybuf, -1);
-
- terminal_size(&TT.screen_width, &TT.screen_height);
- TT.screen_height -= 2; //TODO this is hack fix visual alignment
-
- // TODO: support cursor keys in ex mode too.
- if (TT.vi_mode && key>=256) {
- key -= 256;
- if (key==KEY_UP) cur_up(1, 1, 0);
- else if (key==KEY_DOWN) cur_down(1, 1, 0);
- else if (key==KEY_LEFT) cur_left(1, 1, 0);
- else if (key==KEY_RIGHT) cur_right(1, 1, 0);
- draw_page();
- continue;
- }
-
+ key = scan_key(keybuf, -1);
+ printf("key %d\n", key);
switch (key) {
case -1:
case 3:
@@ -935,19 +523,28 @@ void vi_main(void)
}
if (TT.vi_mode == 1) { //NORMAL
switch (key) {
+ case 'h':
+ cur_left();
+ break;
+ case 'j':
+ cur_down();
+ break;
+ case 'k':
+ cur_up();
+ break;
+ case 'l':
+ cur_right();
+ break;
case '/':
case '?':
case ':':
TT.vi_mode = 0;
- il->data[0]=key;
- il->len++;
+ il->str_data[0]=key;
+ il->str_len++;
break;
- case 'A':
- vi_eol(1, 1, 0);
- // FALLTHROUGH
case 'a':
- if (c_r && c_r->line->len) TT.cur_col++;
- // FALLTHROUGH
+ if (c_r && c_r->line->str_len)
+ TT.cur_col++;
case 'i':
TT.vi_mode = 2;
break;
@@ -957,7 +554,7 @@ void vi_main(void)
break;
default:
if (key > 0x20 && key < 0x7B) {
- vi_buf[vi_buf_pos] = key;//TODO handle input better
+ vi_buf[vi_buf_pos] = key;
vi_buf_pos++;
if (run_vi_cmd(vi_buf)) {
memset(vi_buf, 0, 16);
@@ -965,7 +562,6 @@ void vi_main(void)
}
else if (vi_buf_pos == 16) {
vi_buf_pos = 0;
- memset(vi_buf, 0, 16);
}
}
@@ -974,71 +570,71 @@ void vi_main(void)
}
} else if (TT.vi_mode == 0) { //EX MODE
switch (key) {
+ case 27:
+ TT.vi_mode = 1;
+ il->str_len = 0;
+ memset(il->str_data, 0, il->alloc_len);
+ break;
case 0x7F:
case 0x08:
- if (il->len > 1) {
- il->data[--il->len] = 0;
- break;
+ if (il->str_len) {
+ il->str_data[il->str_len] = 0;
+ if (il->str_len > 1) il->str_len--;
}
- // FALLTHROUGH
- case 27:
- TT.vi_mode = 1;
- il->len = 0;
- memset(il->data, 0, il->alloc);
break;
case 0x0D:
- if (run_ex_cmd(il->data) == -1)
- goto cleanup_vi;
+ if (run_ex_cmd(il->str_data) == -1)
+ goto cleanup_vi;
TT.vi_mode = 1;
- il->len = 0;
- memset(il->data, 0, il->alloc);
+ il->str_len = 0;
+ memset(il->str_data, 0, il->alloc_len);
break;
default: //add chars to ex command until ENTER
if (key >= 0x20 && key < 0x7F) { //might be utf?
- if (il->len == il->alloc) {
- il->data = realloc(il->data, il->alloc*2);
- il->alloc *= 2;
+ if (il->str_len == il->alloc_len) {
+ il->str_data = realloc(il->str_data, il->alloc_len*2);
+ il->alloc_len *= 2;
}
- il->data[il->len] = key;
- il->len++;
+ il->str_data[il->str_len] = key;
+ il->str_len++;
}
break;
}
} else if (TT.vi_mode == 2) {//INSERT MODE
switch (key) {
case 27:
- i_insert(il->data, il->len);
+ i_insert();
TT.vi_mode = 1;
- il->len = 0;
- memset(il->data, 0, il->alloc);
+ il->str_len = 0;
+ memset(il->str_data, 0, il->alloc_len);
break;
case 0x7F:
case 0x08:
- if (il->len) {
- char *last = utf8_last(il->data, il->len);
- int shrink = strlen(last);
- memset(last, 0, shrink);
- il->len -= shrink;
- }
+ if (il->str_len)
+ il->str_data[il->str_len--] = 0;
+ break;
+ case 0x09:
+ //TODO implement real tabs
+ il->str_data[il->str_len++] = ' ';
+ il->str_data[il->str_len++] = ' ';
break;
+
case 0x0D:
//insert newline
//
- i_insert(il->data, il->len);
- il->len = 0;
- memset(il->data, 0, il->alloc);
+ i_insert();
+ il->str_len = 0;
+ memset(il->str_data, 0, il->alloc_len);
i_split();
break;
default:
- if ((key >= 0x20 || key == 0x09) &&
- utf8_dec(key, utf8_code, &utf8_dec_p)) {
-
- if (il->len+utf8_dec_p+1 >= il->alloc) {
- il->data = realloc(il->data, il->alloc*2);
- il->alloc *= 2;
+ if (key >= 0x20 && utf8_dec(key, utf8_code, &utf8_dec_p)) {
+ if (il->str_len+utf8_dec_p+1 >= il->alloc_len) {
+ il->str_data = realloc(il->str_data, il->alloc_len*2);
+ il->alloc_len *= 2;
}
- strcpy(il->data+il->len, utf8_code);
- il->len += utf8_dec_p;
+ strcpy(il->str_data+il->str_len, utf8_code);
+ il->str_len += utf8_dec_p;
utf8_dec_p = 0;
*utf8_code = 0;
@@ -1051,201 +647,121 @@ void vi_main(void)
}
cleanup_vi:
- linelist_unload();
- free(il->data), free(il), free(yank.data);
tty_reset();
tty_esc("?1049l");
}
-int vi_crunch(FILE* out, int cols, int wc)
-{
- int ret = 0;
- if (wc < 32 && TT.list) {
- tty_esc("1m");
- ret = crunch_escape(out,cols,wc);
- tty_esc("m");
- } else if (wc == 0x09) {
- if (out) {
- int i = TT.tabstop;
- for (;i--;) fputs(" ", out);
- }
- ret = TT.tabstop;
- }
- return ret;
-}
-
-//crunch_str with n bytes restriction for printing substrings or
-//non null terminated strings
-int crunch_nstr(char **str, int width, int n, FILE *out, char *escmore,
- int (*escout)(FILE *out, int cols, int wc))
-{
- int columns = 0, col, bytes;
- char *start, *end;
-
- for (end = start = *str; *end && n>0; columns += col, end += bytes, n -= bytes) {
- wchar_t wc;
-
- if ((bytes = utf8towc(&wc, end, 4))>0 && (col = wcwidth(wc))>=0) {
- if (!escmore || wc>255 || !strchr(escmore, wc)) {
- if (width-columns<col) break;
- if (out) fwrite(end, bytes, 1, out);
-
- continue;
- }
- }
-
- if (bytes<1) {
- bytes = 1;
- wc = *end;
- }
- col = width-columns;
- if (col<1) break;
- if (escout) {
- if ((col = escout(out, col, wc))<0) break;
- } else if (out) fwrite(end, 1, bytes, out);
- }
- *str = end;
-
- return columns;
-}
-
static void draw_page()
{
- struct linelist *scr_buf = 0;
unsigned y = 0;
- int x = 0;
-
- char *line = 0, *end = 0;
- int utf_l = 0, bytes = 0;
-
- //screen coordinates for cursor
- int cy_scr = 0, cx_scr = 0;
-
- //variables used only for cursor handling
- int aw = 0, iw = 0, clip = 0, margin = 8;
-
- int scroll = 0, redraw = 0;
+ int cy_scr = 0;
+ int cx_scr = 0;
+ int utf_l = 0;
- adjust_screen_buffer();
- scr_buf = screen;
- redraw = (TT.vi_mov_flag & 0x30000000)>>28;
-
- scroll = TT.drawn_row-TT.scr_row;
- if (TT.drawn_row<0 || TT.cur_row<0 || TT.scr_row<0) redraw = 3;
- else if (abs(scroll)>TT.screen_height/2) redraw = 3;
+ char* line = 0;
+ int bytes = 0;
+ int drawn = 0;
+ int x = 0;
+ struct linelist *scr_buf= scr_r;
+ //clear screen
+ tty_esc("2J");
+ tty_esc("H");
tty_jump(0, 0);
- if (redraw&2) tty_esc("2J"), tty_esc("H"); //clear screen
- else if (scroll>0) printf("\033[%dL", scroll); //scroll up
- else if (scroll<0) printf("\033[%dM", -scroll); //scroll down
-
- //jump until cursor
- for (; y < TT.screen_height; y++ ) {
- if (scr_buf == c_r) break;
- scr_buf = scr_buf->down;
- }
- //draw cursor row
- /////////////////////////////////////////////////////////////
- //for long lines line starts to scroll when cursor hits margin
- line = scr_buf->line->data;
- bytes = TT.cur_col;
- end = line;
-
- tty_jump(0, y);
- tty_esc("2K");
- //find cursor position
- aw = crunch_nstr(&end, 1024, bytes, 0, "\t", vi_crunch);
-
- //if we need to render text that is not inserted to buffer yet
- if (TT.vi_mode == 2 && il->len) {
- char* iend = il->data; //input end
- x = 0;
- //find insert end position
- iw = crunch_str(&iend, 1024, 0, "\t", vi_crunch);
- clip = (aw+iw) - TT.screen_width+margin;
-
- //if clipped area is bigger than text before insert
- if (clip > aw) {
- clip -= aw;
- iend = il->data;
-
- iw -= crunch_str(&iend, clip, 0, "\t", vi_crunch);
- x = crunch_str(&iend, iw, stdout, "\t", vi_crunch);
+ //draw lines until cursor row
+ for (; y < TT.screen_height; ) {
+ if (line && bytes) {
+ draw_str_until(&drawn, line, TT.screen_width, bytes);
+ bytes = drawn ? (bytes-drawn) : 0;
+ line = bytes ? (line+drawn) : 0;
+ y++;
+ tty_jump(0, y);
+ } else if (scr_buf && scr_buf->line->str_data && scr_buf->line->str_len) {
+ if (scr_buf == c_r)
+ break;
+ line = scr_buf->line->str_data;
+ bytes = scr_buf->line->str_len;
+ scr_buf = scr_buf->down;
} else {
- iend = il->data;
- end = line;
-
- //if clipped area is substring from cursor row start
- aw -= crunch_nstr(&end, clip, bytes, 0, "\t", vi_crunch);
- x = crunch_str(&end, aw, stdout, "\t", vi_crunch);
- x += crunch_str(&iend, iw, stdout, "\t", vi_crunch);
+ if (scr_buf == c_r)
+ break;
+ y++;
+ tty_jump(0, y);
+ //printf(" \n");
+ if (scr_buf) scr_buf = scr_buf->down;
}
+
}
- //when not inserting but still need to keep cursor inside screen
- //margin area
- else if ( aw+margin > TT.screen_width) {
- clip = aw-TT.screen_width+margin;
- end = line;
- aw -= crunch_nstr(&end, clip, bytes, 0, "\t", vi_crunch);
- x = crunch_str(&end, aw, stdout, "\t", vi_crunch);
- }
- else {
- end = line;
- x = crunch_nstr(&end, aw, bytes, stdout, "\t", vi_crunch);
+ //draw cursor row until cursor
+ //this is to calculate cursor position on screen and possible insert
+ line = scr_buf->line->str_data;
+ bytes = TT.cur_col;
+ for (; y < TT.screen_height; ) {
+ if (bytes) {
+ x = draw_str_until(&drawn, line, TT.screen_width, bytes);
+ bytes = drawn ? (bytes-drawn) : 0;
+ line = bytes ? (line+drawn) : 0;
+ }
+ if (!bytes) break;
+ y++;
+ tty_jump(0, y);
}
- cx_scr = x;
- cy_scr = y;
- if (scr_buf->line->len > bytes) {
- x += crunch_str(&end, TT.screen_width-x, stdout, "\t", vi_crunch);
+ if (TT.vi_mode == 2 && il->str_len) {
+ line = il->str_data;
+ bytes = il->str_len;
+ cx_scr = x;
+ cy_scr = y;
+ x = draw_str_until(&drawn, line, TT.screen_width-x, bytes);
+ bytes = drawn ? (bytes-drawn) : 0;
+ line = bytes ? (line+drawn) : 0;
+ cx_scr += x;
+ for (; y < TT.screen_height; ) {
+ if (bytes) {
+ x = draw_str_until(&drawn, line, TT.screen_width, bytes);
+ bytes = drawn ? (bytes-drawn) : 0;
+ line = bytes ? (line+drawn) : 0;
+ cx_scr = x;
+ }
+ if (!bytes) break;
+ y++;
+ cy_scr = y;
+ tty_jump(0, y);
+ }
+ } else {
+ cy_scr = y;
+ cx_scr = x;
}
+ line = scr_buf->line->str_data+TT.cur_col;
+ bytes = scr_buf->line->str_len-TT.cur_col;
+ scr_buf = scr_buf->down;
+ x = draw_str_until(&drawn,line, TT.screen_width-x, bytes);
+ bytes = drawn ? (bytes-drawn) : 0;
+ line = bytes ? (line+drawn) : 0;
+ y++;
+ tty_jump(0, y);
- if (scr_buf) scr_buf = scr_buf->down;
- // drawing cursor row ends
- ///////////////////////////////////////////////////////////////////
-
- //start drawing all other rows that needs update
- ///////////////////////////////////////////////////////////////////
- y = 0, scr_buf = screen;
-
- //if we moved around in long line might need to redraw everything
- if (clip != TT.drawn_col) redraw = 3;
-
- for (; y < TT.screen_height; y++ ) {
- int draw_line = 0;
- if (scr_buf == c_r) {
+//draw until end
+ for (; y < TT.screen_height; ) {
+ if (line && bytes) {
+ draw_str_until(&drawn, line, TT.screen_width, bytes);
+ bytes = drawn ? (bytes-drawn) : 0;
+ line = bytes ? (line+drawn) : 0;
+ y++;
+ tty_jump(0, y);
+ } else if (scr_buf && scr_buf->line->str_data && scr_buf->line->str_len) {
+ line = scr_buf->line->str_data;
+ bytes = scr_buf->line->str_len;
scr_buf = scr_buf->down;
- continue;
- } else if (redraw) draw_line++;
- else if (scroll<0 && TT.screen_height-y-1<-scroll)
- scroll++, draw_line++;
- else if (scroll>0) scroll--, draw_line++;
-
- tty_jump(0, y);
- if (draw_line) {
-
- tty_esc("2K");
- if (scr_buf) {
- if (draw_line && scr_buf->line->data && scr_buf->line->len) {
- line = scr_buf->line->data;
- bytes = scr_buf->line->len;
-
- aw = crunch_nstr(&line, clip, bytes, 0, "\t", vi_crunch);
- crunch_str(&line, TT.screen_width-1, stdout, "\t", vi_crunch);
- if ( *line ) printf("@");
-
- }
- } else if (draw_line) printf("~");
+ } else {
+ y++;
+ tty_jump(0, y);
+ if (scr_buf) scr_buf = scr_buf->down;
}
- if (scr_buf) scr_buf = scr_buf->down;
- }
-
- TT.drawn_row = TT.scr_row, TT.drawn_col = clip;
- //finished updating visual area
+ }
tty_jump(0, TT.screen_height);
- tty_esc("2K");
switch (TT.vi_mode) {
case 0:
tty_esc("30;44m");
@@ -1262,66 +778,103 @@ static void draw_page()
}
//DEBUG
- tty_esc("m");
- utf_l = utf8_len(&c_r->line->data[TT.cur_col]);
+ tty_esc("47m");
+ tty_esc("30m");
+ utf_l = utf8_len(&c_r->line->str_data[TT.cur_col]);
if (utf_l) {
char t[5] = {0, 0, 0, 0, 0};
- strncpy(t, &c_r->line->data[TT.cur_col], utf_l);
+ strncpy(t, &c_r->line->str_data[TT.cur_col], utf_l);
printf("utf: %d %s", utf_l, t);
}
printf("| %d, %d\n", cx_scr, cy_scr); //screen coord
tty_jump(TT.screen_width-12, TT.screen_height);
printf("| %d, %d\n", TT.cur_row, TT.cur_col);
-
- tty_esc("m");
- tty_jump(0, TT.screen_height+1);
- tty_esc("2K");
+ tty_esc("37m");
+ tty_esc("40m");
if (!TT.vi_mode) {
tty_esc("1m");
- printf("%s", il->data);
- tty_esc("m");
+ tty_jump(0, TT.screen_height+1);
+ printf("%s", il->str_data);
+ tty_esc("0m");
} else tty_jump(cx_scr, cy_scr);
- xflush(1);
+ xflush();
+
+}
+
+static void draw_char(char c, int x, int y, int highlight)
+{
+ tty_jump(x, y);
+ if (highlight) {
+ tty_esc("30m"); //foreground black
+ tty_esc("47m"); //background white
+ }
+ printf("%c", c);
+}
+//utf rune draw
+//printf and useless copy could be replaced by direct write() to stdout
+static int draw_rune(char *c, int x, int y, int highlight)
+{
+ int l = utf8_len(c);
+ char t[5] = {0, 0, 0, 0, 0};
+ if (!l) return 0;
+ tty_jump(x, y);
+ tty_esc("0m");
+ if (highlight) {
+ tty_esc("30m"); //foreground black
+ tty_esc("47m"); //background white
+ }
+ strncpy(t, c, 5);
+ printf("%s", t);
+ tty_esc("0m");
+ return l;
}
static void check_cursor_bounds()
{
- if (c_r->line->len == 0) {
- TT.cur_col = 0;
- return;
- } else if (c_r->line->len-1 < TT.cur_col) TT.cur_col = c_r->line->len-1;
-
- if (TT.cur_col && utf8_width(&c_r->line->data[TT.cur_col],
- c_r->line->len-TT.cur_col) <= 0)
- TT.cur_col--, check_cursor_bounds();
+ if (c_r->line->str_len-1 < TT.cur_col) {
+ if (c_r->line->str_len == 0)
+ TT.cur_col = 0;
+ else
+ TT.cur_col = c_r->line->str_len-1;
+ }
}
static void adjust_screen_buffer()
{
- //search cursor and screen
+ //search cursor and screen TODO move this perhaps
struct linelist *t = text;
- int c = -1, s = -1, i = 0;
- //searching cursor and screen line numbers
- for (;((c == -1) || (s == -1)) && t != 0; i++, t = t->down) {
- if (t == c_r) c = i;
- if (t == screen) s = i;
+ int c = -1;
+ int s = -1;
+ int i = 0;
+ for (;;) {
+ i++;
+ if (t == c_r)
+ c = i;
+ if (t == scr_r)
+ s = i;
+ t = t->down;
+ if ( ((c != -1) && (s != -1)) || t == 0)
+ break;
}
- //adjust screen buffer so cursor is on drawing area
- if (c <= s) screen = c_r, s = c; //scroll up
- else {
- //drawing does not have wrapping so no need to check width
- int distance = c-s+1;
-
- if (distance > (int)TT.screen_height) {
- int adj = distance-TT.screen_height;
- for (;adj; adj--) screen = screen->down, s++; //scroll down
-
+ if (c <= s) {
+ scr_r = c_r;
+ }
+ else if ( c > s ) {
+ //should count multiline long strings!
+ int distance = c - s + 1;
+ //TODO instead iterate scr_r up and check strlen%screen_width
+ //for each iteration
+ if (distance >= (int)TT.screen_height) {
+ int adj = distance - TT.screen_height;
+ while(adj--) {
+ scr_r = scr_r->down;
+ }
}
}
- TT.cur_row = c, TT.scr_row = s;
+ TT.cur_row = c;
}
@@ -1357,10 +910,7 @@ static int utf8_lnw(int* width, char* str, int bytes)
wchar_t wc;
int length = 1;
*width = 1;
- if (*str == 0x09) {
- *width = TT.tabstop;
- return 1;
- }
+// if (str < 0x7F) return length;
length = mbtowc(&wc, str, bytes);
switch (length) {
case -1:
@@ -1380,7 +930,6 @@ static int utf8_lnw(int* width, char* str, int bytes)
static int utf8_width(char *str, int bytes)
{
wchar_t wc;
- if (*str == 0x09) return TT.tabstop;
switch (mbtowc(&wc, str, bytes)) {
case -1:
mbtowc(0,0,4);
@@ -1414,69 +963,66 @@ static int utf8_dec(char key, char *utf8_scratch, int *sta_p)
return 0;
}
-static char* utf8_last(char* str, int size)
+static int draw_str_until(int *drawn, char *str, int width, int bytes)
{
- char* end = str+size;
- int pos = size;
- int len = 0;
- int width = 0;
- while (pos >= 0) {
- len = utf8_lnw(&width, end, size-pos);
- if (len && width) return end;
- end--; pos--;
+ int rune_width = 0;
+ int rune_bytes = 0;
+ int max_bytes = bytes;
+ int max_width = width;
+ char* end = str;
+ for (;width && bytes;) {
+ rune_bytes = utf8_lnw(&rune_width, end, 4);
+ if (!rune_bytes) break;
+ if (width - rune_width < 0) goto write_bytes;
+ width -= rune_width;
+ bytes -= rune_bytes;
+ end += rune_bytes;
}
- return 0;
+ for (;bytes;) {
+ rune_bytes = utf8_lnw(&rune_width, end, 4);
+ if (!rune_bytes) break;
+ if (rune_width) break;
+ bytes -= rune_bytes;
+ end += rune_bytes;
+ }
+write_bytes:
+ fwrite(str, max_bytes-bytes, 1, stdout);
+ *drawn = max_bytes-bytes;
+ return max_width-width;
}
-static int cur_left(int count0, int count1, char* unused)
+static void cur_left()
{
- int count = count0*count1;
- TT.vi_mov_flag |= 0x80000000;
- for (;count--;) {
- if (!TT.cur_col) return 1;
+ if (!TT.cur_col) return;
+ TT.cur_col--;
- TT.cur_col--;
- check_cursor_bounds();
- }
- return 1;
+ if (!utf8_len(&c_r->line->str_data[TT.cur_col])) cur_left();
}
-static int cur_right(int count0, int count1, char* unused)
+static void cur_right()
{
- int count = count0*count1;
- for (;count--;) {
- if (c_r->line->len <= 1) return 1;
- if (TT.cur_col >= c_r->line->len-1) {
- TT.cur_col = utf8_last(c_r->line->data, c_r->line->len)
- - c_r->line->data;
- return 1;
- }
- TT.cur_col++;
- if (utf8_width(&c_r->line->data[TT.cur_col],
- c_r->line->len-TT.cur_col) <= 0)
- cur_right(1, 1, 0);
- }
- return 1;
+ if (c_r->line->str_len <= 1) return;
+ if (TT.cur_col == c_r->line->str_len-1) return;
+ TT.cur_col++;
+ if (!utf8_len(&c_r->line->str_data[TT.cur_col])) cur_right();
}
-static int cur_up(int count0, int count1, char* unused)
+static void cur_up()
{
- int count = count0*count1;
- for (;count-- && c_r->up;)
+ if (c_r->up != 0)
c_r = c_r->up;
- TT.vi_mov_flag |= 0x80000000;
+ if (!utf8_len(&c_r->line->str_data[TT.cur_col])) cur_left();
check_cursor_bounds();
- return 1;
+ adjust_screen_buffer();
}
-static int cur_down(int count0, int count1, char* unused)
+static void cur_down()
{
- int count = count0*count1;
- for (;count-- && c_r->down;)
+ if (c_r->down != 0)
c_r = c_r->down;
+ if (!utf8_len(&c_r->line->str_data[TT.cur_col])) cur_left();
check_cursor_bounds();
- return 1;
+ adjust_screen_buffer();
}
-
diff --git a/toys/pending/wget.c b/toys/pending/wget.c
index 405ed942..ced51d9c 100644
--- a/toys/pending/wget.c
+++ b/toys/pending/wget.c
@@ -3,19 +3,19 @@
* Copyright 2016 Lipi C.H. Lee <lipisoft@gmail.com>
*
-USE_WGET(NEWTOY(wget, "(no-check-certificate)O:", TOYFLAG_USR|TOYFLAG_BIN))
+USE_WGET(NEWTOY(wget, "f:", TOYFLAG_USR|TOYFLAG_BIN))
config WGET
bool "wget"
default n
help
- usage: wget -O filename URL
- -O filename: specify output filename
- URL: uniform resource location, FTP/HTTP only, not HTTPS
+ usage: wget -f filename URL
+ -f filename: specify the filename to be saved
+ URL: HTTP uniform resource location and only HTTP, not HTTPS
examples:
- wget -O index.html http://www.example.com
- wget -O sample.jpg ftp://ftp.example.com:21/sample.jpg
+ wget -f index.html http://www.example.com
+ wget -f sample.jpg http://www.example.com:8080/sample.jpg
*/
#define FOR_wget
@@ -55,10 +55,8 @@ static unsigned get_port(const char *url, char *port, unsigned url_i) {
// get http infos in URL
static void get_info(const char *url, char* hostname, char *port, char *path) {
unsigned i = 7, len;
- char ftp = !strncmp(url, "ftp://", 6);
- if (ftp) i--;
- else if (strncmp(url, "http://", i)) error_exit("only FTP/HTTP support");
+ if (strncmp(url, "http://", i)) error_exit("only HTTP support");
len = get_hn(url+i, hostname);
i += len;
@@ -74,8 +72,6 @@ static void get_info(const char *url, char* hostname, char *port, char *path) {
if (strlen(url+i) < 1024) strcpy(path, url+i);
else error_exit("too long path in URL");
} else error_exit("wrong URL");
-
- if (ftp) xexec((char *[]){"ftpget", hostname, TT.filename, path, 0});
}
// connect to any IPv4 or IPv6 server
@@ -100,7 +96,7 @@ static int conn_svr(const char *hostname, const char *port) {
continue;
}
if (connect(sock, rp->ai_addr, rp->ai_addrlen) != -1)
- break; // succeed in connecting to any server IP
+ break; // succeed in connecting to any server IP
else perror_msg("connect error");
close(sock);
}
@@ -131,62 +127,46 @@ static char *get_body(ssize_t len, ssize_t *body_len) {
void wget_main(void)
{
- int sock, redirects = 10;
+ int sock;
FILE *fp;
ssize_t len, body_len;
- char *body, *result, *rc, *r_str, *redir_loc = 0;
- char ua[18] = "toybox wget", ver[6], hostname[1024], port[6], path[1024];
+ char *body, *result, *rc, *r_str;
+ char ua[18] = "toybox wget/", ver[6], hostname[1024], port[6], path[1024];
// TODO extract filename to be saved from URL
- if (!(toys.optflags & FLAG_O)) help_exit("no filename");
+ if (!(toys.optflags & FLAG_f)) help_exit("no filename");
if (fopen(TT.filename, "r")) error_exit("'%s' already exists", TT.filename);
if(!toys.optargs[0]) help_exit("no URL");
get_info(toys.optargs[0], hostname, port, path);
+ sock = conn_svr(hostname, port);
-#ifdef TOYBOX_VERSION
- strcat(ua, "/"), strncpy(ver, TOYBOX_VERSION, 5), strcat(ua, ver);
-#endif
- for (;; redirects--) {
- sock = conn_svr(hostname, port);
- // compose HTTP request
- sprintf(toybuf, "GET %s HTTP/1.1\r\n", path);
- mk_fld("Host", hostname);
- mk_fld("User-Agent", ua);
- mk_fld("Connection", "close");
- strcat(toybuf, "\r\n");
-
- // send the HTTP request
- len = strlen(toybuf);
- if (write(sock, toybuf, len) != len) perror_exit("write error");
-
- // read HTTP response
- if ((len = read(sock, toybuf, 4096)) == -1) perror_exit("read error");
- if (!strstr(toybuf, "\r\n\r\n")) error_exit("too long HTTP response");
- body = get_body(len, &body_len);
- redir_loc = strstr(toybuf, "Location: ");
- result = strtok(toybuf, "\r");
- strtok(result, " ");
- rc = strtok(NULL, " ");
- r_str = strtok(NULL, " ");
-
- // HTTP res code check
- if (!strcmp(rc, "301") || !strcmp(rc, "302")) {
- char* eol = 0;
- if ((eol = strchr(redir_loc, '\r')) > 0) *eol = 0;
- else if (redir_loc) error_exit("Could not parse redirect URL");
- if (redirects < 0) error_exit("Too many redirects");
-
- printf("Redirection: %s %s \n", rc, r_str);
- printf("%s \n", redir_loc);
- redir_loc = redir_loc+strlen("Location: ");
- close(sock);
- get_info(redir_loc, hostname, port, path);
- } else if (!strcmp(rc, "200")) break;
- else error_exit("res: %s(%s)", rc, r_str);
- }
+ // compose HTTP request
+ sprintf(toybuf, "GET %s HTTP/1.1\r\n", path);
+ mk_fld("Host", hostname);
+ strncpy(ver, TOYBOX_VERSION, 5);
+ strcat(ua, ver);
+ mk_fld("User-Agent", ua);
+ mk_fld("Connection", "close");
+ strcat(toybuf, "\r\n");
+ // send the HTTP request
+ len = strlen(toybuf);
+ if (write(sock, toybuf, len) != len) perror_exit("write error");
+
+ // read HTTP response
+ if ((len = read(sock, toybuf, 4096)) == -1) perror_exit("read error");
+ if (!strstr(toybuf, "\r\n\r\n")) error_exit("too long HTTP response");
+ body = get_body(len, &body_len);
+ result = strtok(toybuf, "\r");
+ strtok(result, " ");
+ rc = strtok(NULL, " ");
+ r_str = strtok(NULL, " ");
+
+ // HTTP res code check
+ // TODO handle HTTP 302 Found(Redirection)
+ if (strcmp(rc, "200")) error_exit("res: %s(%s)", rc, r_str);
if (!(fp = fopen(TT.filename, "w"))) perror_exit("fopen error");
if (fwrite(body, 1, body_len, fp) != body_len)
diff --git a/toys/posix/basename.c b/toys/posix/basename.c
index 35fe6f46..7e16afe6 100644
--- a/toys/posix/basename.c
+++ b/toys/posix/basename.c
@@ -5,7 +5,7 @@
* See http://opengroup.org/onlinepubs/9699919799/utilities/basename.html
-USE_BASENAME(NEWTOY(basename, "^<1as:", TOYFLAG_USR|TOYFLAG_BIN))
+USE_BASENAME(NEWTOY(basename, "<1as:", TOYFLAG_USR|TOYFLAG_BIN))
config BASENAME
bool "basename"
diff --git a/toys/posix/cmp.c b/toys/posix/cmp.c
index d1c73f1d..c573f02e 100644
--- a/toys/posix/cmp.c
+++ b/toys/posix/cmp.c
@@ -4,15 +4,15 @@
*
* See http://opengroup.org/onlinepubs/9699919799/utilities/cmp.html
-USE_CMP(NEWTOY(cmp, "<1>2ls(silent)(quiet)[!ls]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
+USE_CMP(NEWTOY(cmp, "<2>2ls(silent)(quiet)[!ls]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
config CMP
bool "cmp"
default y
help
- usage: cmp [-l] [-s] FILE1 [FILE2 [SKIP1 [SKIP2]]]
+ usage: cmp [-l] [-s] FILE1 FILE2
- Compare the contents of two files. (Or stdin and file if only one given.)
+ Compare the contents of two files.
-l Show all differing bytes
-s Silent
@@ -80,5 +80,4 @@ void cmp_main(void)
toys.exitval = 2;
loopfiles_rw(toys.optargs, O_CLOEXEC|(WARN_ONLY*!(toys.optflags&FLAG_s)), 0,
do_cmp);
- if (toys.optc == 1) do_cmp(0, "-");
}
diff --git a/toys/posix/cp.c b/toys/posix/cp.c
index d84b55ef..751a718c 100644
--- a/toys/posix/cp.c
+++ b/toys/posix/cp.c
@@ -208,7 +208,8 @@ static int cp_node(struct dirtree *try)
if (!mkdirat(cfd, catch, try->st.st_mode | 0200) || errno == EEXIST)
if (-1 != (try->extra = openat(cfd, catch, O_NOFOLLOW)))
if (!fstat(try->extra, &st2) && S_ISDIR(st2.st_mode))
- return DIRTREE_COMEAGAIN | (DIRTREE_SYMFOLLOW*!!FLAG(L));
+ return DIRTREE_COMEAGAIN
+ | (DIRTREE_SYMFOLLOW*!!(toys.optflags&FLAG_L));
// Hardlink
@@ -251,8 +252,7 @@ static int cp_node(struct dirtree *try)
// make symlink, or make block/char/fifo/socket
if (S_ISLNK(try->st.st_mode)
? ((i = readlinkat0(tfd, try->name, toybuf, sizeof(toybuf))) &&
- ((!unlinkat(cfd, catch, 0) || ENOENT == errno) &&
- !symlinkat(toybuf, cfd, catch)))
+ !symlinkat(toybuf, cfd, catch))
: !mknodat(cfd, catch, try->st.st_mode, try->st.st_rdev))
{
err = 0;
@@ -278,20 +278,20 @@ static int cp_node(struct dirtree *try)
// We only copy xattrs for files because there's no flistxattrat()
if (TT.pflags&(_CP_xattr|_CP_context)) {
- ssize_t listlen = xattr_flist(fdin, 0, 0), len;
+ ssize_t listlen = flistxattr(fdin, 0, 0), len;
char *name, *value, *list;
if (listlen>0) {
list = xmalloc(listlen);
- xattr_flist(fdin, list, listlen);
+ flistxattr(fdin, list, listlen);
list[listlen-1] = 0; // I do not trust this API.
for (name = list; name-list < listlen; name += strlen(name)+1) {
if (!(TT.pflags&_CP_xattr) && strncmp(name, "security.", 9))
continue;
- if ((len = xattr_fget(fdin, name, 0, 0))>0) {
+ if ((len = fgetxattr(fdin, name, 0, 0))>0) {
value = xmalloc(len);
- if (len == xattr_fget(fdin, name, value, len))
- if (xattr_fset(fdout, name, value, len, 0))
+ if (len == fgetxattr(fdin, name, value, len))
+ if (fsetxattr(fdout, name, value, len, 0))
perror_msg("%s setxattr(%s=%s)", catch, name, value);
free(value);
}
@@ -368,18 +368,19 @@ void cp_main(void)
char *destname = toys.optargs[--toys.optc];
int i, destdir = !stat(destname, &TT.top) && S_ISDIR(TT.top.st_mode);
- if ((toys.optc>1 || FLAG(D)) && !destdir)
+ if ((toys.optc>1 || (toys.optflags&FLAG_D)) && !destdir)
error_exit("'%s' not directory", destname);
- if (FLAG(a)||FLAG(p)) TT.pflags = _CP_mode|_CP_ownership|_CP_timestamps;
+ if (toys.optflags & (FLAG_a|FLAG_p))
+ TT.pflags = _CP_mode|_CP_ownership|_CP_timestamps;
// Not using comma_args() (yet?) because interpeting as letters.
- if (CFG_CP_PRESERVE && FLAG(preserve)) {
+ if (CFG_CP_PRESERVE && (toys.optflags & FLAG_preserve)) {
char *pre = xstrdup(TT.c.preserve ? TT.c.preserve : "mot"), *s;
- if (comma_remove(pre, "all")) TT.pflags = ~0;
+ if (comma_scan(pre, "all", 1)) TT.pflags = ~0;
for (i=0; i<ARRAY_LEN(cp_preserve); i++)
- while (comma_remove(pre, cp_preserve[i].name)) TT.pflags |= 1<<i;
+ if (comma_scan(pre, cp_preserve[i].name, 1)) TT.pflags |= 1<<i;
if (*pre) {
// Try to interpret as letters, commas won't set anything this doesn't.
@@ -401,19 +402,15 @@ void cp_main(void)
// Loop through sources
for (i=0; i<toys.optc; i++) {
- char *src = toys.optargs[i], *trail = src;
+ char *src = toys.optargs[i];
int rc = 1;
- if (CFG_MV && toys.which->name[0] == 'm') {
- while (*++trail);
- if (*--trail == '/') *trail = 0;
- }
-
if (destdir) {
- char *s = FLAG(D) ? dirname(src) : getbasename(src);
+ char *s = (toys.optflags&FLAG_D) ? getdirname(src) : getbasename(src);
TT.destname = xmprintf("%s/%s", destname, s);
if (FLAG(D)) {
+ free(s);
if (!(s = fileunderdir(TT.destname, destname))) {
error_msg("%s not under %s", TT.destname, destname);
continue;
@@ -426,7 +423,7 @@ void cp_main(void)
errno = EXDEV;
if (CFG_MV && toys.which->name[0] == 'm') {
- int force = FLAG(f), no_clobber = FLAG(n);
+ int force = toys.optflags & FLAG_f, no_clobber = toys.optflags & FLAG_n;
if (!force || no_clobber) {
struct stat st;
@@ -435,7 +432,7 @@ void cp_main(void)
// Prompt if -i or file isn't writable. Technically "is writable" is
// more complicated (022 is not writeable by the owner, just everybody
// _else_) but I don't care.
- if (exists && (FLAG(i) || !(st.st_mode & 0222))) {
+ if (exists && ((toys.optflags & FLAG_i) || !(st.st_mode & 0222))) {
fprintf(stderr, "%s: overwrite '%s'", toys.which->name, TT.destname);
if (!yesno(1)) rc = 0;
else unlink(TT.destname);
@@ -444,13 +441,12 @@ void cp_main(void)
if (exists && no_clobber) rc = 0;
}
if (rc) rc = rename(src, TT.destname);
- if (errno && !*trail) *trail = '/';
}
// Copy if we didn't mv, skipping nonexistent sources
if (rc) {
if (errno!=EXDEV || dirtree_flagread(src, DIRTREE_SHUTUP+
- DIRTREE_SYMFOLLOW*!!(FLAG(H)||FLAG(L)), TT.callback))
+ DIRTREE_SYMFOLLOW*!!(toys.optflags&(FLAG_H|FLAG_L)), TT.callback))
perror_msg("bad '%s'", src);
}
if (destdir) free(TT.destname);
@@ -485,8 +481,8 @@ static int install_node(struct dirtree *try)
cp_node(try);
// No -r so always one level deep, so destname as set by cp_node() is correct
- if (FLAG(s) && xrun((char *[]){"strip", "-p", TT.destname, 0}))
- toys.exitval = 1;
+ if (toys.optflags & FLAG_s)
+ if (xrun((char *[]){"strip", "-p", TT.destname, 0})) toys.exitval = 1;
return 0;
}
@@ -494,23 +490,23 @@ static int install_node(struct dirtree *try)
void install_main(void)
{
char **ss;
+ int flags = toys.optflags;
TT.uid = TT.i.o ? xgetuid(TT.i.o) : -1;
TT.gid = TT.i.g ? xgetgid(TT.i.g) : -1;
- if (FLAG(d)) {
+ if (flags & FLAG_d) {
for (ss = toys.optargs; *ss; ss++) {
- if (FLAG(v)) printf("%s\n", *ss);
- if (mkpathat(AT_FDCWD, *ss, 0777, MKPATHAT_MKLAST | MKPATHAT_MAKE))
- perror_msg_raw(*ss);
- if (FLAG(g)||FLAG(o))
+ if (mkpathat(AT_FDCWD, *ss, 0777, MKPATHAT_MKLAST | MKPATHAT_MAKE)) perror_msg_raw(*ss);
+ if (flags & (FLAG_g|FLAG_o))
if (lchown(*ss, TT.uid, TT.gid)) perror_msg("chown '%s'", *ss);
+ if (flags & FLAG_v) printf("%s\n", *ss);
}
return;
}
- if (FLAG(D)) {
+ if (toys.optflags & FLAG_D) {
TT.destname = toys.optargs[toys.optc-1];
if (mkpathat(AT_FDCWD, TT.destname, 0, MKPATHAT_MAKE))
perror_exit("-D '%s'", TT.destname);
@@ -519,8 +515,9 @@ void install_main(void)
if (toys.optc < 2) error_exit("needs 2 args");
// Translate flags from install to cp
- toys.optflags = cp_flag_F() + cp_flag_v()*!!FLAG(v)
- + cp_flag_p()*!!(FLAG(p)|FLAG(o)|FLAG(g));
+ toys.optflags = cp_flag_F();
+ if (flags & FLAG_v) toys.optflags |= cp_flag_v();
+ if (flags & (FLAG_p|FLAG_o|FLAG_g)) toys.optflags |= cp_flag_p();
TT.callback = install_node;
cp_main();
diff --git a/toys/posix/echo.c b/toys/posix/echo.c
index 70f4ce5e..639f87ab 100644
--- a/toys/posix/echo.c
+++ b/toys/posix/echo.c
@@ -9,19 +9,18 @@
* We also honor -- to _stop_ option parsing (bash doesn't, we go with
* consistency over compatibility here).
-USE_ECHO(NEWTOY(echo, "^?Een[-eE]", TOYFLAG_BIN|TOYFLAG_MAYFORK))
+USE_ECHO(NEWTOY(echo, "^?en", TOYFLAG_BIN))
config ECHO
bool "echo"
default y
help
- usage: echo [-neE] [args...]
+ usage: echo [-ne] [args...]
Write each argument to stdout, with one space between each, followed
by a newline.
-n No trailing newline
- -E Print escape sequences literally (default)
-e Process the following escape sequences:
\\ Backslash
\0NNN Octal values (1 to 3 digits)
@@ -51,7 +50,7 @@ void echo_main(void)
// Should we output arg verbatim?
- if (!FLAG(e)) {
+ if (!(toys.optflags & FLAG_e)) {
xprintf("%s", arg);
continue;
}
@@ -66,7 +65,7 @@ void echo_main(void)
int slash = *(c++), n = unescape(slash);
if (n) out = n;
- else if (slash=='c') return;
+ else if (slash=='c') goto done;
else if (slash=='0') {
out = 0;
while (*c>='0' && *c<='7' && n++<3) out = (out*8)+*(c++)-'0';
@@ -79,13 +78,7 @@ void echo_main(void)
if (temp>='a' && temp<='f') {
out = (out*16)+temp-'a'+10;
c++;
- } else {
- if (n==1) {
- --c;
- out = '\\';
- }
- break;
- }
+ } else break;
}
}
// Slash in front of unknown character, print literal.
@@ -96,5 +89,7 @@ void echo_main(void)
}
// Output "\n" if no -n
- if (!FLAG(n)) putchar('\n');
+ if (!(toys.optflags&FLAG_n)) putchar('\n');
+done:
+ xflush();
}
diff --git a/toys/posix/env.c b/toys/posix/env.c
index 19cd18a0..5c7bb789 100644
--- a/toys/posix/env.c
+++ b/toys/posix/env.c
@@ -28,10 +28,11 @@ GLOBALS(
struct arg_list *u;
);
+extern char **environ;
+
void env_main(void)
{
char **ev = toys.optargs;
- struct arg_list *u;
// If first nonoption argument is "-" treat it as -i
if (*ev && **ev == '-' && !(*ev)[1]) {
@@ -39,16 +40,21 @@ void env_main(void)
ev++;
}
- if (FLAG(i)) xclearenv();
- else for (u = TT.u; u; u = u->next) xunsetenv(u->arg);
+ if (toys.optflags & FLAG_i) clearenv();
+ while (TT.u) {
+ unsetenv(TT.u->arg);
+ TT.u = TT.u->next;
+ }
- for (; *ev; ev++)
- if (strchr(*ev, '=')) xsetenv(xstrdup(*ev), 0);
- else {
- // a common use of env is to bypass shell builtins
- toys.stacktop = 0;
- xexec(ev);
- }
+ for (; *ev; ev++) {
+ char *name = *ev, *val = strchr(name, '=');
+
+ if (val) {
+ *(val++) = 0;
+ setenv(name, val, 1);
+ } else xexec(ev);
+ }
- for (ev = environ; *ev; ev++) xprintf("%s%c", *ev, '\n'*!FLAG(0));
+ if (environ) for (ev = environ; *ev; ev++)
+ xprintf("%s%c", *ev, '\n'*!(toys.optflags&FLAG_0));
}
diff --git a/toys/posix/file.c b/toys/posix/file.c
index 063397ce..2893e2f7 100644
--- a/toys/posix/file.c
+++ b/toys/posix/file.c
@@ -4,20 +4,18 @@
*
* See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/file.html
-USE_FILE(NEWTOY(file, "<1bhLs[!hL]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_FILE(NEWTOY(file, "<1hL[!hL]", TOYFLAG_USR|TOYFLAG_BIN))
config FILE
bool "file"
default y
help
- usage: file [-bhLs] [file...]
+ usage: file [-hL] [file...]
Examine the given files and describe their content types.
- -b Brief (no filename)
-h Don't follow symlinks (default)
-L Follow symlinks
- -s Show block/char device contents
*/
#define FOR_file
@@ -176,20 +174,17 @@ static void do_elf_file(int fd)
n_type = elf_int(note+8, 4);
notesz = 3*4 + ((n_namesz+3)&~3) + ((n_descsz+3)&~3);
- // Does the claimed size of this note actually fit in the section?
- if (notesz > sh_size) goto bad;
-
if (n_namesz==4 && !memcmp(note+12, "GNU", 4)) {
if (n_type==3 /*NT_GNU_BUILD_ID*/) {
+ if (n_descsz+16>sh_size) goto bad;
printf(", BuildID=");
for (j = 0; j < n_descsz; ++j) printf("%02x", note[16 + j]);
}
} else if (n_namesz==8 && !memcmp(note+12, "Android", 8)) {
- if (n_type==1 /*.android.note.ident*/ && n_descsz >= 4) {
+ if (n_type==1 /*.android.note.ident*/) {
+ if (n_descsz+24+64>sh_size) goto bad;
printf(", for Android %d", (int)elf_int(note+20, 4));
- // NDK r14 and later also include NDK version info. OS binaries
- // and binaries built by older NDKs don't have this.
- if (n_descsz >= 4+64+64)
+ if (n_descsz > 24)
printf(", built by NDK %.64s (%.64s)", note+24, note+24+64);
}
}
@@ -218,7 +213,7 @@ static void do_regular_file(int fd, char *name)
if (!len) xputs("empty");
// 45 bytes: https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
else if (len>=45 && strstart(&s, "\177ELF")) do_elf_file(fd);
- else if (len>=8 && strstart(&s, "!<arch>\n")) xputs("ar archive");
+ else if (len>=8 && strstart(&s, "!<arch>\n")) xprintf("ar archive\n");
else if (len>28 && strstart(&s, "\x89PNG\x0d\x0a\x1a\x0a")) {
// PNG is big-endian: https://www.w3.org/TR/PNG/#7Integers-and-byte-order
int chunk_length = peek_be(s, 4);
@@ -270,11 +265,10 @@ static void do_regular_file(int fd, char *name)
xprintf("ASCII cpio archive (%s)\n", cpioformat);
} else if (len>33 && (magic=peek(&s,2), magic==0143561 || magic==070707)) {
if (magic == 0143561) printf("byte-swapped ");
- xputs("cpio archive");
- // tar archive (old, ustar/pax, or gnu)
- } else if (len>500 && is_tar_header(s))
- xprintf("%s tar archive%s\n", s[257] ? "POSIX" : "old",
- strncmp(s+262," ",2)?"":" (GNU)");
+ xprintf("cpio archive\n");
+ // tar archive (ustar/pax or gnu)
+ } else if (len>500 && !strncmp(s+257, "ustar", 5))
+ xprintf("POSIX tar archive%s\n", strncmp(s+262," ",2)?"":" (GNU)");
// zip/jar/apk archive, ODF/OOXML document, or such
else if (len>5 && strstart(&s, "PK\03\04")) {
int ver = toybuf[4];
@@ -284,8 +278,6 @@ static void do_regular_file(int fd, char *name)
xputc('\n');
} else if (len>4 && strstart(&s, "BZh") && isdigit(*s))
xprintf("bzip2 compressed data, block size = %c00k\n", *s);
- else if (len > 31 && peek_be(s, 7) == 0xfd377a585a0000)
- xputs("xz compressed data");
else if (len>10 && strstart(&s, "\x1f\x8b")) xputs("gzip compressed data");
else if (len>32 && !memcmp(s+1, "\xfa\xed\xfe", 3)) {
int bit = s[0]=='\xce'?32:64;
@@ -357,10 +349,6 @@ static void do_regular_file(int fd, char *name)
} else if (len>12 && !memcmp(s, "ttcf\x00", 5)) {
xprintf("TrueType font collection, version %d, %d fonts\n",
(int)peek_be(s+4, 2), (int)peek_be(s+8, 4));
-
- // https://docs.microsoft.com/en-us/typography/opentype/spec/otff
- } else if (len>12 && !memcmp(s, "OTTO", 4)) {
- xputs("OpenType font");
} else if (len>4 && !memcmp(s, "BC\xc0\xde", 4)) {
xputs("LLVM IR bitcode");
} else if (strstart(&s, "-----BEGIN CERTIFICATE-----")) {
@@ -386,26 +374,6 @@ static void do_regular_file(int fd, char *name)
int w = peek_le(s+0x12,4), h = peek_le(s+0x16,4), bpp = peek_le(s+0x1c,2);
xprintf("BMP image, %d x %d, %d bpp\n", w, h, bpp);
-
- // https://github.com/torvalds/linux/blob/master/tools/perf/Documentation/perf.data-file-format.txt
- } else if (len>=104 && !memcmp(s, "PERFILE2", 8)) {
- xputs("Linux perf data");
-
- // https://android.googlesource.com/platform/system/core/+/master/libsparse/sparse_format.h
- } else if (len>28 && peek_le(s, 4) == 0xed26ff3a) {
- xprintf("Android sparse image v%d.%d, %d %d-byte blocks (%d chunks)\n",
- (int) peek_le(s+4, 2), (int) peek_le(s+6, 2), (int) peek_le(s+16, 4),
- (int) peek_le(s+12, 4), (int) peek_le(s+20, 4));
-
- // https://android.googlesource.com/platform/system/tools/mkbootimg/+/refs/heads/master/include/bootimg/bootimg.h
- } else if (len>1632 && !memcmp(s, "ANDROID!", 8)) {
- xprintf("Android boot image v%d\n", (int) peek_le(s+40, 4));
-
- // https://source.android.com/devices/architecture/dto/partitions
- } else if (len>32 && peek_be(s, 4) == 0xd7b7ab1e) {
- xprintf("Android DTB/DTBO v%d, %d entries\n", (int) peek_be(s+28, 4),
- (int) peek_be(s+16, 4));
-
} else {
char *what = 0;
int i, bytes;
@@ -447,20 +415,15 @@ void file_main(void)
// Can't use loopfiles here because it doesn't call function when can't open
for (arg = toys.optargs; *arg; arg++) {
- char *name = *arg, *what = "unknown";
+ char *name = *arg, *what = "cannot open";
struct stat sb;
int fd = !strcmp(name, "-");
- if (!FLAG(b))
- xprintf("%s: %*s", name, (int)(TT.max_name_len - strlen(name)), "");
+ xprintf("%s: %*s", name, (int)(TT.max_name_len - strlen(name)), "");
sb.st_size = 0;
- if (fd || !(FLAG(L) ? stat : lstat)(name, &sb)) {
- if (!fd && !FLAG(s) && (S_ISBLK(sb.st_mode) || S_ISCHR(sb.st_mode))) {
- sprintf(what = toybuf, "%s special (%u/%u)",
- S_ISBLK(sb.st_mode) ? "block" : "character",
- dev_major(sb.st_rdev), dev_minor(sb.st_rdev));
- } else if (fd || S_ISREG(sb.st_mode)) {
+ if (fd || !((toys.optflags & FLAG_L) ? stat : lstat)(name, &sb)) {
+ if (fd || S_ISREG(sb.st_mode)) {
TT.len = sb.st_size;
// This test identifies an empty file we don't have permission to read
if (!fd && !sb.st_size) what = "empty";
@@ -470,16 +433,14 @@ void file_main(void)
continue;
}
} else if (S_ISFIFO(sb.st_mode)) what = "fifo";
+ else if (S_ISBLK(sb.st_mode)) what = "block special";
+ else if (S_ISCHR(sb.st_mode)) what = "character special";
else if (S_ISDIR(sb.st_mode)) what = "directory";
else if (S_ISSOCK(sb.st_mode)) what = "socket";
- else if (S_ISLNK(sb.st_mode)) {
- char *lnk = xreadlink(name);
+ else if (S_ISLNK(sb.st_mode)) what = "symbolic link";
+ else what = "unknown";
+ }
- sprintf(what = toybuf, "%ssymbolic link to %s",
- stat(name, &sb) ? "broken " : "", lnk);
- free(lnk);
- }
- xputs(what);
- } else xprintf("cannot open: %s\n", strerror(errno));
+ xputs(what);
}
}
diff --git a/toys/posix/find.c b/toys/posix/find.c
index 8a837385..5cefbf15 100644
--- a/toys/posix/find.c
+++ b/toys/posix/find.c
@@ -17,26 +17,24 @@ config FIND
usage: find [-HL] [DIR...] [<options>]
Search directories for matching files.
- Default: search ".", match all, -print matches.
+ Default: search "." match all -print all matches.
-H Follow command line symlinks -L Follow all symlinks
Match filters:
- -name PATTERN filename with wildcards (-iname case insensitive)
- -path PATTERN path name with wildcards (-ipath case insensitive)
- -user UNAME belongs to user UNAME -nouser user ID not known
- -group GROUP belongs to group GROUP -nogroup group ID not known
- -perm [-/]MODE permissions (-=min /=any) -prune ignore dir contents
- -size N[c] 512 byte blocks (c=bytes) -xdev only this filesystem
- -links N hardlink count -atime N[u] accessed N units ago
- -ctime N[u] created N units ago -mtime N[u] modified N units ago
- -newer FILE newer mtime than FILE -mindepth N at least N dirs down
- -depth ignore contents of dir -maxdepth N at most N dirs down
- -inum N inode number N -empty empty files and dirs
- -type [bcdflps] type is (block, char, dir, file, symlink, pipe, socket)
- -true always true -false always false
- -context PATTERN security context
- -newerXY FILE X=acm time > FILE's Y=acm time (Y=t: FILE is literal time)
+ -name PATTERN filename with wildcards -iname case insensitive -name
+ -path PATTERN path name with wildcards -ipath case insensitive -path
+ -user UNAME belongs to user UNAME -nouser user ID not known
+ -group GROUP belongs to group GROUP -nogroup group ID not known
+ -perm [-/]MODE permissions (-=min /=any) -prune ignore contents of dir
+ -size N[c] 512 byte blocks (c=bytes) -xdev only this filesystem
+ -links N hardlink count -atime N[u] accessed N units ago
+ -ctime N[u] created N units ago -mtime N[u] modified N units ago
+ -newer FILE newer mtime than FILE -mindepth # at least # dirs down
+ -depth ignore contents of dir -maxdepth # at most # dirs down
+ -inum N inode number N -empty empty files and dirs
+ -type [bcdflps] (block, char, dir, file, symlink, pipe, socket)
+ -context PATTERN security context
Numbers N may be prefixed by a - (less than) or + (greater than). Units for
-Xtime are d (days, default), h (hours), m (minutes), or s (seconds).
@@ -45,21 +43,13 @@ config FIND
!, -a, -o, ( ) not, and, or, group expressions
Actions:
- -print Print match with newline -print0 Print match with null
- -exec Run command with path -execdir Run command in file's dir
- -ok Ask before exec -okdir Ask before execdir
- -delete Remove matching file/dir -printf FORMAT Print using format string
+ -print Print match with newline -print0 Print match with null
+ -exec Run command with path -execdir Run command in file's dir
+ -ok Ask before exec -okdir Ask before execdir
+ -delete Remove matching file/dir
Commands substitute "{}" with matched file. End with ";" to run each file,
or "+" (next argument after "{}") to collect and run with multiple files.
-
- -printf FORMAT characters are \ escapes and:
- %b 512 byte blocks used
- %f basename %g textual gid %G numeric gid
- %i decimal inode %l target of symlink %m octal mode
- %M ls format type/mode %p path to file %P path to file minus DIR
- %s size in bytes %T@ mod time as unixtime
- %u username %U numeric uid %Z security context
*/
#define FOR_find
@@ -71,7 +61,6 @@ GLOBALS(
int topdir, xdev, depth;
time_t now;
long max_bytes;
- char *start;
)
struct execdir_data {
@@ -212,23 +201,14 @@ static int do_find(struct dirtree *new)
struct double_list *argdata = TT.argdata;
char *s, **ss;
- recurse = DIRTREE_STATLESS|DIRTREE_COMEAGAIN|
- (DIRTREE_SYMFOLLOW*!!(toys.optflags&FLAG_L));
+ recurse = DIRTREE_COMEAGAIN|(DIRTREE_SYMFOLLOW*!!(toys.optflags&FLAG_L));
// skip . and .. below topdir, handle -xdev and -depth
if (new) {
- // Handle stat failures first.
- if (new->again&2) {
- if (!new->parent || errno != ENOENT) {
- perror_msg("'%s'", s = dirtree_path(new, 0));
- free(s);
- }
- return 0;
- }
if (new->parent) {
if (!dirtree_notdotdot(new)) return 0;
if (TT.xdev && new->st.st_dev != new->parent->st.st_dev) recurse = 0;
- } else TT.start = new->name;
+ }
if (S_ISDIR(new->st.st_mode)) {
// Descending into new directory
@@ -315,11 +295,6 @@ static int do_find(struct dirtree *new)
} else if (!strcmp(s, "not")) {
if (check) not = !not;
continue;
- } else if (!strcmp(s, "true")) {
- if (check) test = 1;
- } else if (!strcmp(s, "false")) {
- if (check) test = 0;
-
// Mostly ignore NOP argument
} else if (!strcmp(s, "a") || !strcmp(s, "and") || !strcmp(s, "noleaf")) {
if (not) goto error;
@@ -369,8 +344,7 @@ static int do_find(struct dirtree *new)
}
if (check) {
- test = !fnmatch(arg, is_path ? name : basename(name),
- FNM_PATHNAME*(!is_path));
+ test = !fnmatch(arg, name, FNM_PATHNAME*(!is_path));
if (i) free(name);
}
free(path);
@@ -442,10 +416,8 @@ static int do_find(struct dirtree *new)
}
}
} else if (!strcmp(s, "user") || !strcmp(s, "group")
- || strstart(&s, "newer"))
+ || !strcmp(s, "newer"))
{
- int macoff[] = {offsetof(struct stat, st_mtim),
- offsetof(struct stat, st_atim), offsetof(struct stat, st_ctim)};
struct {
void *next, *prev;
union {
@@ -460,23 +432,14 @@ static int do_find(struct dirtree *new)
udl = xmalloc(sizeof(*udl));
dlist_add_nomalloc(&TT.argdata, (void *)udl);
- if (s != 1+*ss) {
- if (*s && (s[2] || !strchr("Bmac", *s) || !strchr("tBmac", s[1])))
- goto error;
- if (!*s || s[1]!='t') {
- struct stat st;
-
- xstat(ss[1], &st);
- udl->u.tm = *(struct timespec *)(((char *)&st)
- + macoff[!*s ? 0 : stridx("ac", s[1])+1]);
- } else if (s[1] == 't') {
- unsigned nano;
+ if (*s == 'u') udl->u.uid = xgetuid(ss[1]);
+ else if (*s == 'g') udl->u.gid = xgetgid(ss[1]);
+ else {
+ struct stat st;
- xparsedate(ss[1], &(udl->u.tm.tv_sec), &nano, 1);
- udl->u.tm.tv_nsec = nano;
- }
- } else if (*s == 'u') udl->u.uid = xgetuid(ss[1]);
- else udl->u.gid = xgetgid(ss[1]);
+ xstat(ss[1], &st);
+ udl->u.tm = st.st_mtim;
+ }
}
} else {
udl = (void *)llist_pop(&argdata);
@@ -484,13 +447,9 @@ static int do_find(struct dirtree *new)
if (*s == 'u') test = new->st.st_uid == udl->u.uid;
else if (*s == 'g') test = new->st.st_gid == udl->u.gid;
else {
- struct timespec *tm = (void *)(((char *)&new->st)
- + macoff[!s[5] ? 0 : stridx("ac", s[5])+1]);
-
- if (s[5] == 'B') test = 0;
- else test = (tm->tv_sec == udl->u.tm.tv_sec)
- ? tm->tv_nsec > udl->u.tm.tv_nsec
- : tm->tv_sec > udl->u.tm.tv_sec;
+ test = new->st.st_mtim.tv_sec > udl->u.tm.tv_sec;
+ if (new->st.st_mtim.tv_sec == udl->u.tm.tv_sec)
+ test = new->st.st_mtim.tv_nsec > udl->u.tm.tv_nsec;
}
}
}
@@ -576,81 +535,6 @@ static int do_find(struct dirtree *new)
// Argument consumed, skip the check.
goto cont;
- } else if (!strcmp(s, "printf")) {
- char *fmt, *ff, next[32], buf[64], ch;
- long ll;
- int len;
-
- print++;
- if (check) for (fmt = ss[1]; *fmt; fmt++) {
- // Print the parts that aren't escapes
- if (*fmt == '\\') {
- int slash = *++fmt, n = unescape(slash);
-
- if (n) ch = n;
- else if (slash=='c') break;
- else if (slash=='0') {
- ch = 0;
- while (*fmt>='0' && *fmt<='7' && n++<3) ch=(ch*8)+*(fmt++)-'0';
- --fmt;
- } else error_exit("bad \\%c", *fmt);
- putchar(ch);
- } else if (*fmt != '%') putchar(*fmt);
- else if (*++fmt == '%') putchar('%');
- else {
- fmt = next_printf(ff = fmt-1, 0);
- if ((len = fmt-ff)>28) error_exit("bad %.*s", len+1, ff);
- memcpy(next, ff, len);
- ff = 0;
- ch = *fmt;
-
- // long long is its own stack size on LP64, so handle seperately
- if (ch == 'i' || ch == 's') {
- strcpy(next+len, "lld");
- printf(next, (ch == 'i') ? (long long)new->st.st_ino
- : (long long)new->st.st_size);
- } else {
-
- // LP64 says these are all a single "long" argument to printf
- strcpy(next+len, "s");
- if (ch == 'G') next[len] = 'd', ll = new->st.st_gid;
- else if (ch == 'm') next[len] = 'o', ll = new->st.st_mode&~S_IFMT;
- else if (ch == 'U') next[len] = 'd', ll = new->st.st_uid;
- else if (ch == 'f') ll = (long)new->name;
- else if (ch == 'g') ll = (long)getgroupname(new->st.st_gid);
- else if (ch == 'u') ll = (long)getusername(new->st.st_uid);
- else if (ch == 'l') {
- char *path = dirtree_path(new, 0);
-
- ll = (long)(ff = xreadlink(path));
- free(path);
- if (!ll) ll = (long)"";
- } else if (ch == 'M') {
- mode_to_string(new->st.st_mode, buf);
- ll = (long)buf;
- } else if (ch == 'P') {
- ch = *TT.start;
- *TT.start = 0;
- ll = (long)(ff = dirtree_path(new, 0));
- *TT.start = ch;
- } else if (ch == 'p') ll = (long)(ff = dirtree_path(new, 0));
- else if (ch == 'T') {
- if (*++fmt!='@') error_exit("bad -printf %%T: %%T%c", *fmt);
- sprintf(buf, "%ld.%ld", new->st.st_mtim.tv_sec,
- new->st.st_mtim.tv_nsec);
- ll = (long)buf;
- } else if (ch == 'Z') {
- char *path = dirtree_path(new, 0);
-
- ll = (lsm_get_context(path, &ff) != -1) ? (long)ff : (long)"?";
- free(path);
- } else error_exit("bad -printf %%%c", ch);
-
- printf(next, ll);
- free(ff);
- }
- }
- }
} else goto error;
// This test can go at the end because we do a syntax checking
@@ -681,7 +565,7 @@ error:
void find_main(void)
{
int i, len;
- char **ss = (char *[]){"."};
+ char **ss = toys.optargs;
TT.topdir = -1;
TT.max_bytes = sysconf(_SC_ARG_MAX) - environ_bytes();
@@ -692,8 +576,10 @@ void find_main(void)
TT.filter = toys.optargs+len;
// use "." if no paths
- if (len) ss = toys.optargs;
- else len = 1;
+ if (!len) {
+ ss = (char *[]){"."};
+ len = 1;
+ }
// first pass argument parsing, verify args match up, handle "evaluate once"
TT.now = time(0);
@@ -701,8 +587,7 @@ void find_main(void)
// Loop through paths
for (i = 0; i < len; i++)
- dirtree_flagread(ss[i],
- DIRTREE_STATLESS|(DIRTREE_SYMFOLLOW*!!(toys.optflags&(FLAG_H|FLAG_L))),
+ dirtree_flagread(ss[i], DIRTREE_SYMFOLLOW*!!(toys.optflags&(FLAG_H|FLAG_L)),
do_find);
execdir(0, 1);
diff --git a/toys/posix/getconf.c b/toys/posix/getconf.c
index c5e05489..57c171dd 100644
--- a/toys/posix/getconf.c
+++ b/toys/posix/getconf.c
@@ -31,6 +31,12 @@ config GETCONF
#define _SC_XOPEN_UUCP -1
#endif
+// When NDK r19 ships in 2018Q4, switch to _SC_UIO_MAXIOV.
+// (Until then use this workaround for musl.)
+#ifndef UIO_MAXIOV
+#define UIO_MAXIOV 1024
+#endif
+
#ifdef __APPLE__
// macOS doesn't have a bunch of stuff. The actual macOS getconf says
// "no such parameter", but -- unless proven otherwise -- it seems more useful
@@ -38,7 +44,6 @@ config GETCONF
#define _SC_AVPHYS_PAGES -1
#define _SC_THREAD_ROBUST_PRIO_INHERIT -1
#define _SC_THREAD_ROBUST_PRIO_PROTECT -1
-#define _SC_UIO_MAXIOV -1
#define _SC_V7_ILP32_OFF32 -1
#define _SC_V7_ILP32_OFFBIG -1
#define _SC_V7_LP64_OFF64 -1
@@ -103,7 +108,7 @@ struct config sysconfs[] = {
CONF(PAGESIZE), CONF(RAW_SOCKETS), CONF(RE_DUP_MAX), CONF(RTSIG_MAX),
CONF(SEM_NSEMS_MAX), CONF(SEM_VALUE_MAX), CONF(SIGQUEUE_MAX),
CONF(STREAM_MAX), CONF(SYMLOOP_MAX), CONF(TIMER_MAX), CONF(TTY_NAME_MAX),
- CONF(TZNAME_MAX), CONF(UIO_MAXIOV),
+ CONF(TZNAME_MAX),
/* Names that just don't match the symbol, do it by hand */
{"_AVPHYS_PAGES", _SC_AVPHYS_PAGES}, {"_PHYS_PAGES", _SC_PHYS_PAGES},
@@ -154,7 +159,7 @@ struct config limits[] = {
CONF(CHAR_MAX), CONF(CHAR_MIN), CONF(INT_MAX), CONF(INT_MIN), CONF(SCHAR_MAX),
CONF(SCHAR_MIN), CONF(SHRT_MAX), CONF(SHRT_MIN), CONF(SSIZE_MAX),
CONF(UCHAR_MAX), CONF(UINT_MAX), CONF(ULONG_MAX), CONF(USHRT_MAX),
- CONF(CHAR_BIT),
+ CONF(UIO_MAXIOV), CONF(CHAR_BIT),
/* Not available in glibc without _GNU_SOURCE. */
{"LONG_BIT", 8*sizeof(long)},
{"WORD_BIT", 8*sizeof(int)},
diff --git a/toys/posix/grep.c b/toys/posix/grep.c
index 1fa1a7c4..9239614f 100644
--- a/toys/posix/grep.c
+++ b/toys/posix/grep.c
@@ -1,4 +1,4 @@
-/* grep.c - show lines matching regular expressions
+/* grep.c - print lines what match given regular expression
*
* Copyright 2013 CE Strake <strake888 at gmail.com>
*
@@ -10,7 +10,7 @@
* echo hello | grep -f </dev/null
*
-USE_GREP(NEWTOY(grep, "(line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]", TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
+USE_GREP(NEWTOY(grep, "(color):;S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]", TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
USE_EGREP(OLDTOY(egrep, grep, TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
USE_FGREP(OLDTOY(fgrep, grep, TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
@@ -29,10 +29,8 @@ config GREP
file search:
-r Recurse into subdirectories (defaults FILE to ".")
- -R Recurse into subdirectories and symlinks to directories
-M Match filename pattern (--include)
-S Skip filename pattern (--exclude)
- --exclude-dir=PATTERN Skip directory pattern
-I Ignore binary files
match type:
@@ -69,7 +67,7 @@ config FGREP
GLOBALS(
long m, A, B, C;
- struct arg_list *f, *e, *M, *S, *exclude_dir;
+ struct arg_list *f, *e, *M, *S;
char *color;
char *purple, *cyan, *red, *green, *grey;
@@ -175,21 +173,21 @@ static void do_grep(int fd, char *name)
for (seek = TT.e; seek; seek = seek->next) {
if (FLAG(x)) {
- if (!(FLAG(i) ? strcasecmp : strcmp)(seek->arg, line)) s = line;
+ if ((FLAG(i) ? strcasecmp : strcmp)(seek->arg, line)) s = line;
} else if (!*seek->arg) {
- // No need to set fseek.next because this will match every line.
seek = &fseek;
fseek.arg = s = line;
- } else if (FLAG(i)) s = strcasestr(start, seek->arg);
- else s = strstr(start, seek->arg);
-
+ break;
+ }
+ if (FLAG(i)) s = strcasestr(line, seek->arg);
+ else s = strstr(line, seek->arg);
if (s) break;
}
if (s) {
rc = 0;
- mm->rm_so = (s-start);
- mm->rm_eo = (s-start)+strlen(seek->arg);
+ mm->rm_so = (s-line);
+ mm->rm_eo = (s-line)+strlen(seek->arg);
} else rc = 1;
// Handle regex matches
@@ -275,7 +273,7 @@ static void do_grep(int fd, char *name)
if (!FLAG(c)) {
long bcount = 1 + offset + (start-line) + (FLAG(o) ? mm->rm_so : 0);
-
+
if (bin) printf("Binary file %s matches\n", name);
else if (FLAG(o))
outline(start+mm->rm_so, ':', name, lcount, bcount,
@@ -283,7 +281,7 @@ static void do_grep(int fd, char *name)
else {
while (dlb) {
struct double_list *dl = dlist_pop(&dlb);
- unsigned *uu = (void *)(dl->data+(strlen(dl->data)|3)+1);
+ unsigned *uu = (void *)(dl->data+((strlen(dl->data)+1)|3)+1);
outline(dl->data, '-', name, lcount-before, uu[0]+1, uu[1]);
free(dl->data);
@@ -326,10 +324,10 @@ static void do_grep(int fd, char *name)
discard = 0;
}
if (discard && TT.B) {
- unsigned *uu, ul = (ulen|3)+1;
+ unsigned *uu, ul = (ulen+1)|3;
line = xrealloc(line, ul+8);
- uu = (void *)(line+ul);
+ uu = (void *)(line+ul+1);
uu[0] = offset-len;
uu[1] = ulen;
dlist_add(&dlb, line);
@@ -398,14 +396,20 @@ static void parse_regex(void)
TT.e = list;
if (!FLAG(F)) {
+ int i;
+
// Convert regex list
for (al = TT.e; al; al = al->next) {
struct reg *shoe;
if (FLAG(o) && !*al->arg) continue;
dlist_add_nomalloc(&TT.reg, (void *)(shoe = xmalloc(sizeof(struct reg))));
- xregcomp(&shoe->r, al->arg,
- (REG_EXTENDED*!!FLAG(E))|(REG_ICASE*!!FLAG(i)));
+ i = regcomp(&shoe->r, al->arg,
+ (REG_EXTENDED*!!FLAG(E)) | (REG_ICASE*!!FLAG(i)));
+ if (i) {
+ regerror(i, &shoe->r, toybuf, sizeof(toybuf));
+ error_exit("bad REGEX '%s': %s", al->arg, toybuf);
+ }
}
dlist_terminate(TT.reg);
}
@@ -413,17 +417,14 @@ static void parse_regex(void)
static int do_grep_r(struct dirtree *new)
{
- struct arg_list *al;
char *name;
if (!new->parent) TT.tried++;
if (!dirtree_notdotdot(new)) return 0;
- if (S_ISDIR(new->st.st_mode)) {
- for (al = TT.exclude_dir; al; al = al->next)
- if (!fnmatch(al->arg, new->name, 0)) return 0;
- return DIRTREE_RECURSE|(FLAG(R)?DIRTREE_SYMFOLLOW:0);
- }
+ if (S_ISDIR(new->st.st_mode)) return DIRTREE_RECURSE;
if (TT.S || TT.M) {
+ struct arg_list *al;
+
for (al = TT.S; al; al = al->next)
if (!fnmatch(al->arg, new->name, 0)) return 0;
@@ -460,8 +461,6 @@ void grep_main(void)
TT.grey = "\033[0m";
} else TT.purple = TT.cyan = TT.red = TT.green = TT.grey = "";
- if (FLAG(R)) toys.optflags |= FLAG_r;
-
// Grep exits with 2 for errors
toys.exitval = 2;
diff --git a/toys/posix/head.c b/toys/posix/head.c
index ab8467e4..7e34a714 100644
--- a/toys/posix/head.c
+++ b/toys/posix/head.c
@@ -34,15 +34,16 @@ GLOBALS(
static void do_head(int fd, char *name)
{
- long i, len, lines=TT.n, bytes=TT.c;
+ int i, len, lines=TT.n, bytes=TT.c;
- if ((toys.optc > 1 && !FLAG(q)) || FLAG(v)) {
+ if ((toys.optc > 1 && !(toys.optflags & FLAG_q)) || toys.optflags & FLAG_v) {
// Print an extra newline for all but the first file
if (TT.file_no) xprintf("\n");
xprintf("==> %s <==\n", name);
+ xflush();
}
- while (FLAG(c) ? bytes : lines) {
+ while ((toys.optflags&FLAG_c) ? bytes : lines) {
len = read(fd, toybuf, sizeof(toybuf));
if (len<0) perror_msg_raw(name);
if (len<1) break;
diff --git a/toys/posix/kill.c b/toys/posix/kill.c
index c9de98ea..f8e86b67 100644
--- a/toys/posix/kill.c
+++ b/toys/posix/kill.c
@@ -41,7 +41,6 @@ config KILLALL5
// This has to match the filename:
#define FOR_kill
-#define FORCE_FLAGS
#include "toys.h"
GLOBALS(
@@ -62,15 +61,14 @@ void kill_main(void)
pid_t pid;
// list signal(s)
- if (FLAG(l)) {
+ if (toys.optflags & FLAG_l) {
if (*args) {
int signum = sig_to_num(*args);
char *s = NULL;
if (signum>=0) s = num_to_sig(signum&127);
- if (isdigit(**args)) puts(s ? s : "UNKNOWN");
- else printf("%d\n", signum);
- } else list_signals();
+ puts(s ? s : "UNKNOWN");
+ } else sig_to_num(NULL);
return;
}
@@ -95,7 +93,7 @@ void kill_main(void)
long *olist = 0, ocount = 0;
// parse omit list
- if (FLAG(o)) {
+ if (toys.optflags & FLAG_o) {
struct arg_list *ptr;
for (ptr = TT.o; ptr; ptr = ptr->next) ocount++;
diff --git a/toys/posix/ln.c b/toys/posix/ln.c
index 306f0cac..06700dd0 100644
--- a/toys/posix/ln.c
+++ b/toys/posix/ln.c
@@ -4,35 +4,29 @@
*
* See http://opengroup.org/onlinepubs/9699919799/utilities/ln.html
-USE_LN(NEWTOY(ln, "<1t:Tvnfs", TOYFLAG_BIN))
+USE_LN(NEWTOY(ln, "<1vnfs", TOYFLAG_BIN))
config LN
bool "ln"
default y
help
- usage: ln [-sfnv] [-t DIR] [FROM...] TO
+ usage: ln [-sfnv] [FROM...] TO
Create a link between FROM and TO.
- One/two/many arguments work like "mv" or "cp".
+ With only one argument, create link in current directory.
-s Create a symbolic link
-f Force the creation of the link, even if TO already exists
- -n Symlink at TO treated as file
- -t Create links in DIR
- -T TO always treated as file, max 2 arguments
+ -n Symlink at destination treated as file
-v Verbose
*/
#define FOR_ln
#include "toys.h"
-GLOBALS(
- char *t;
-)
-
void ln_main(void)
{
- char *dest = TT.t ? TT.t : toys.optargs[--toys.optc], *new;
+ char *dest = toys.optargs[--toys.optc], *new;
struct stat buf;
int i;
@@ -42,14 +36,13 @@ void ln_main(void)
dest=".";
}
- if (FLAG(T) && toys.optc>1) help_exit("Max 2 arguments");
// Is destination a directory?
- if (!((FLAG(n)||FLAG(T)) ? lstat : stat)(dest, &buf)) {
- i = S_ISDIR(buf.st_mode);
-
- if ((FLAG(T) && i) || (!i && (toys.optc>1 || TT.t)))
- error_exit("'%s' %s a directory", dest, i ? "is" : "not");
- } else buf.st_mode = 0;
+ if (((toys.optflags&FLAG_n) ? lstat : stat)(dest, &buf)
+ || !S_ISDIR(buf.st_mode))
+ {
+ if (toys.optc>1) error_exit("'%s' not a directory", dest);
+ buf.st_mode = 0;
+ }
for (i=0; i<toys.optc; i++) {
int rc;
@@ -62,7 +55,7 @@ void ln_main(void)
// a temp version and renaming it over the old one, so we can retain the
// old file in cases we can't replace it (such as hardlink between mounts).
oldnew = new;
- if (FLAG(f)) {
+ if (toys.optflags & FLAG_f) {
new = xmprintf("%s_XXXXXX", new);
rc = mkstemp(new);
if (rc >= 0) {
@@ -71,8 +64,8 @@ void ln_main(void)
}
}
- rc = FLAG(s) ? symlink(try, new) : link(try, new);
- if (FLAG(f)) {
+ rc = (toys.optflags & FLAG_s) ? symlink(try, new) : link(try, new);
+ if (toys.optflags & FLAG_f) {
if (!rc) {
int temp;
@@ -84,9 +77,11 @@ void ln_main(void)
free(new);
new = oldnew;
}
- if (rc) perror_msg("cannot create %s link from '%s' to '%s'",
- FLAG(s) ? "symbolic" : "hard", try, new);
- else if (FLAG(v)) fprintf(stderr, "'%s' -> '%s'\n", new, try);
+ if (rc)
+ perror_msg("cannot create %s link from '%s' to '%s'",
+ (toys.optflags & FLAG_s) ? "symbolic" : "hard", try, new);
+ else
+ if (toys.optflags & FLAG_v) fprintf(stderr, "'%s' -> '%s'\n", new, try);
if (new != dest) free(new);
}
diff --git a/toys/posix/ls.c b/toys/posix/ls.c
index a986ee72..9bb60f95 100644
--- a/toys/posix/ls.c
+++ b/toys/posix/ls.c
@@ -66,15 +66,15 @@ GLOBALS(
// Callback from crunch_str to represent unprintable chars
static int crunch_qb(FILE *out, int cols, int wc)
{
- int len = 1;
+ unsigned len = 1;
char buf[32];
- if (FLAG(q)) *buf = '?';
+ if (toys.optflags&FLAG_q) *buf = '?';
else {
if (wc<256) *buf = wc;
// scrute the inscrutable, eff the ineffable, print the unprintable
- else if ((len = wcrtomb(buf, wc, 0) ) == -1) len = 1;
- if (FLAG(b)) {
+ else len = wcrtomb(buf, wc, 0);
+ if (toys.optflags&FLAG_b) {
char *to = buf, *from = buf+24;
int i, j;
@@ -105,8 +105,8 @@ static int strwidth(char *s)
static char endtype(struct stat *st)
{
mode_t mode = st->st_mode;
- if ((FLAG(F)||FLAG(p)) && S_ISDIR(mode)) return '/';
- if (FLAG(F)) {
+ if ((toys.optflags&(FLAG_F|FLAG_p)) && S_ISDIR(mode)) return '/';
+ if (toys.optflags & FLAG_F) {
if (S_ISLNK(mode)) return '@';
if (S_ISREG(mode) && (mode&0111)) return '*';
if (S_ISFIFO(mode)) return '|';
@@ -122,7 +122,7 @@ static int numlen(long long ll)
static int print_with_h(char *s, long long value, int units)
{
- if (FLAG(h)) return human_readable(s, value*units, 0);
+ if (toys.optflags&FLAG_h) return human_readable(s, value*units, 0);
else return sprintf(s, "%lld", value);
}
@@ -160,13 +160,13 @@ static int compare(void *a, void *b)
{
struct dirtree *dta = *(struct dirtree **)a;
struct dirtree *dtb = *(struct dirtree **)b;
- int ret = 0, reverse = FLAG(r) ? -1 : 1;
+ int ret = 0, reverse = (toys.optflags & FLAG_r) ? -1 : 1;
- if (FLAG(S)) {
+ if (toys.optflags & FLAG_S) {
if (dta->st.st_size > dtb->st.st_size) ret = -1;
else if (dta->st.st_size < dtb->st.st_size) ret = 1;
}
- if (FLAG(t)) {
+ if (toys.optflags & FLAG_t) {
if (dta->st.st_mtime > dtb->st.st_mtime) ret = -1;
else if (dta->st.st_mtime < dtb->st.st_mtime) ret = 1;
else if (dta->st.st_mtim.tv_nsec > dtb->st.st_mtim.tv_nsec) ret = -1;
@@ -195,7 +195,7 @@ static int filter(struct dirtree *new)
// fchmodat(), mknodat(), readlinkat() so we could do this without
// even O_PATH? But no, this is 1990's tech.)
int fd = openat(dirtree_parentfd(new), new->name,
- O_PATH|(O_NOFOLLOW*!FLAG(L)));
+ O_PATH|(O_NOFOLLOW*!(toys.optflags&FLAG_L)));
if (fd != -1) {
if (-1 == lsm_fget_context(fd, (char **)&new->extra) && errno == EBADF)
@@ -237,7 +237,7 @@ static unsigned long next_column(unsigned long ul, unsigned long dtlen,
unsigned height, widecols;
// Horizontal sort is easy
- if (!FLAG(C)) {
+ if (!(toys.optflags & FLAG_C)) {
*xpos = ul % columns;
return ul;
}
@@ -283,15 +283,6 @@ static int color_from_mode(mode_t mode)
return color;
}
-static void zprint(int zap, char *pat, int len, unsigned long arg)
-{
- char tmp[32];
-
- sprintf(tmp, "%%*%s", zap ? "s" : pat);
- if (zap && pat[strlen(pat)-1]==' ') strcat(tmp, " ");
- printf(tmp, len, zap ? (unsigned long)"?" : arg);
-}
-
// Display a list of dirtree entries, according to current format
// Output types -1, -l, -C, or stream
@@ -330,7 +321,7 @@ static void listfiles(int dirfd, struct dirtree *indir)
// Read directory contents. We dup() the fd because this will close it.
// This reads/saves contents to display later, except for in "ls -1f" mode.
} else dirtree_recurse(indir, filter, dup(dirfd),
- DIRTREE_STATLESS|DIRTREE_SYMFOLLOW*!!(flags&FLAG_L));
+ DIRTREE_SYMFOLLOW*!!(flags&FLAG_L));
// Copy linked list to array and sort it. Directories go in array because
// we visit them in sorted order too. (The nested loops let us measure and
@@ -384,8 +375,7 @@ static void listfiles(int dirfd, struct dirtree *indir)
memset(colsizes, 0, columns*sizeof(unsigned));
for (ul=0; ul<dtlen; ul++) {
entrylen(sort[next_column(ul, dtlen, columns, &c)], len);
- // Add `2` to `totpad` to ensure two spaces between filenames
- *len += totpad+2;
+ *len += totpad+1;
if (c == columns) break;
// Expand this column if necessary, break if that puts us over budget
if (*len > colsizes[c]) {
@@ -402,16 +392,13 @@ static void listfiles(int dirfd, struct dirtree *indir)
// Loop through again to produce output.
width = 0;
for (ul = 0; ul<dtlen; ul++) {
- int ii, zap;
+ int ii;
unsigned curcol, color = 0;
unsigned long next = next_column(ul, dtlen, columns, &curcol);
struct stat *st = &(sort[next]->st);
mode_t mode = st->st_mode;
char et = endtype(st), *ss;
- // If we couldn't stat, output ? for most fields
- zap = !st->st_blksize && !st->st_dev && !st->st_ino;
-
// Skip directories at the top of the tree when -d isn't set
if (S_ISDIR(mode) && !indir->parent && !(flags & FLAG_d)) continue;
TT.nl_title=1;
@@ -434,26 +421,25 @@ static void listfiles(int dirfd, struct dirtree *indir)
}
width += *len;
- if (flags & FLAG_i) zprint(zap, "lu ", totals[1], st->st_ino);
+ if (flags & FLAG_i) printf("%*lu ", totals[1], (unsigned long)st->st_ino);
if (flags & FLAG_s) {
print_with_h(tmp, st->st_blocks, 512);
- zprint(zap, "s ", totals[6], (unsigned long)tmp);
+ printf("%*s ", totals[6], tmp);
}
if (flags & (FLAG_l|FLAG_o|FLAG_n|FLAG_g)) {
+ struct tm *tm;
// (long) is to coerce the st types into something we know we can print.
mode_to_string(mode, tmp);
- if (zap) memset(tmp+1, '?', 9);
- printf("%s", tmp);
- zprint(zap, "ld", totals[2]+1, st->st_nlink);
+ printf("%s% *ld", tmp, totals[2]+1, (long)st->st_nlink);
// print user
if (!(flags&FLAG_g)) {
putchar(' ');
ii = -totals[3];
- if (zap || (flags&FLAG_n)) zprint(zap, "lu", ii, st->st_uid);
+ if (flags&FLAG_n) printf("%*u", ii, (unsigned)st->st_uid);
else draw_trim_esc(getusername(st->st_uid), ii, abs(ii), TT.escmore,
crunch_qb);
}
@@ -462,37 +448,35 @@ static void listfiles(int dirfd, struct dirtree *indir)
if (!(flags&FLAG_o)) {
putchar(' ');
ii = -totals[4];
- if (zap || (flags&FLAG_n)) zprint(zap, "lu", ii, st->st_gid);
+ if (flags&FLAG_n) printf("%*u", ii, (unsigned)st->st_gid);
else draw_trim_esc(getgroupname(st->st_gid), ii, abs(ii), TT.escmore,
crunch_qb);
}
- }
- if (FLAG(Z))
- printf(" %-*s "+!FLAG(l), -(int)totals[7], (char *)sort[next]->extra);
- if (flags & (FLAG_l|FLAG_o|FLAG_n|FLAG_g)) {
- struct tm *tm;
+ if (flags & FLAG_Z)
+ printf(" %-*s", -(int)totals[7], (char *)sort[next]->extra);
// print major/minor, or size
- if (!zap && (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)))
+ if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode))
printf("% *d,% 4d", totals[5]-4, dev_major(st->st_rdev),
dev_minor(st->st_rdev));
else {
print_with_h(tmp, st->st_size, 1);
- zprint(zap, "s", totals[5]+1, (unsigned long)tmp);
+ printf("%*s", totals[5]+1, tmp);
}
// print time, always in --time-style=long-iso
tm = localtime(&(st->st_mtime));
- strftime(tmp, sizeof(tmp), " %F %H:%M", tm);
+ strftime(tmp, sizeof(tmp), "%F %H:%M", tm);
if (TT.l>1) {
char *s = tmp+strlen(tmp);
s += sprintf(s, ":%02d.%09d ", tm->tm_sec, (int)st->st_mtim.tv_nsec);
strftime(s, sizeof(tmp)-(s-tmp), "%z", tm);
}
- zprint(zap, "s ", 17+(TT.l>1)*13, (unsigned long)tmp);
- }
+ printf(" %s ", tmp);
+ } else if (flags & FLAG_Z)
+ printf("%-*s ", (int)totals[7], (char *)sort[next]->extra);
if (flags & FLAG_color) {
color = color_from_mode(st->st_mode);
@@ -505,7 +489,7 @@ static void listfiles(int dirfd, struct dirtree *indir)
if ((flags & (FLAG_l|FLAG_o|FLAG_n|FLAG_g)) && S_ISLNK(mode)) {
printf(" -> ");
- if (!zap && (flags & FLAG_color)) {
+ if (flags & FLAG_color) {
struct stat st2;
if (fstatat(dirfd, sort[next]->symlink, &st2, 0)) color = 256+31;
@@ -514,8 +498,8 @@ static void listfiles(int dirfd, struct dirtree *indir)
if (color) printf("\033[%d;%dm", color>>8, color&255);
}
- zprint(zap, "s", 0, (unsigned long)sort[next]->symlink);
- if (!zap && color) printf("\033[0m");
+ printf("%s", sort[next]->symlink);
+ if (color) printf("\033[0m");
}
if (et) xputc(et);
@@ -548,30 +532,30 @@ void ls_main(void)
char **s, *noargs[] = {".", 0};
struct dirtree *dt;
- if (FLAG(full_time)) {
+ if (toys.optflags&FLAG_full_time) {
toys.optflags |= FLAG_l;
TT.l = 2;
}
// Do we have an implied -1
if (isatty(1)) {
- if (!FLAG(show_control_chars)) toys.optflags |= FLAG_b;
+ if (!(toys.optflags&FLAG_show_control_chars)) toys.optflags |= FLAG_b;
if (toys.optflags&(FLAG_l|FLAG_o|FLAG_n|FLAG_g)) toys.optflags |= FLAG_1;
else if (!(toys.optflags&(FLAG_1|FLAG_x|FLAG_m))) toys.optflags |= FLAG_C;
} else {
- if (!FLAG(m)) toys.optflags |= FLAG_1;
+ if (!(toys.optflags & FLAG_m)) toys.optflags |= FLAG_1;
if (TT.color) toys.optflags ^= FLAG_color;
}
TT.screen_width = 80;
terminal_size(&TT.screen_width, NULL);
if (TT.screen_width<2) TT.screen_width = 2;
- if (FLAG(b)) TT.escmore = " \\";
+ if (toys.optflags&FLAG_b) TT.escmore = " \\";
// The optflags parsing infrastructure should really do this for us,
// but currently it has "switch off when this is set", so "-dR" and "-Rd"
// behave differently
- if (FLAG(d)) toys.optflags &= ~FLAG_R;
+ if (toys.optflags & FLAG_d) toys.optflags &= ~FLAG_R;
// Iterate through command line arguments, collecting directories and files.
// Non-absolute paths are relative to current directory. Top of tree is
@@ -582,15 +566,11 @@ void ls_main(void)
int sym = !(toys.optflags&(FLAG_l|FLAG_d|FLAG_F))
|| (toys.optflags&(FLAG_L|FLAG_H));
- dt = dirtree_add_node(0, *s, DIRTREE_STATLESS|DIRTREE_SYMFOLLOW*sym);
+ dt = dirtree_add_node(0, *s, DIRTREE_SYMFOLLOW*sym);
- // note: double_list->prev temporarily goes in dirtree->parent
- if (dt) {
- if (dt->again&2) {
- perror_msg_raw(*s);
- free(dt);
- } else dlist_add_nomalloc((void *)&TT.files->child, (void *)dt);
- } else toys.exitval = 1;
+ // note: double_list->prev temporarirly goes in dirtree->parent
+ if (dt) dlist_add_nomalloc((void *)&TT.files->child, (void *)dt);
+ else toys.exitval = 1;
}
// Convert double_list into dirtree.
diff --git a/toys/posix/nl.c b/toys/posix/nl.c
index ef2d7ab3..b9e60ae2 100644
--- a/toys/posix/nl.c
+++ b/toys/posix/nl.c
@@ -5,15 +5,15 @@
* See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/nl.html
*
* This implements a subset: only one logical page (-ip), no sections (-dfh).
- * todo: -l
+ * todo: -lv
-USE_NL(NEWTOY(nl, "v#=1l#w#<0=6Eb:n:s:", TOYFLAG_USR|TOYFLAG_BIN))
+USE_NL(NEWTOY(nl, "v#<1=1l#w#<0=6Eb:n:s:", TOYFLAG_USR|TOYFLAG_BIN))
config NL
bool "nl"
default y
help
- usage: nl [-E] [-l #] [-b MODE] [-n STYLE] [-s SEPARATOR] [-v #] [-w WIDTH] [FILE...]
+ usage: nl [-E] [-l #] [-b MODE] [-n STYLE] [-s SEPARATOR] [-w WIDTH] [FILE...]
Number lines of input.
@@ -22,7 +22,6 @@ config NL
-l Only count last of this many consecutive blank lines
-n Number STYLE: ln (left justified) rn (right justified) rz (zero pad)
-s Separator to use between number and line (instead of TAB)
- -v Starting line number for each section (default 1)
-w Width of line numbers (default 6)
*/
@@ -35,25 +34,36 @@ GLOBALS(
// Count of consecutive blank lines for -l has to persist between files
long lcount;
- long slen;
)
-static void do_nl(char **pline, long len)
+static void do_nl(int fd, char *name)
{
- char *line;
- int match = *TT.b != 'n';
-
- if (!pline) return;
- line = *pline;
-
- if (*TT.b == 'p') match = !regexec((void *)(toybuf+16), line, 0, 0, 0);
- if (TT.l || *TT.b == 't')
- if (*line == '\n') match = TT.l && ++TT.lcount >= TT.l;
- if (match) {
- TT.lcount = 0;
- printf(toybuf, TT.w, TT.v++, TT.s);
- } else printf("%*c", (int)(TT.w+TT.slen), ' ');
- xprintf("%s", line);
+ FILE *f = xfdopen(fd, "r");
+ int w = TT.w, slen = strlen(TT.s);
+
+ for (;;) {
+ char *line = 0;
+ size_t temp;
+ int match = *TT.b != 'n';
+
+ if (getline(&line, &temp, f) < 1) {
+ if (ferror(f)) perror_msg_raw(name);
+ break;
+ }
+
+ if (*TT.b == 'p') match = !regexec((void *)(toybuf+16), line, 0, 0, 0);
+ if (TT.l || *TT.b == 't')
+ if (*line == '\n') match = TT.l && ++TT.lcount >= TT.l;
+ if (match) {
+ TT.lcount = 0;
+ printf(toybuf, w, TT.v++, TT.s);
+ } else printf("%*c", (int)w+slen, ' ');
+ xprintf("%s", line);
+
+ free(line);
+ }
+
+ fclose(f);
}
void nl_main(void)
@@ -61,7 +71,6 @@ void nl_main(void)
char *clip = "";
if (!TT.s) TT.s = "\t";
- TT.slen = strlen(TT.s);
if (!TT.n || !strcmp(TT.n, "rn")); // default
else if (!strcmp(TT.n, "ln")) clip = "-";
@@ -76,5 +85,5 @@ void nl_main(void)
REG_NOSUB | (toys.optflags&FLAG_E)*REG_EXTENDED);
else if (!strchr("atn", *TT.b)) error_exit("bad -b '%s'", TT.b);
- loopfiles_lines(toys.optargs, do_nl);
+ loopfiles (toys.optargs, do_nl);
}
diff --git a/toys/posix/patch.c b/toys/posix/patch.c
index 3234a1f0..efb15432 100644
--- a/toys/posix/patch.c
+++ b/toys/posix/patch.c
@@ -14,10 +14,11 @@
* -r rejectfile write rejected hunks to this file
*
* -E remove empty files --remove-empty-files
+ * -f force (no questions asked)
* -F fuzz (number, default 2)
* [file] which file to patch
-USE_PATCH(NEWTOY(patch, "(no-backup-if-mismatch)(dry-run)"USE_TOYBOX_DEBUG("x")"g#fulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
+USE_PATCH(NEWTOY(patch, "(dry-run)"USE_TOYBOX_DEBUG("x")"ulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
config PATCH
bool "patch"
@@ -49,7 +50,7 @@ config PATCH
GLOBALS(
char *i, *d;
- long p, g;
+ long p;
struct double_list *current_hunk;
long oldline, oldlen, newline, newlen;
@@ -246,35 +247,6 @@ done:
return TT.state;
}
-// read a filename that has been quoted or escaped
-char *unquote_file(char *filename) {
- char *s = filename, *result, *t, *u;
- int quote = 0, ch;
-
- // quoted and escaped filenames are larger than the original
- result = xmalloc(strlen(filename) + 1);
- t = result;
- if (*s == '"') {
- s++;
- quote = 1;
- }
- for (; *s && !(quote && *s == '"' && !s[1]); s++) {
- // don't accept escape sequences unless the filename is quoted
- if (quote && *s == '\\' && s[1]) {
- if (s[1] >= '0' && s[1] < '8') {
- *t++ = strtoul(s + 1, &u, 8);
- s = u - 1;
- } else {
- ch = unescape(s[1]);
- *t++ = ch ? ch : s[1];
- s++;
- }
- } else *t++ = *s;
- }
- *t = 0;
- return result;
-}
-
// Read a patch file and find hunks, opening/creating/deleting files.
// Call apply_one_hunk() on each hunk.
@@ -350,12 +322,13 @@ void patch_main(void)
finish_oldfile();
// Trim date from end of filename (if any). We don't care.
- for (s = patchline+4; *s && *s!='\t'; s++);
+ for (s = patchline+4; *s && (*s!='\t' || !isdigit(s[1])); s++)
+ if (*s=='\\' && s[1]) s++;
i = atoi(s);
if (i>1900 && i<=1970) *name = xstrdup("/dev/null");
else {
*s = 0;
- *name = unquote_file(patchline+4);
+ *name = xstrdup(patchline+4);
}
// We defer actually opening the file because svn produces broken
diff --git a/toys/posix/printf.c b/toys/posix/printf.c
index b51eddc0..5448d8c7 100644
--- a/toys/posix/printf.c
+++ b/toys/posix/printf.c
@@ -9,12 +9,12 @@
USE_PRINTF(NEWTOY(printf, "<1?^", TOYFLAG_USR|TOYFLAG_BIN))
-config PRINTF
+config PRINTF
bool "printf"
default y
help
usage: printf FORMAT [ARGUMENT...]
-
+
Format and print ARGUMENT(s) according to FORMAT, using C printf syntax
(% escapes for cdeEfgGiosuxX, \ escapes for abefnrtv0 or \OCTAL or \xHEX).
*/
@@ -61,8 +61,11 @@ static int handle_slash(char **esc_val, int posix)
num = tolower(*ptr) - '0';
if (num >= 'a'-'0') num += '0'-'a'+10;
if (num >= base) {
- // "\xav" is "\xa"+"v", but "\xva" is an error.
- if (base == 16 && len == 2) error_exit("bad \\x");
+ // Don't parse invalid hex value ala "\xvd", print it verbatim
+ if (base == 16 && len == 2) {
+ ptr--;
+ result = '\\';
+ }
break;
}
result = (result*base)+num;
diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index 0c8e8e81..9d7c6445 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -588,18 +588,10 @@ static char *string_field(struct procpid *tb, struct ofields *field)
// Human readable
} else if (which <= PS_DIO) {
- int i = abs(field->len);
-
- if (i<4) i = 4;
- s = out;
- if ((ll = slot[typos[which].slot])<0) {
- ll = -ll;
- *s++ = '-';
- if (i>4) i--;
- }
+ ll = slot[typos[which].slot];
if (which <= PS_SHR) ll *= sysconf(_SC_PAGESIZE);
if (TT.forcek) sprintf(out, "%lldk", ll/1024);
- else human_readable_long(s, ll, i-1, 0);
+ else human_readable(out, ll, 0);
// Posix doesn't specify what flags should say. Man page says
// 1 for PF_FORKNOEXEC and 4 for PF_SUPERPRIV from linux/sched.h
@@ -789,8 +781,8 @@ static int get_ps(struct dirtree *new)
slot[SLOT_ruid] = s ? atol(s) : new->st.st_uid;
s = strafter(buf, "\nGid:");
slot[SLOT_rgid] = s ? atol(s) : new->st.st_gid;
- if ((s = strafter(buf, "\nVmLck:"))) slot[SLOT_vmlck] = atoll(s)*1024;
- if ((s = strafter(buf, "\nVmSwap:"))) slot[SLOT_swap] = atoll(s)*1024;
+ if ((s = strafter(buf, "\nVmLck:"))) slot[SLOT_vmlck] = atoll(s);
+ if ((s = strafter(buf, "\nVmSwap:"))) slot[SLOT_swap] = atoll(s);
}
// Do we need to read "io"?
@@ -1564,7 +1556,8 @@ static void top_common(
// Display "top" header.
if (*toys.which->name == 't') {
struct ofields field;
- char hr[4][32];
+ char *hr0 = toybuf+sizeof(toybuf)-32, *hr1 = hr0-32, *hr2 = hr1-32,
+ *hr3 = hr2-32;
long long ll, up = 0;
long run[6];
int j;
@@ -1584,22 +1577,28 @@ static void top_common(
run[2]+run[3], run[4]);
lines = header_line(lines, 0);
- if (readfile("/proc/meminfo", toybuf+256, sizeof(toybuf)-256)) {
- for (i = 0; i<6; i++) {
- j = i%3;
- pos = strafter(toybuf+256, (char *[]){"MemTotal:","\nMemFree:",
- "\nBuffers:","\nSwapTotal:","\nSwapFree:","\nCached:"}[i]);
- human_readable_long(hr[j+!!j], 1024*(run[i] = pos?atol(pos):0),
- 8, 0);
- if (j==1) human_readable_long(hr[1], 1024*(run[i-1]-run[i]), 8,0);
- else if (j==2) {
- sprintf(toybuf, (i<3)
- ? " Mem: %9s total, %9s used, %9s free, %9s buffers"
- : " Swap: %9s total, %9s used, %9s free, %9s cached",
- hr[0], hr[1], hr[2], hr[3]);
- lines = header_line(lines, 0);
- }
+ if (readfile("/proc/meminfo", toybuf, sizeof(toybuf))) {
+ for (i=0; i<6; i++) {
+ pos = strafter(toybuf, (char *[]){"MemTotal:","\nMemFree:",
+ "\nBuffers:","\nCached:","\nSwapTotal:","\nSwapFree:"}[i]);
+ run[i] = pos ? atol(pos) : 0;
}
+
+ human_readable(hr0, 1024*run[0], 0);
+ human_readable(hr1, 1024*(run[0]-run[1]), 0);
+ human_readable(hr2, 1024*run[1], 0);
+ human_readable(hr3, 1024*run[2], 0);
+ sprintf(toybuf, " Mem: %9s total, %9s used, %9s free, %9s buffers",
+ hr0, hr1, hr2, hr3);
+ lines = header_line(lines, 0);
+
+ human_readable(hr0, 1024*run[4], 0);
+ human_readable(hr1, 1024*(run[4]-run[5]), 0);
+ human_readable(hr2, 1024*run[5], 0);
+ human_readable(hr3, 1024*run[3], 0);
+ sprintf(toybuf, " Swap: %9s total, %9s used, %9s free, %9s cached",
+ hr0, hr1, hr2, hr3);
+ lines = header_line(lines, 0);
}
pos = toybuf;
diff --git a/toys/posix/rm.c b/toys/posix/rm.c
index 8874b54f..6c64e13f 100644
--- a/toys/posix/rm.c
+++ b/toys/posix/rm.c
@@ -25,19 +25,20 @@ config RM
static int do_rm(struct dirtree *try)
{
- int fd=dirtree_parentfd(try), dir=S_ISDIR(try->st.st_mode), or=0, using=0;
+ int fd = dirtree_parentfd(try), flags = toys.optflags;
+ int dir = S_ISDIR(try->st.st_mode), or = 0, using = 0;
// Skip . and .. (yes, even explicitly on the command line: posix says to)
if (isdotdot(try->name)) return 0;
// Intentionally fail non-recursive attempts to remove even an empty dir
// (via wrong flags to unlinkat) because POSIX says to.
- if (dir && !(toys.optflags & (FLAG_r|FLAG_R))) goto skip;
+ if (dir && !(flags & (FLAG_r|FLAG_R))) goto skip;
// This is either the posix section 2(b) prompt or the section 3 prompt.
- if (!FLAG(f)
+ if (!(flags & FLAG_f)
&& (!S_ISLNK(try->st.st_mode) && faccessat(fd, try->name, W_OK, 0))) or++;
- if (!(dir && try->again) && ((or && isatty(0)) || FLAG(i))) {
+ if (!(dir && try->again) && ((or && isatty(0)) || (flags & FLAG_i))) {
char *s = dirtree_path(try, 0);
fprintf(stderr, "rm %s%s%s", or ? "ro " : "", dir ? "dir " : "", s);
@@ -51,12 +52,12 @@ static int do_rm(struct dirtree *try)
using = AT_REMOVEDIR;
// Handle chmod 000 directories when -f
if (faccessat(fd, try->name, R_OK, 0)) {
- if (FLAG(f)) wfchmodat(fd, try->name, 0700);
+ if (toys.optflags & FLAG_f) wfchmodat(fd, try->name, 0700);
else goto skip;
}
if (!try->again) return DIRTREE_COMEAGAIN;
if (try->symlink) goto skip;
- if (FLAG(i)) {
+ if (flags & FLAG_i) {
char *s = dirtree_path(try, 0);
// This is the section 2(d) prompt. (Yes, posix says to prompt twice.)
@@ -69,7 +70,7 @@ static int do_rm(struct dirtree *try)
skip:
if (!unlinkat(fd, try->name, using)) {
- if (FLAG(v)) {
+ if (flags & FLAG_v) {
char *s = dirtree_path(try, 0);
printf("%s%s '%s'\n", toys.which->name, dir ? "dir" : "", s);
free(s);
@@ -88,7 +89,7 @@ void rm_main(void)
char **s;
// Can't use <1 in optstring because zero arguments with -f isn't an error
- if (!toys.optc && !FLAG(f)) help_exit("Needs 1 argument");
+ if (!toys.optc && !(toys.optflags & FLAG_f)) error_exit("Needs 1 argument");
for (s = toys.optargs; *s; s++) {
if (!strcmp(*s, "/")) {
@@ -98,7 +99,8 @@ void rm_main(void)
// Files that already don't exist aren't errors for -f, so try a quick
// unlink now to see if it succeeds or reports that it didn't exist.
- if (FLAG(f) && (!unlink(*s) || errno == ENOENT)) continue;
+ if ((toys.optflags & FLAG_f) && (!unlink(*s) || errno == ENOENT))
+ continue;
// There's a race here where a file removed between the above check and
// dirtree's stat would report the nonexistence as an error, but that's
diff --git a/toys/posix/rmdir.c b/toys/posix/rmdir.c
index d04cf0d9..90920ef6 100644
--- a/toys/posix/rmdir.c
+++ b/toys/posix/rmdir.c
@@ -4,7 +4,7 @@
*
* See http://opengroup.org/onlinepubs/9699919799/utilities/rmdir.html
-USE_RMDIR(NEWTOY(rmdir, "<1(ignore-fail-on-non-empty)p", TOYFLAG_BIN))
+USE_RMDIR(NEWTOY(rmdir, "<1p", TOYFLAG_BIN))
config RMDIR
bool "rmdir"
@@ -15,10 +15,8 @@ config RMDIR
Remove one or more directories.
-p Remove path
- --ignore-fail-on-non-empty Ignore failures caused by non-empty directories
*/
-#define FOR_rmdir
#include "toys.h"
static void do_rmdir(char *name)
@@ -27,8 +25,7 @@ static void do_rmdir(char *name)
for (;;) {
if (rmdir(name)) {
- if (!FLAG(ignore_fail_on_non_empty) || errno != ENOTEMPTY)
- perror_msg_raw(name);
+ perror_msg_raw(name);
return;
}
diff --git a/toys/posix/sed.c b/toys/posix/sed.c
index fa40dbf5..0c31d2af 100644
--- a/toys/posix/sed.c
+++ b/toys/posix/sed.c
@@ -40,7 +40,7 @@ config SED
apply only to the specified line(s). Commands without an address apply to
every line. Addresses are of the form:
- [ADDRESS[,ADDRESS]][!]COMMAND
+ [ADDRESS[,ADDRESS]]COMMAND
The ADDRESS may be a decimal line number (starting at 1), a /regular
expression/ within a pair of forward slashes, or the character "$" which
@@ -49,7 +49,7 @@ config SED
address matches one line, a pair of comma separated addresses match
everything from the first address to the second address (inclusive). If
both addresses are regular expressions, more than one range of lines in
- each file can match. The second address can be +N to end N lines later.
+ each file can match.
REGULAR EXPRESSIONS in sed are started and ended by the same character
(traditionally / but anything except a backslash or a newline works).
@@ -69,8 +69,6 @@ config SED
Each COMMAND starts with a single character. The following commands take
no arguments:
- ! Run this command when the test _didn't_ match.
-
{ Start a new command block, continuing until a corresponding "}".
Command blocks may nest. If the block has an address, commands within
the block are only run for lines within the block's address range.
@@ -216,7 +214,7 @@ static int emit(char *line, long len, int eol)
l = writeall(TT.fdout, line, len);
if (eol) line[len-1] = old;
if (l != len) {
- if (TT.fdout != 1) perror_msg("short write");
+ perror_msg("short write");
return 1;
}
@@ -241,14 +239,14 @@ static char *extend_string(char **old, char *new, int oldlen, int newlen)
}
// An empty regex repeats the previous one
-static void *get_regex(void *command, int offset)
+static void *get_regex(void *trump, int offset)
{
if (!offset) {
if (!TT.lastregex) error_exit("no previous regex");
return TT.lastregex;
}
- return TT.lastregex = offset+(char *)command;
+ return TT.lastregex = offset+(char *)trump;
}
// Apply pattern to line from input file
@@ -306,23 +304,20 @@ static void sed_line(char **pline, long plen)
if (line && !regexec0(rm, line, len, 0, 0, 0)) miss = 1;
}
} else if (lm > 0 && lm < TT.count) command->hit = 0;
- else if (lm < -1 && TT.count == command->hit+(-lm-1)) command->hit = 0;
// Start a new match?
} else {
if (!(lm = *command->lmatch)) {
void *rm = get_regex(command, *command->rmatch);
- if (line && !regexec0(rm, line, len, 0, 0, 0))
- command->hit = TT.count;
- } else if (lm == TT.count || (lm == -1 && !pline))
- command->hit = TT.count;
+ if (line && !regexec0(rm, line, len, 0, 0, 0)) command->hit++;
+ } else if (lm == TT.count || (lm == -1 && !pline)) command->hit++;
if (!command->lmatch[1] && !command->rmatch[1]) miss = 1;
}
// Didn't match?
- lm = !(command->not^!!command->hit);
+ lm = !(command->hit ^ command->not);
// Deferred disable from regex end match
if (miss || command->lmatch[1] == TT.count) command->hit = 0;
@@ -463,32 +458,28 @@ static void sed_line(char **pline, long plen)
char *l = (c=='P') ? strchr(line, '\n') : 0;
if (emit(line, l ? l-line : len, eol)) break;
- } else if (c=='q' || c=='Q') {
+ } else if (c=='q') {
if (pline) *pline = (void *)1;
free(TT.nextline);
- if (!toys.exitval && command->arg1)
- toys.exitval = atoi(command->arg1+(char *)command);
TT.nextline = 0;
TT.nextlen = 0;
- if (c=='Q') line = 0;
break;
} else if (c=='s') {
- char *rline = line, *new = command->arg2 + (char *)command, *l2 = 0;
+ char *rline = line, *new = command->arg2 + (char *)command, *swap, *rswap;
regmatch_t *match = (void *)toybuf;
regex_t *reg = get_regex(command, command->arg1);
- int mflags = 0, count = 0, l2used = 0, zmatch = 1, l2l = len, l2old = 0,
- mlen, off, newlen;
+ int mflags = 0, count = 0, zmatch = 1, rlen = len, mlen, off, newlen;
- // Loop finding match in remaining line (up to remaining len)
- while (!regexec0(reg, rline, len-(rline-line), 10, match, mflags)) {
+ // Find match in remaining line (up to remaining len)
+ while (!regexec0(reg, rline, rlen, 10, match, mflags)) {
mflags = REG_NOTBOL;
// Zero length matches don't count immediately after a previous match
mlen = match[0].rm_eo-match[0].rm_so;
if (!mlen && !zmatch) {
- if (rline-line == len) break;
- l2[l2used++] = *rline++;
+ if (!rlen--) break;
+ rline++;
zmatch++;
continue;
} else zmatch = 0;
@@ -496,9 +487,8 @@ static void sed_line(char **pline, long plen)
// If we're replacing only a specific match, skip if this isn't it
off = command->sflags>>3;
if (off && off != ++count) {
- memcpy(l2+l2used, rline, match[0].rm_eo);
- l2used += match[0].rm_eo;
rline += match[0].rm_eo;
+ rlen -= match[0].rm_eo;
continue;
}
@@ -519,15 +509,13 @@ static void sed_line(char **pline, long plen)
newlen += match[cc].rm_eo-match[cc].rm_so;
}
- // Copy changed data to new string
-
- // Adjust allocation size of new string, copy data we know we'll keep
- l2l += newlen-mlen;
- if ((l2l|0xfff) > l2old) l2 = xrealloc(l2, l2old = (l2l|0xfff)+1);
- if (match[0].rm_so) {
- memcpy(l2+l2used, rline, match[0].rm_so);
- l2used += match[0].rm_so;
- }
+ // Allocate new size, copy start/end around match. (Can't extend in
+ // place because backrefs may refer to text after it's overwritten.)
+ len += newlen-mlen;
+ swap = xmalloc(len+1);
+ rswap = swap+(rline-line)+match[0].rm_so;
+ memcpy(swap, line, (rline-line)+match[0].rm_so);
+ memcpy(rswap+newlen, rline+match[0].rm_eo, (rlen -= match[0].rm_eo)+1);
// copy in new replacement text
for (off = mlen = 0; new[off]; off++) {
@@ -536,40 +524,33 @@ static void sed_line(char **pline, long plen)
if (new[off] == '\\') {
cc = new[++off] - '0';
if (cc<0 || cc>9) {
- if (!(l2[l2used+mlen++] = unescape(new[off])))
- l2[l2used+mlen-1] = new[off];
+ if (!(rswap[mlen++] = unescape(new[off])))
+ rswap[mlen-1] = new[off];
continue;
} else if (cc > reg->re_nsub) error_exit("no s//\\%d/", cc);
} else if (new[off] != '&') {
- l2[l2used+mlen++] = new[off];
+ rswap[mlen++] = new[off];
continue;
}
- if (match[cc].rm_so != -1) {
+ if (match[cc].rm_so == -1) ll = 0; // Empty match.
+ else {
ll = match[cc].rm_eo-match[cc].rm_so;
- memcpy(l2+l2used+mlen, rline+match[cc].rm_so, ll);
- mlen += ll;
+ memcpy(rswap+mlen, rline+match[cc].rm_so, ll);
}
+ mlen += ll;
}
- l2used += newlen;
- rline += match[0].rm_eo;
+
+ rline = rswap+newlen;
+ free(line);
+ line = swap;
// Stop after first substitution unless we have flag g
if (!(command->sflags & 2)) break;
}
- // If we made any changes, finish off l2 and swap it for line
- if (l2) {
- // grab trailing unmatched data and null terminator, swap with original
- mlen = len-(rline-line);
- memcpy(l2+l2used, rline, mlen+1);
- len = l2used + mlen;
- free(line);
- line = l2;
- }
-
if (mflags) {
// flag p
if (command->sflags & 4) emit(line, len, eol);
@@ -787,7 +768,8 @@ static void parse_pattern(char **pline, long len)
}
if (!*line) return;
- // Start by writing data into toybuf.
+ // We start by writing data into toybuf. Later we'll allocate the
+ // ex
errstart = line;
memset(toybuf, 0, sizeof(struct sedcmd));
@@ -799,10 +781,7 @@ static void parse_pattern(char **pline, long len)
if (*line == ',') line++;
else if (i) break;
- if (i && *line == '+' && isdigit(line[1])) {
- line++;
- command->lmatch[i] = -2-strtol(line, &line, 0);
- } else if (isdigit(*line)) command->lmatch[i] = strtol(line, &line, 0);
+ if (isdigit(*line)) command->lmatch[i] = strtol(line, &line, 0);
else if (*line == '$') {
command->lmatch[i] = -1;
line++;
@@ -823,18 +802,17 @@ static void parse_pattern(char **pline, long len)
while (isspace(*line)) line++;
if (!*line) break;
- if (*line == '!') {
+ while (*line == '!') {
command->not = 1;
line++;
}
while (isspace(*line)) line++;
- if (!*line) break;
c = command->c = *(line++);
if (strchr("}:", c) && i) break;
- if (strchr("aiqQr=", c) && i>1) break;
+ if (strchr("aiqr=", c) && i>1) break;
- // Allocate memory and copy out of toybuf now that we know how big it is
+ // Add step to pattern
command = xmemdup(toybuf, reg-toybuf);
reg = (reg-toybuf) + (char *)command;
@@ -959,7 +937,7 @@ writenow:
if (len != strlen(s)) goto error;
reg = extend_string((void *)&command, s, reg-(char*)command, len);
free(s);
- } else if (strchr("abcirtTqQw:", c)) {
+ } else if (strchr("abcirtTw:", c)) {
int end;
// trim leading spaces
@@ -970,20 +948,12 @@ writenow:
resume_a:
command->hit = 0;
- // btTqQ: end with space or semicolon, aicrw continue to newline.
- if (!(end = strcspn(line, strchr(":btTqQ", c) ? "}; \t\r\n\v\f" : "\n"))){
- // Argument's optional for btTqQ
- if (strchr("btTqQ", c)) continue;
+ // btT: end with space or semicolon, aicrw continue to newline.
+ if (!(end = strcspn(line, strchr(":btT", c) ? "}; \t\r\n\v\f" : "\n"))) {
+ // Argument's optional for btT
+ if (strchr("btT", c)) continue;
else if (!command->arg1) break;
}
- // Error checking: qQ can only have digits after them
- if (c=='q' || c=='Q') {
- for (i = 0; i<end && isdigit(line[i]); i++);
- if (i != end) {
- line += i;
- break;
- }
- }
// Extend allocation to include new string. We use offsets instead of
// pointers so realloc() moving stuff doesn't break things. Ok to write
@@ -1021,7 +991,7 @@ resume_a:
} else line += end;
// Commands that take no arguments
- } else if (!strchr("{dDgGhHlnNpPx=", c)) break;
+ } else if (!strchr("{dDgGhHlnNpPqx=", c)) break;
}
error:
diff --git a/toys/posix/sort.c b/toys/posix/sort.c
index 4b3fe24d..9d2f2276 100644
--- a/toys/posix/sort.c
+++ b/toys/posix/sort.c
@@ -63,7 +63,6 @@ GLOBALS(
void *key_list;
int linecount;
char **lines;
- char *name;
)
// The sort types are n, g, and M.
@@ -276,37 +275,31 @@ static int compare_keys(const void *xarg, const void *yarg)
return retval * ((flags&FLAG_r) ? -1 : 1);
}
-// Read each line from file, appending to a big array.
-static void sort_lines(char **pline, long len)
+// Callback from loopfiles to handle input files.
+static void sort_read(int fd, char *name)
{
- char * line;
+ // Read each line from file, appending to a big array.
- if (!pline) return;
- line = *pline;
- if (!FLAG(z) && len && line[len-1]=='\n') line[--len] = 0;
- *pline = NULL;
+ for (;;) {
+ char * line = FLAG(z) ? get_rawline(fd, NULL, 0) : get_line(fd);
- // handle -c here so we don't allocate more memory than necessary.
- if (FLAG(c)) {
- int j = FLAG(u) ? -1 : 0;
+ if (!line) break;
- if (TT.lines && compare_keys((void *)&TT.lines, &line)>j)
- error_exit("%s: Check line %d\n", TT.name, TT.linecount);
- free(TT.lines);
- TT.lines = (char **)line;
- } else {
- if (!(TT.linecount&63))
- TT.lines = xrealloc(TT.lines, sizeof(char *)*(TT.linecount+64));
- TT.lines[TT.linecount] = line;
- }
- TT.linecount++;
-}
+ // handle -c here so we don't allocate more memory than necessary.
+ if (FLAG(c)) {
+ int j = FLAG(u) ? -1 : 0;
-// Callback from loopfiles to handle input files.
-static void sort_read(int fd, char *name)
-{
- TT.name = name;
- do_lines(fd, FLAG(z) ? '\0' : '\n', sort_lines);
+ if (TT.lines && compare_keys((void *)&TT.lines, &line)>j)
+ error_exit("%s: Check line %d\n", name, TT.linecount);
+ free(TT.lines);
+ TT.lines = (char **)line;
+ } else {
+ if (!(TT.linecount&63))
+ TT.lines = xrealloc(TT.lines, sizeof(char *)*(TT.linecount+64));
+ TT.lines[TT.linecount] = line;
+ }
+ TT.linecount++;
+ }
}
void sort_main(void)
diff --git a/toys/posix/tail.c b/toys/posix/tail.c
index d7161249..8c6548d3 100644
--- a/toys/posix/tail.c
+++ b/toys/posix/tail.c
@@ -20,16 +20,23 @@ config TAIL
-n Output the last NUMBER lines (default 10), +X counts from start
-c Output the last NUMBER bytes, +NUMBER counts from start
-f Follow FILE(s), waiting for more data to be appended
+
+config TAIL_SEEK
+ bool "tail seek support"
+ default y
+ depends on TAIL
+ help
+ This version uses lseek, which is faster on large files.
*/
#define FOR_tail
#include "toys.h"
+#include <sys/inotify.h>
GLOBALS(
long n, c;
- int file_no, last_fd;
- struct xnotify *not;
+ int file_no, ffd, *files;
)
struct line_list {
@@ -130,14 +137,16 @@ static void do_tail(int fd, char *name)
int linepop = 1;
if (FLAG(f)) {
+ int f = TT.file_no*2;
char *s = name;
if (!fd) sprintf(s = toybuf, "/proc/self/fd/%d", fd);
- if (xnotify_add(TT.not, fd, s)) perror_exit("-f on '%s' failed", s);
+ TT.files[f++] = fd;
+ if (0 > (TT.files[f] = inotify_add_watch(TT.ffd, s, IN_MODIFY)))
+ perror_msg("bad -f on '%s'", name);
}
if (TT.file_no++) xputc('\n');
- TT.last_fd = fd;
if (toys.optc > 1) xprintf("==> %s <==\n", name);
// Are we measuring from the end of the file?
@@ -147,7 +156,7 @@ static void do_tail(int fd, char *name)
// The slow codepath is always needed, and can handle all input,
// so make lseek support optional.
- if (try_lseek(fd, bytes, lines)) return;
+ if (CFG_TAIL_SEEK && try_lseek(fd, bytes, lines)) return;
// Read data until we run out, keep a trailing buffer
for (;;) {
@@ -227,19 +236,29 @@ void tail_main(void)
}
}
- if (FLAG(f)) TT.not = xnotify_init(toys.optc);
+ // Allocate 2 ints per optarg for -f
+ if (FLAG(f)) {
+ if ((TT.ffd = inotify_init()) < 0) perror_exit("inotify_init");
+ TT.files = xmalloc(toys.optc*8);
+ }
loopfiles_rw(args, O_RDONLY|WARN_ONLY|(O_CLOEXEC*!FLAG(f)), 0, do_tail);
if (FLAG(f) && TT.file_no) {
+ int len, last_fd = TT.files[(TT.file_no-1)*2], i, fd;
+ struct inotify_event ev;
+
for (;;) {
- char *path;
- int fd = xnotify_wait(TT.not, &path), len;
+ if (sizeof(ev)!=read(TT.ffd, &ev, sizeof(ev))) perror_exit("inotify");
+
+ for (i = 0; i<TT.file_no && ev.wd!=TT.files[(i*2)+1]; i++);
+ if (i==TT.file_no) continue;
+ fd = TT.files[i*2];
// Read new data.
while ((len = read(fd, toybuf, sizeof(toybuf)))>0) {
- if (TT.last_fd != fd) {
- TT.last_fd = fd;
- xprintf("\n==> %s <==\n", path);
+ if (last_fd != fd) {
+ last_fd = fd;
+ xprintf("\n==> %s <==\n", args[i]);
}
xwrite(1, toybuf, len);
diff --git a/toys/posix/tar.c b/toys/posix/tar.c
deleted file mode 100644
index 78ff9a1e..00000000
--- a/toys/posix/tar.c
+++ /dev/null
@@ -1,949 +0,0 @@
-/* tar.c - create/extract archives
- *
- * Copyright 2014 Ashwini Kumar <ak.ashwini81@gmail.com>
- *
- * For the command, see
- * http://pubs.opengroup.org/onlinepubs/007908799/xcu/tar.html
- * For the modern file format, see
- * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06
- * https://en.wikipedia.org/wiki/Tar_(computing)#File_format
- * https://www.gnu.org/software/tar/manual/html_node/Tar-Internals.html
- *
- * For writing to external program
- * http://www.gnu.org/software/tar/manual/html_node/Writing-to-an-External-Program.html
- *
- * Toybox will never implement the "pax" command as a matter of policy.
- *
- * Why --exclude pattern but no --include? tar cvzf a.tgz dir --include '*.txt'
- *
-
-USE_TAR(NEWTOY(tar, "&(restrict)(full-time)(no-recursion)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(mode):(mtime):(group):(owner):(to-command):o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)m(touch)X(exclude-from)*T(files-from)*C(directory):f(file):a[!txc][!jzJa]", TOYFLAG_USR|TOYFLAG_BIN))
-
-config TAR
- bool "tar"
- default y
- help
- usage: tar [-cxt] [-fvohmjkOS] [-XTCf NAME] [FILES]
-
- Create, extract, or list files in a .tar (or compressed t?z) file.
-
- Options:
- c Create x Extract t Test (list)
- f tar FILE (default -) C Change to DIR first v Verbose display
- o Ignore owner h Follow symlinks m Ignore mtime
- J xz compression j bzip2 compression z gzip compression
- O Extract to stdout X exclude names in FILE T include names in FILE
-
- --exclude FILENAME to exclude --full-time Show seconds with -tv
- --mode MODE Adjust modes --mtime TIME Override timestamps
- --owner NAME Set file owner to NAME --group NAME Set file group to NAME
- --sparse Record sparse files
- --restrict All archive contents must extract under one subdirctory
- --numeric-owner Save/use/display uid and gid, not user/group name
- --no-recursion Don't store directory contents
-*/
-
-#define FOR_tar
-#include "toys.h"
-
-GLOBALS(
- char *f, *C;
- struct arg_list *T, *X;
- char *to_command, *owner, *group, *mtime, *mode;
- struct arg_list *exclude;
-
- struct double_list *incl, *excl, *seen;
- struct string_list *dirs;
- char *cwd;
- int fd, ouid, ggid, hlc, warn, adev, aino, sparselen;
- long long *sparse;
- time_t mtt;
-
- // hardlinks seen so far (hlc many)
- struct {
- char *arg;
- ino_t ino;
- dev_t dev;
- } *hlx;
-
- // Parsed information about a tar header.
- struct tar_header {
- char *name, *link_target, *uname, *gname;
- long long size, ssize;
- uid_t uid;
- gid_t gid;
- mode_t mode;
- time_t mtime;
- dev_t device;
- } hdr;
-)
-
-struct tar_hdr {
- char name[100], mode[8], uid[8], gid[8],size[12], mtime[12], chksum[8],
- type, link[100], magic[8], uname[32], gname[32], major[8], minor[8],
- prefix[155], padd[12];
-};
-
-// convert from int to octal (or base-256)
-static void itoo(char *str, int len, unsigned long long val)
-{
- // Do we need binary encoding?
- if (!(val>>(3*(len-1)))) sprintf(str, "%0*llo", len-1, val);
- else {
- *str = 128;
- while (--len) *++str = val>>(3*len);
- }
-}
-#define ITOO(x, y) itoo(x, sizeof(x), y)
-
-// convert octal (or base-256) to int
-static unsigned long long otoi(char *str, unsigned len)
-{
- unsigned long long val = 0;
-
- // When tar value too big or octal, use binary encoding with high bit set
- if (128&*str) while (--len) val = (val<<8)+*++str;
- else {
- while (len && *str == ' ') str++;
- while (len && *str>='0' && *str<='7') val = val*8+*str++-'0', len--;
- if (len && *str && *str != ' ') error_exit("bad header");
- }
-
- return val;
-}
-#define OTOI(x) otoi(x, sizeof(x))
-
-static void write_longname(char *name, char type)
-{
- struct tar_hdr tmp;
- int sz = strlen(name) +1;
-
- memset(&tmp, 0, sizeof(tmp));
- strcpy(tmp.name, "././@LongLink");
- ITOO(tmp.uid, 0);
- ITOO(tmp.gid, 0);
- ITOO(tmp.size, sz);
- ITOO(tmp.mtime, 0);
- tmp.type = type;
- strcpy(tmp.magic, "ustar ");
-
- // Historical nonsense to match other implementations. Never used.
- ITOO(tmp.mode, 0644);
- strcpy(tmp.uname, "root");
- strcpy(tmp.gname, "root");
-
- // Calculate checksum. Since 512*255 = 0377000 in octal, this can never
- // use more than 6 digits. The last byte is ' ' for historical reasons.
- itoo(tmp.chksum, sizeof(tmp.chksum)-1, tar_cksum(&tmp));
- tmp.chksum[7] = ' ';
-
- // write header and name, padded with NUL to block size
- xwrite(TT.fd, &tmp, 512);
- xwrite(TT.fd, name, sz);
- if (sz%512) xwrite(TT.fd, toybuf, 512-(sz%512));
-}
-
-static struct double_list *filter(struct double_list *lst, char *name)
-{
- struct double_list *end = lst;
-
- if (lst)
- // constant is FNM_LEADING_DIR
- do if (!fnmatch(lst->data, name, 1<<3)) return lst;
- while (end != (lst = lst->next));
-
- return 0;
-}
-
-static void skippy(long long len)
-{
- if (lskip(TT.fd, len)) perror_exit("EOF");
-}
-
-// allocate and read data from TT.fd
-static void alloread(void *buf, int len)
-{
- // actually void **, but automatic typecasting doesn't work with void ** :(
- void **b = buf;
-
- free(*b);
- *b = xmalloc(len+1);
- xreadall(TT.fd, *b, len);
- b[len] = 0;
-}
-
-// callback from dirtree to create archive
-static int add_to_tar(struct dirtree *node)
-{
- struct stat *st = &(node->st);
- struct tar_hdr hdr;
- struct passwd *pw = pw;
- struct group *gr = gr;
- int i, fd =-1;
- char *name, *lnk, *hname;
-
- if (!dirtree_notdotdot(node)) return 0;
- if (TT.adev == st->st_dev && TT.aino == st->st_ino) {
- error_msg("'%s' file is the archive; not dumped", node->name);
- return 0;
- }
-
- i = 1;
- name = dirtree_path(node, &i);
-
- // exclusion defaults to --no-anchored and --wildcards-match-slash
- for (lnk = name; *lnk;) {
- if (filter(TT.excl, lnk)) goto done;
- while (*lnk && *lnk!='/') lnk++;
- while (*lnk=='/') lnk++;
- }
-
- // Consume the 1 extra byte alocated in dirtree_path()
- if (S_ISDIR(st->st_mode) && name[i-1] != '/') strcat(name, "/");
-
- // remove leading / and any .. entries from saved name
- for (hname = name; *hname == '/'; hname++);
- for (lnk = hname;;) {
- if (!(lnk = strstr(lnk, ".."))) break;
- if (lnk == hname || lnk[-1] == '/') {
- if (!lnk[2]) goto done;
- if (lnk[2]=='/') lnk = hname = lnk+3;
- } else lnk+= 2;
- }
- if (!*hname) goto done;
-
- if (TT.warn && hname != name) {
- fprintf(stderr, "removing leading '%.*s' from member names\n",
- (int)(hname-name), name);
- TT.warn = 0;
- }
-
- if (TT.owner) st->st_uid = TT.ouid;
- if (TT.group) st->st_gid = TT.ggid;
- if (TT.mode) st->st_mode = string_to_mode(TT.mode, st->st_mode);
- if (TT.mtime) st->st_mtime = TT.mtt;
-
- memset(&hdr, 0, sizeof(hdr));
- strncpy(hdr.name, hname, sizeof(hdr.name));
- ITOO(hdr.mode, st->st_mode &07777);
- ITOO(hdr.uid, st->st_uid);
- ITOO(hdr.gid, st->st_gid);
- ITOO(hdr.size, 0); //set size later
- ITOO(hdr.mtime, st->st_mtime);
- strcpy(hdr.magic, "ustar ");
-
- // Hard link or symlink? i=0 neither, i=1 hardlink, i=2 symlink
-
- // Are there hardlinks to a non-directory entry?
- if (st->st_nlink>1 && !S_ISDIR(st->st_mode)) {
- // Have we seen this dev&ino before?
- for (i = 0; i<TT.hlc; i++) {
- if (st->st_ino == TT.hlx[i].ino && st->st_dev == TT.hlx[i].dev)
- break;
- }
- if (i != TT.hlc) {
- lnk = TT.hlx[i].arg;
- i = 1;
- } else {
- // first time we've seen it. Store as normal file, but remember it.
- if (!(TT.hlc&255)) TT.hlx = xrealloc(TT.hlx, TT.hlc+256);
- TT.hlx[TT.hlc].arg = xstrdup(hname);
- TT.hlx[TT.hlc].ino = st->st_ino;
- TT.hlx[TT.hlc].dev = st->st_dev;
- TT.hlc++;
- i = 0;
- }
- } else i = 0;
-
- // !i because hardlink to a symlink is a thing.
- if (!i && S_ISLNK(st->st_mode)) {
- i = 2;
- lnk = xreadlink(name);
- }
-
- // Handle file types
- if (i) {
- hdr.type = '0'+i;
- if (i==2 && !(lnk = xreadlink(name))) {
- perror_msg("readlink");
- goto done;
- }
- if (strlen(lnk) > sizeof(hdr.link)) write_longname(lnk, 'K');
- strncpy(hdr.link, lnk, sizeof(hdr.link));
- if (i) free(lnk);
- } else if (S_ISREG(st->st_mode)) {
- hdr.type = '0';
- ITOO(hdr.size, st->st_size);
- } else if (S_ISDIR(st->st_mode)) hdr.type = '5';
- else if (S_ISFIFO(st->st_mode)) hdr.type = '6';
- else if (S_ISBLK(st->st_mode) || S_ISCHR(st->st_mode)) {
- hdr.type = (S_ISCHR(st->st_mode))?'3':'4';
- ITOO(hdr.major, dev_major(st->st_rdev));
- ITOO(hdr.minor, dev_minor(st->st_rdev));
- } else {
- error_msg("unknown file type '%o'", st->st_mode & S_IFMT);
- goto done;
- }
-
- if (strlen(hname) > sizeof(hdr.name)) write_longname(hname, 'L');
-
- if (!FLAG(numeric_owner)) {
- if (TT.owner || (pw = bufgetpwuid(st->st_uid)))
- strncpy(hdr.uname, TT.owner ? TT.owner : pw->pw_name, sizeof(hdr.uname));
- if (TT.group || (gr = bufgetgrgid(st->st_gid)))
- strncpy(hdr.gname, TT.group ? TT.group : gr->gr_name, sizeof(hdr.gname));
- }
-
- TT.sparselen = 0;
- if (hdr.type == '0') {
- // Before we write the header, make sure we can read the file
- if ((fd = open(name, O_RDONLY)) < 0) {
- perror_msg("can't open '%s'", name);
-
- return 0;
- }
- if (FLAG(S)) {
- long long lo, ld = 0, len = 0;
-
- // Enumerate the extents
- while ((lo = lseek(fd, ld, SEEK_HOLE)) != -1) {
- if (!(TT.sparselen&511))
- TT.sparse = xrealloc(TT.sparse, (TT.sparselen+514)*sizeof(long long));
- if (ld != lo) {
- TT.sparse[TT.sparselen++] = ld;
- len += TT.sparse[TT.sparselen++] = lo-ld;
- }
- if (lo == st->st_size || (ld = lseek(fd, lo, SEEK_DATA)) < lo) break;
- }
-
- // If there were extents, change type to S record
- if (TT.sparselen>2) {
- TT.sparse[TT.sparselen++] = st->st_size;
- TT.sparse[TT.sparselen++] = 0;
- hdr.type = 'S';
- lnk = (char *)&hdr;
- for (i = 0; i<TT.sparselen && i<8; i++)
- itoo(lnk+386+12*i, 12, TT.sparse[i]);
-
- // Record if there's overflow records, change length to sparse length,
- // record apparent length
- if (TT.sparselen>8) lnk[482] = 1;
- itoo(lnk+483, 12, st->st_size);
- ITOO(hdr.size, len);
- } else TT.sparselen = 0;
- lseek(fd, 0, SEEK_SET);
- }
- }
-
- itoo(hdr.chksum, sizeof(hdr.chksum)-1, tar_cksum(&hdr));
- hdr.chksum[7] = ' ';
-
- if (FLAG(v)) dprintf(TT.fd ? 2 : 1, "%s\n", hname);
-
- // Write header and data to archive
- xwrite(TT.fd, &hdr, 512);
- if (TT.sparselen>8) {
- char buf[512];
-
- // write extent overflow blocks
- for (i=8;;i++) {
- int j = (i-8)%42;
-
- if (!j || i==TT.sparselen) {
- if (i!=8) {
- if (i!=TT.sparselen) buf[504] = 1;
- xwrite(TT.fd, buf, 512);
- }
- if (i==TT.sparselen) break;
- memset(buf, 0, sizeof(buf));
- }
- itoo(buf+12*j, 12, TT.sparse[i]);
- }
- }
- TT.sparselen >>= 1;
- if (hdr.type == '0' || hdr.type == 'S') {
- if (hdr.type == '0') xsendfile_pad(fd, TT.fd, st->st_size);
- else for (i = 0; i<TT.sparselen; i++) {
- if (TT.sparse[i*2] != lseek(fd, TT.sparse[i*2], SEEK_SET))
- perror_msg("%s: seek %lld", name, TT.sparse[i*2]);
- xsendfile_pad(fd, TT.fd, TT.sparse[i*2+1]);
- }
- if (st->st_size%512) writeall(TT.fd, toybuf, (512-(st->st_size%512)));
- close(fd);
- }
-done:
- free(name);
-
- return (DIRTREE_RECURSE|(FLAG(h)?DIRTREE_SYMFOLLOW:0))*!FLAG(no_recursion);
-}
-
-static void wsettime(char *s, long long sec)
-{
- struct timespec times[2] = {{sec, 0},{sec, 0}};
-
- if (utimensat(AT_FDCWD, s, times, AT_SYMLINK_NOFOLLOW))
- perror_msg("settime %lld %s", sec, s);
-}
-
-// Do pending directory utimes(), NULL to flush all.
-static int dirflush(char *name)
-{
- char *s = 0, *ss;
-
- // Barf if name not in TT.cwd
- if (name) {
- ss = s = xabspath(name, -1);
- if (TT.cwd[1] && (!strstart(&ss, TT.cwd) || *ss!='/')) {
- error_msg("'%s' not under '%s'", name, TT.cwd);
- free(s);
-
- return 1;
- }
-
- if (FLAG(restrict)) {
- free(TT.cwd);
- TT.cwd = strdup(s);
- toys.optflags ^= FLAG_restrict;
- }
- }
-
- // Set deferred utimes() for directories this file isn't under.
- // (Files must be depth-first ordered in tarball for this to matter.)
- while (TT.dirs) {
-
- // If next file is under (or equal to) this dir, keep waiting
- if (name && strstart(&ss, ss = s) && (!*ss || *ss=='/')) break;
-
- wsettime(TT.dirs->str+sizeof(long long), *(long long *)TT.dirs->str);
- free(llist_pop(&TT.dirs));
- }
- free(s);
-
- // name was under TT.cwd
- return 0;
-}
-
-// write data to file
-static void sendfile_sparse(int fd)
-{
- long long len, used = 0, sent;
- int i = 0, j;
-
- do {
- if (TT.sparselen) {
- // Seek past holes or fill output with zeroes.
- if (-1 == lseek(fd, len = TT.sparse[i*2], SEEK_SET)) {
- sent = 0;
- while (len) {
- // first/last 512 bytes used, rest left zeroes
- j = (len>3072) ? 3072 : len;
- if (j != writeall(fd, toybuf+512, j)) goto error;
- len -= j;
- }
- } else {
- sent = len;
- if (!(len = TT.sparse[i*2+1]) && ftruncate(fd, sent+len))
- perror_msg("ftruncate");
- }
- if (len+used>TT.hdr.size) error_exit("sparse overflow");
- } else len = TT.hdr.size;
-
- len -= sendfile_len(TT.fd, fd, len, &sent);
- used += sent;
- if (len) {
-error:
- if (fd!=1) perror_msg(0);
- skippy(TT.hdr.size-used);
-
- break;
- }
- } while (++i<TT.sparselen);
-
- close(fd);
-}
-
-static void extract_to_disk(void)
-{
- char *name = TT.hdr.name;
- int ala = TT.hdr.mode;
-
- if (dirflush(name)) {
- if (S_ISREG(ala) && !TT.hdr.link_target) skippy(TT.hdr.size);
-
- return;
- }
-
- // create path before file if necessary
- if (strrchr(name, '/') && mkpath(name) && errno !=EEXIST)
- return perror_msg(":%s: can't mkdir", name);
-
- // remove old file, if exists
- if (!FLAG(k) && !S_ISDIR(ala) && unlink(name) && errno!=ENOENT)
- return perror_msg("can't remove: %s", name);
-
- if (S_ISREG(ala)) {
- // hardlink?
- if (TT.hdr.link_target) {
- if (link(TT.hdr.link_target, name))
- return perror_msg("can't link '%s' -> '%s'", name, TT.hdr.link_target);
- // write contents
- } else {
- int fd = xcreate(name, O_WRONLY|O_CREAT|(FLAG(overwrite)?O_TRUNC:O_EXCL),
- WARN_ONLY|(ala & 07777));
- if (fd != -1) sendfile_sparse(fd);
- else skippy(TT.hdr.size);
- }
- } else if (S_ISDIR(ala)) {
- if ((mkdir(name, 0700) == -1) && errno != EEXIST)
- return perror_msg("%s: can't create", TT.hdr.name);
- } else if (S_ISLNK(ala)) {
- if (symlink(TT.hdr.link_target, TT.hdr.name))
- return perror_msg("can't link '%s' -> '%s'", name, TT.hdr.link_target);
- } else if (mknod(name, ala, TT.hdr.device))
- return perror_msg("can't create '%s'", name);
-
- // Set ownership
- if (!FLAG(o) && !geteuid()) {
- int u = TT.hdr.uid, g = TT.hdr.gid;
-
- if (TT.owner) TT.hdr.uid = TT.ouid;
- else if (!FLAG(numeric_owner) && *TT.hdr.uname) {
- struct passwd *pw = getpwnam(TT.hdr.uname);
- if (pw && (TT.owner || !FLAG(numeric_owner))) TT.hdr.uid = pw->pw_uid;
- }
-
- if (TT.group) TT.hdr.gid = TT.ggid;
- else if (!FLAG(numeric_owner) && *TT.hdr.uname) {
- struct group *gr = getgrnam(TT.hdr.gname);
- if (gr) TT.hdr.gid = gr->gr_gid;
- }
-
- if (lchown(name, u, g)) perror_msg("chown %d:%d '%s'", u, g, name);;
- }
-
- if (!S_ISLNK(ala)) chmod(TT.hdr.name, FLAG(p) ? ala : ala&0777);
-
- // Apply mtime.
- if (!FLAG(m)) {
- if (S_ISDIR(ala)) {
- struct string_list *sl;
-
- // Writing files into a directory changes directory timestamps, so
- // defer mtime updates until contents written.
-
- sl = xmalloc(sizeof(struct string_list)+sizeof(long long)+strlen(name)+1);
- *(long long *)sl->str = TT.hdr.mtime;
- strcpy(sl->str+sizeof(long long), name);
- sl->next = TT.dirs;
- TT.dirs = sl;
- } else wsettime(TT.hdr.name, TT.hdr.mtime);
- }
-}
-
-static void unpack_tar(char *first)
-{
- struct double_list *walk, *delete;
- struct tar_hdr tar;
- int i, and = 0;
- unsigned maj, min;
- char *s;
-
- for (;;) {
- if (first) {
- memcpy(&tar, first, i = 512);
- first = 0;
- } else {
- // align to next block and read it
- if (TT.hdr.size%512) skippy(512-TT.hdr.size%512);
- i = readall(TT.fd, &tar, 512);
- }
-
- if (i && i!=512) error_exit("short header");
-
- // Two consecutive empty headers ends tar even if there's more data
- if (!i || !*tar.name) {
- if (!i || and++) return;
- TT.hdr.size = 0;
- continue;
- }
- // ensure null temination even of pathological packets
- tar.padd[0] = and = 0;
-
- // Is this a valid TAR header?
- if (!is_tar_header(&tar)) error_exit("bad header");
- TT.hdr.size = OTOI(tar.size);
-
- // If this header isn't writing something to the filesystem
- if ((tar.type<'0' || tar.type>'7') && tar.type!='S'
- && (*tar.magic && tar.type))
- {
- // Long name extension header?
- if (tar.type == 'K') alloread(&TT.hdr.link_target, TT.hdr.size);
- else if (tar.type == 'L') alloread(&TT.hdr.name, TT.hdr.size);
- else if (tar.type == 'x') {
- char *p, *buf = 0;
- int i, len, n;
-
- // Posix extended record "LEN NAME=VALUE\n" format
- alloread(&buf, TT.hdr.size);
- for (p = buf; (p-buf)<TT.hdr.size; p += len) {
- i = sscanf(p, "%u path=%n", &len, &n);
- if (i<1 || len<4 || len>TT.hdr.size) {
- error_msg("bad header");
- break;
- }
- p[len-1] = 0;
- if (i == 2) {
- TT.hdr.name = xstrdup(p+n);
- break;
- }
- }
- free(buf);
-
- // Ignore everything else.
- } else skippy(TT.hdr.size);
-
- continue;
- }
-
- // Handle sparse file type
- if (tar.type == 'S') {
- char sparse[512];
- int max = 8;
-
- // Load 4 pairs of offset/len from S block, plus 21 pairs from each
- // continuation block, list says where to seek/write sparse file contents
- TT.sparselen = 0;
- s = 386+(char *)&tar;
- *sparse = i = 0;
-
- for (;;) {
- if (!(TT.sparselen&511))
- TT.sparse = xrealloc(TT.sparse, (TT.sparselen+512)*sizeof(long long));
-
- // If out of data in block check continue flag, stop or load next block
- if (++i>max || !*s) {
- if (!(*sparse ? sparse[504] : ((char *)&tar)[482])) break;
- xreadall(TT.fd, s = sparse, 512);
- max = 41;
- i = 0;
- }
- // Load next entry
- TT.sparse[TT.sparselen++] = otoi(s, 12);
- s += 12;
- }
-
- // Odd number of entries (from corrupted tar) would be dropped here
- TT.sparselen /= 2;
- if (TT.sparselen)
- TT.hdr.ssize = TT.sparse[2*TT.sparselen-1]+TT.sparse[2*TT.sparselen-2];
- } else {
- TT.sparselen = 0;
- TT.hdr.ssize = TT.hdr.size;
- }
-
- // At this point, we have something to output. Convert metadata.
- TT.hdr.mode = OTOI(tar.mode)&0xfff;
- if (tar.type == 'S' || !tar.type) TT.hdr.mode |= 0x8000;
- else TT.hdr.mode |= (char []){8,8,10,2,6,4,1,8}[tar.type-'0']<<12;
- TT.hdr.uid = OTOI(tar.uid);
- TT.hdr.gid = OTOI(tar.gid);
- TT.hdr.mtime = OTOI(tar.mtime);
- maj = OTOI(tar.major);
- min = OTOI(tar.minor);
- TT.hdr.device = dev_makedev(maj, min);
- TT.hdr.uname = xstrndup(TT.owner ? TT.owner : tar.uname, sizeof(tar.uname));
- TT.hdr.gname = xstrndup(TT.group ? TT.group : tar.gname, sizeof(tar.gname));
-
- if (TT.owner) TT.hdr.uid = TT.ouid;
- else if (!FLAG(numeric_owner)) {
- struct passwd *pw = getpwnam(TT.hdr.uname);
- if (pw && (TT.owner || !FLAG(numeric_owner))) TT.hdr.uid = pw->pw_uid;
- }
-
- if (TT.group) TT.hdr.gid = TT.ggid;
- else if (!FLAG(numeric_owner)) {
- struct group *gr = getgrnam(TT.hdr.gname);
- if (gr) TT.hdr.gid = gr->gr_gid;
- }
-
- if (!TT.hdr.link_target && *tar.link)
- TT.hdr.link_target = xstrndup(tar.link, sizeof(tar.link));
- if (!TT.hdr.name) {
- // Glue prefix and name fields together with / if necessary
- i = (tar.type=='S') ? 0 : strnlen(tar.prefix, sizeof(tar.prefix));
- TT.hdr.name = xmprintf("%.*s%s%.*s", i, tar.prefix,
- (i && tar.prefix[i-1] != '/') ? "/" : "",
- (int)sizeof(tar.name), tar.name);
- }
-
- // Old broken tar recorded dir as "file with trailing slash"
- if (S_ISREG(TT.hdr.mode) && (s = strend(TT.hdr.name, "/"))) {
- *s = 0;
- TT.hdr.mode = (TT.hdr.mode & ~S_IFMT) | S_IFDIR;
- }
-
- // Non-regular files don't have contents stored in archive.
- if ((TT.hdr.link_target && *TT.hdr.link_target)
- || (tar.type && !S_ISREG(TT.hdr.mode)))
- TT.hdr.size = 0;
-
- // Files are seen even if excluded, so check them here.
- // TT.seen points to first seen entry in TT.incl, or NULL if none yet.
-
- if ((delete = filter(TT.incl, TT.hdr.name)) && TT.incl != TT.seen) {
- if (!TT.seen) TT.seen = delete;
-
- // Move seen entry to end of list.
- if (TT.incl == delete) TT.incl = TT.incl->next;
- else for (walk = TT.incl; walk != TT.seen; walk = walk->next) {
- if (walk == delete) {
- dlist_pop(&walk);
- dlist_add_nomalloc(&TT.incl, delete);
- }
- }
- }
-
- // Skip excluded files
- if (filter(TT.excl, TT.hdr.name) || (TT.incl && !delete))
- skippy(TT.hdr.size);
- else if (FLAG(t)) {
- if (FLAG(v)) {
- struct tm *lc = localtime(TT.mtime ? &TT.mtt : &TT.hdr.mtime);
- char perm[12], gname[12];
-
- mode_to_string(TT.hdr.mode, perm);
- printf("%s", perm);
- sprintf(perm, "%u", TT.hdr.uid);
- sprintf(gname, "%u", TT.hdr.gid);
- printf(" %s/%s ", *TT.hdr.uname ? TT.hdr.uname : perm,
- *TT.hdr.gname ? TT.hdr.gname : gname);
- if (tar.type=='3' || tar.type=='4') printf("%u,%u", maj, min);
- else printf("%9lld", TT.hdr.ssize);
- sprintf(perm, ":%02d", lc->tm_sec);
- printf(" %d-%02d-%02d %02d:%02d%s ", 1900+lc->tm_year, 1+lc->tm_mon,
- lc->tm_mday, lc->tm_hour, lc->tm_min, FLAG(full_time) ? perm : "");
- }
- printf("%s", TT.hdr.name);
- if (TT.hdr.link_target) printf(" -> %s", TT.hdr.link_target);
- xputc('\n');
- skippy(TT.hdr.size);
- } else {
- if (FLAG(v)) printf("%s\n", TT.hdr.name);
- if (FLAG(O)) sendfile_sparse(1);
- else if (FLAG(to_command)) {
- if (S_ISREG(TT.hdr.mode)) {
- int fd, pid;
-
- xsetenv("TAR_FILETYPE", "f");
- xsetenv(xmprintf("TAR_MODE=%o", TT.hdr.mode), 0);
- xsetenv(xmprintf("TAR_SIZE=%lld", TT.hdr.ssize), 0);
- xsetenv("TAR_FILENAME", TT.hdr.name);
- xsetenv("TAR_UNAME", TT.hdr.uname);
- xsetenv("TAR_GNAME", TT.hdr.gname);
- xsetenv(xmprintf("TAR_MTIME=%llo", (long long)TT.hdr.mtime), 0);
- xsetenv(xmprintf("TAR_UID=%o", TT.hdr.uid), 0);
- xsetenv(xmprintf("TAR_GID=%o", TT.hdr.gid), 0);
-
- pid = xpopen((char *[]){"sh", "-c", TT.to_command, NULL}, &fd, 0);
- // todo: short write exits tar here, other skips data.
- sendfile_sparse(fd);
- fd = xpclose_both(pid, 0);
- if (fd) error_msg("%d: Child returned %d", pid, fd);
- }
- } else extract_to_disk();
- }
-
- free(TT.hdr.name);
- free(TT.hdr.link_target);
- free(TT.hdr.uname);
- free(TT.hdr.gname);
- TT.hdr.name = TT.hdr.link_target = 0;
- }
-}
-
-// Add copy of filename (minus trailing \n and /) to dlist **
-static void trim2list(void *list, char *pline)
-{
- char *n = xstrdup(pline);
- int i = strlen(n);
-
- dlist_add(list, n);
- if (i && n[i-1]=='\n') i--;
- while (i && n[i-1] == '/') i--;
- n[i] = 0;
-}
-
-// do_lines callback, selects TT.incl or TT.excl based on call order
-static void do_XT(char **pline, long len)
-{
- if (pline) trim2list(TT.X ? &TT.excl : &TT.incl, *pline);
-}
-
-void tar_main(void)
-{
- char *s, **args = toys.optargs,
- *archiver = FLAG(z) ? "gzip" : (FLAG(J) ? "xz" : "bzip2");
- int len = 0;
-
- // Needed when extracting to command
- signal(SIGPIPE, SIG_IGN);
-
- // Get possible early errors out of the way
- if (!geteuid()) toys.optflags |= FLAG_p;
- if (TT.owner) TT.ouid = xgetuid(TT.owner);
- if (TT.group) TT.ggid = xgetgid(TT.group);
- if (TT.mtime) xparsedate(TT.mtime, &TT.mtt, (void *)&s, 1);
-
- // Collect file list.
- for (; TT.exclude; TT.exclude = TT.exclude->next)
- trim2list(&TT.excl, TT.exclude->arg);
- for (;TT.X; TT.X = TT.X->next) do_lines(xopenro(TT.X->arg), '\n', do_XT);
- for (args = toys.optargs; *args; args++) trim2list(&TT.incl, *args);
- for (;TT.T; TT.T = TT.T->next) do_lines(xopenro(TT.T->arg), '\n', do_XT);
-
- // If include file list empty, don't create empty archive
- if (FLAG(c)) {
- if (!TT.incl) error_exit("empty archive");
- TT.fd = 1;
- }
-
- // nommu reentry for nonseekable input skips this, parent did it for us
- if (toys.stacktop) {
- if (TT.f && strcmp(TT.f, "-"))
- TT.fd = xcreate(TT.f, TT.fd*(O_WRONLY|O_CREAT|O_TRUNC), 0666);
- // Get destination directory
- if (TT.C) xchdir(TT.C);
- }
-
- // Get destination directory
- TT.cwd = xabspath(s = xgetcwd(), 1);
- free(s);
-
- // Remember archive inode so we don't overwrite it or add it to itself
- {
- struct stat st;
-
- if (!fstat(TT.fd, &st)) {
- TT.aino = st.st_ino;
- TT.adev = st.st_dev;
- }
- }
-
- // Are we reading?
- if (FLAG(x)||FLAG(t)) {
- char *hdr = 0;
-
- // autodetect compression type when not specified
- if (!(FLAG(j)||FLAG(z)||FLAG(J))) {
- len = xread(TT.fd, hdr = toybuf+sizeof(toybuf)-512, 512);
- if (len!=512 || !is_tar_header(hdr)) {
- // detect gzip and bzip signatures
- if (SWAP_BE16(*(short *)hdr)==0x1f8b) toys.optflags |= FLAG_z;
- else if (!memcmp(hdr, "BZh", 3)) toys.optflags |= FLAG_j;
- else if (peek_be(hdr, 7) == 0xfd377a585a0000) toys.optflags |= FLAG_J;
- else error_exit("Not tar");
-
- // if we can seek back we don't need to loop and copy data
- if (!lseek(TT.fd, -len, SEEK_CUR)) hdr = 0;
- }
- }
-
- if (FLAG(j)||FLAG(z)||FLAG(J)) {
- int pipefd[2] = {hdr ? -1 : TT.fd, -1}, i, pid;
- struct string_list *zcat = find_in_path(getenv("PATH"),
- FLAG(j) ? "bzcat" : FLAG(J) ? "xzcat" : "zcat");
-
- // Toybox provides more decompressors than compressors, so try them first
- xpopen_both(zcat ? (char *[]){zcat->str, 0} :
- (char *[]){archiver, "-dc", 0}, pipefd);
- if (CFG_TOYBOX_FREE) llist_traverse(zcat, free);
-
- if (!hdr) {
- // If we could seek, child gzip inherited fd and we read its output
- close(TT.fd);
- TT.fd = pipefd[1];
-
- } else {
-
- // If we autodetected type but then couldn't lseek to put the data back
- // we have to loop reading data from TT.fd and pass it to gzip ourselves
- // (starting with the block of data we read to autodetect).
-
- // dirty trick: move gzip input pipe to stdin so child closes spare copy
- dup2(pipefd[0], 0);
- if (pipefd[0]) close(pipefd[0]);
-
- // Fork a copy of ourselves to handle extraction (reads from zip output
- // pipe, writes to stdout).
- pipefd[0] = pipefd[1];
- pipefd[1] = 1;
- pid = xpopen_both(0, pipefd);
- close(pipefd[1]);
-
- // loop writing collated data to zip proc
- xwrite(0, hdr, len);
- for (;;) {
- if ((i = read(TT.fd, toybuf, sizeof(toybuf)))<1) {
- close(0);
- xwaitpid(pid);
- return;
- }
- xwrite(0, toybuf, i);
- }
- }
- }
-
- unpack_tar(hdr);
- dirflush(0);
-
- // Each time a TT.incl entry is seen it's moved to the end of the list,
- // with TT.seen pointing to first seen list entry. Anything between
- // TT.incl and TT.seen wasn't encountered in archive..
- if (TT.seen != TT.incl) {
- if (!TT.seen) TT.seen = TT.incl;
- while (TT.incl != TT.seen) {
- error_msg("'%s' not in archive", TT.incl->data);
- TT.incl = TT.incl->next;
- }
- }
-
- // are we writing? (Don't have to test flag here, one of 3 must be set)
- } else {
- struct double_list *dl = TT.incl;
-
- // autodetect compression type based on -f name. (Use > to avoid.)
- if (TT.f && !FLAG(j) && !FLAG(z)) {
- char *tbz[] = {".tbz", ".tbz2", ".tar.bz", ".tar.bz2"};
- if (strend(TT.f, ".tgz") || strend(TT.f, ".tar.gz"))
- toys.optflags |= FLAG_z;
- if (strend(TT.f, ".txz") || strend(TT.f, ".tar.xz"))
- toys.optflags |= FLAG_J;
- else for (len = 0; len<ARRAY_LEN(tbz); len++)
- if (strend(TT.f, tbz[len])) toys.optflags |= FLAG_j;
- }
-
- if (FLAG(j)||FLAG(z)||FLAG(J)) {
- int pipefd[2] = {-1, TT.fd};
-
- xpopen_both((char *[]){archiver, "-f", 0}, pipefd);
- close(TT.fd);
- TT.fd = pipefd[0];
- }
- do {
- TT.warn = 1;
- dirtree_flagread(dl->data, FLAG(h)?DIRTREE_SYMFOLLOW:0, add_to_tar);
- } while (TT.incl != (dl = dl->next));
-
- writeall(TT.fd, toybuf, 1024);
- }
-
- if (CFG_TOYBOX_FREE) {
- llist_traverse(TT.excl, llist_free_double);
- llist_traverse(TT.incl, llist_free_double);
- while(TT.hlc) free(TT.hlx[--TT.hlc].arg);
- free(TT.hlx);
- free(TT.cwd);
- close(TT.fd);
- }
-}
diff --git a/toys/posix/test.c b/toys/posix/test.c
index 87a866a7..052b8deb 100644
--- a/toys/posix/test.c
+++ b/toys/posix/test.c
@@ -4,8 +4,7 @@
*
* See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
-USE_TEST(NEWTOY(test, 0, TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
-USE_TEST(OLDTOY([, test, TOYFLAG_NOFORK|TOYFLAG_NOHELP))
+USE_TEST(NEWTOY(test, 0, TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_NOHELP))
config TEST
bool "test"
diff --git a/toys/posix/time.c b/toys/posix/time.c
index f51a3b95..79a98676 100644
--- a/toys/posix/time.c
+++ b/toys/posix/time.c
@@ -55,7 +55,7 @@ void time_main(void)
"File system inputs: %ld\n"
"File system outputs: %ld\n"
"Voluntary context switches: %ld\n"
- "Involuntary context switches: %ld\n", r, s, u,
+ "Involuntary context switches: %ld\n", r, u, s,
ru.ru_maxrss, ru.ru_majflt, ru.ru_minflt, ru.ru_inblock,
ru.ru_oublock, ru.ru_nvcsw, ru.ru_nivcsw);
} else fprintf(stderr, "real %f\nuser %f\nsys %f\n", r, u, s);
diff --git a/toys/posix/uname.c b/toys/posix/uname.c
index d93fc7a3..a1338415 100644
--- a/toys/posix/uname.c
+++ b/toys/posix/uname.c
@@ -5,15 +5,6 @@
* See http://opengroup.org/onlinepubs/9699919799/utilities/uname.html
USE_UNAME(NEWTOY(uname, "oamvrns[+os]", TOYFLAG_BIN))
-USE_ARCH(NEWTOY(arch, 0, TOYFLAG_USR|TOYFLAG_BIN))
-
-config ARCH
- bool "arch"
- default y
- help
- usage: arch
-
- Print machine (hardware) name, same as uname -m.
config UNAME
bool "uname"
@@ -32,7 +23,6 @@ config UNAME
*/
#define FOR_uname
-#define FORCE_FLAGS
#include "toys.h"
// If a 32 bit x86 build environment working in a chroot under an x86-64
@@ -82,9 +72,3 @@ void uname_main(void)
}
putchar('\n');
}
-
-void arch_main(void)
-{
- toys.optflags = FLAG_m;
- uname_main();
-}
diff --git a/toys/posix/uudecode.c b/toys/posix/uudecode.c
index 4d87ce1c..220e43aa 100644
--- a/toys/posix/uudecode.c
+++ b/toys/posix/uudecode.c
@@ -26,19 +26,15 @@ GLOBALS(
void uudecode_main(void)
{
- FILE *ifp = stdin;
- int ofd, idx = 0, m = m, n;
- size_t allocated_length;
+ int ifd = 0, ofd, idx = 0, m = m;
char *line = 0, mode[16],
*class[] = {"begin%*[ ]%15s%*[ ]%n", "begin-base64%*[ ]%15s%*[ ]%n"};
- if (toys.optc) ifp = xfopen(*toys.optargs, "r");
+ if (toys.optc) ifd = xopenro(*toys.optargs);
while (!idx) {
- if ((n = getline(&line, &allocated_length, ifp)) == -1)
- error_exit("no begin line");
- if (!n) continue;
- line[n-1] = 0;
+ free(line);
+ if (!(line = get_line(ifd))) error_exit("bad EOF");
for (m=0; m < 2; m++) {
sscanf(line, class[m], mode, &idx);
if (idx) break;
@@ -49,12 +45,12 @@ void uudecode_main(void)
else ofd = xcreate(TT.o ? TT.o : line+idx, O_WRONLY|O_CREAT|O_TRUNC,
string_to_mode(mode, 0777^toys.old_umask));
- for (;;) {
+ for(;;) {
char *in, *out;
int olen;
- if (m == 2 || (n = getline(&line, &allocated_length, ifp)) == -1) break;
- if (n) line[n-1] = 0;
+ free(line);
+ if (m == 2 || !(line = get_line(ifd))) break;
if (!strcmp(line, m ? "====" : "end")) {
m = 2;
continue;
@@ -106,8 +102,7 @@ line_done:
}
if (CFG_TOYBOX_FREE) {
- if (ifp != stdin) fclose(ifp);
+ if (ifd) close(ifd);
close(ofd);
- free(line);
}
}
diff --git a/toys/posix/xargs.c b/toys/posix/xargs.c
index a8ecd4d6..9a3e9dae 100644
--- a/toys/posix/xargs.c
+++ b/toys/posix/xargs.c
@@ -5,12 +5,10 @@
* See http://opengroup.org/onlinepubs/9699919799/utilities/xargs.html
*
* TODO: Rich's whitespace objection, env size isn't fixed anymore.
- * TODO: -I Insert mode
- * TODO: -L Max number of lines of input per command
* TODO: -x Exit if can't fit everything in one command
- * TODO: -P NUM Run up to NUM processes at once
+ * TODO: -L Max number of lines of input per command
-USE_XARGS(NEWTOY(xargs, "^E:P#optrn#<1(max-args)s#0[!0E]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_XARGS(NEWTOY(xargs, "^I:E:ptrn#<1s#0[!0E]", TOYFLAG_USR|TOYFLAG_BIN))
config XARGS
bool "xargs"
@@ -20,32 +18,38 @@ config XARGS
Run command line one or more times, appending arguments from stdin.
- If COMMAND exits with 255, don't launch another even if arguments remain.
+ If command exits with 255, don't launch another even if arguments remain.
-0 Each argument is NULL terminated, no whitespace or quote processing
-E Stop at line matching string
-n Max number of arguments per command
- -o Open tty for COMMAND's stdin (default /dev/null)
-p Prompt for y/n from tty before running each command
- -r Don't run command with empty input (otherwise always run command once)
+ -r Don't run command with empty input
-s Size in bytes per command line
-t Trace, print command line to stderr
+
+config XARGS_PEDANTIC
+ bool "TODO xargs pedantic posix compatability"
+ default n
+ depends on XARGS
+ help
+ This version supports insane posix whitespace handling rendered obsolete
+ by -0 mode.
*/
#define FOR_xargs
#include "toys.h"
GLOBALS(
- long s, n, P;
- char *E;
+ long s, n;
+ char *E, *I;
long entries, bytes;
char delim;
- FILE *tty;
)
-// If !entry count TT.bytes and TT.entries, stopping at max.
-// Otherwise, fill out entry[].
+// If out==NULL count TT.bytes and TT.entries, stopping at max.
+// Otherwise, fill out out[]
// Returning NULL means need more data.
// Returning char * means hit data limits, start of data left over
@@ -55,57 +59,68 @@ GLOBALS(
static char *handle_entries(char *data, char **entry)
{
if (TT.delim) {
- char *save, *ss, *s;
+ char *s = data;
// Chop up whitespace delimited string into args
- for (s = data; *s; TT.entries++) {
- while (isspace(*s)) s++;
- if (TT.n && TT.entries >= TT.n) return *s ? s : (char *)1;
+ while (*s) {
+ char *save;
+
+ while (isspace(*s)) {
+ if (entry) *s = 0;
+ s++;
+ }
+
+ if (TT.n && TT.entries >= TT.n)
+ return *s ? s : (char *)1;
+
if (!*s) break;
- save = ss = s;
+ save = s;
- // We ought to add sizeof(char *) to TT.bytes to be correct, but we don't
- // for bug compatibility with busybox 1.30.1 and findutils 4.7.0.
+ TT.bytes += sizeof(char *);
for (;;) {
if (++TT.bytes >= TT.s && TT.s) return save;
if (!*s || isspace(*s)) break;
s++;
}
- if (TT.E && strstart(&ss, TT.E) && ss == s) return (char *)2;
- if (entry) {
- entry[TT.entries] = save;
- if (*s) *s++ = 0;
+ if (TT.E) {
+ int len = s-save;
+ if (len == strlen(TT.E) && !strncmp(save, TT.E, len))
+ return (char *)2;
}
+ if (entry) entry[TT.entries] = save;
+ ++TT.entries;
}
// -0 support
} else {
TT.bytes += sizeof(char *)+strlen(data)+1;
- if ((TT.s && TT.bytes >= TT.s) || (TT.n && TT.entries >= TT.n)) return data;
+ if (TT.s && TT.bytes >= TT.s) return data;
+ if (TT.n && TT.entries >= TT.n) return data;
if (entry) entry[TT.entries] = data;
TT.entries++;
}
- return 0;
+ return NULL;
}
void xargs_main(void)
{
- struct double_list *dlist = 0, *dtemp;
+ struct double_list *dlist = NULL, *dtemp;
int entries, bytes, done = 0, status;
- char *data = 0, **out;
- pid_t pid = 0;
+ char *data = NULL, **out;
+ pid_t pid;
+ long posix_max_bytes;
// POSIX requires that we never hit the ARG_MAX limit, even if we try to
// with -s. POSIX also says we have to reserve 2048 bytes "to guarantee
// that the invoked utility has room to modify its environment variables
// and command line arguments and still be able to invoke another utility",
// though obviously that's not really something you can guarantee.
- bytes = sysconf(_SC_ARG_MAX) - environ_bytes() - 2048;
- if (!TT.s || TT.s > bytes) TT.s = bytes;
+ posix_max_bytes = sysconf(_SC_ARG_MAX) - environ_bytes() - 2048;
+ if (!TT.s || TT.s > posix_max_bytes) TT.s = posix_max_bytes;
- TT.delim = '\n'*!FLAG(0);
+ if (!FLAG(0)) TT.delim = '\n';
// If no optargs, call echo.
if (!toys.optc) {
@@ -114,13 +129,13 @@ void xargs_main(void)
toys.optc = 1;
}
- // count entries
for (entries = 0, bytes = -1; entries < toys.optc; entries++, bytes++)
bytes += strlen(toys.optargs[entries]);
- if (bytes >= TT.s) error_exit("argument too long");
// Loop through exec chunks.
while (data || !done) {
+ int doit = 1;
+
TT.entries = 0;
TT.bytes = bytes;
@@ -129,9 +144,10 @@ void xargs_main(void)
// Read line
if (!data) {
- size_t l = 0;
+ ssize_t l = 0;
+ l = getdelim(&data, (size_t *)&l, TT.delim, stdin);
- if (getdelim(&data, &l, TT.delim, stdin)<0) {
+ if (l<0) {
data = 0;
done++;
break;
@@ -140,22 +156,23 @@ void xargs_main(void)
dlist_add(&dlist, data);
// Count data used
- if (!(data = handle_entries(data, 0))) continue;
+ data = handle_entries(data, NULL);
+ if (!data) continue;
if (data == (char *)2) done++;
- if ((unsigned long)data <= 2) data = 0;
+ if ((long)data <= 2) data = 0;
else data = xstrdup(data);
break;
}
- if (!TT.entries) {
- if (data) error_exit("argument too long");
- else if (pid) return;
- else if (FLAG(r)) continue;
- }
+ if (TT.entries == 0 && FLAG(r)) continue;
- // Fill out command line to exec
+ // Accumulate cally thing
+
+ if (data && !TT.entries) error_exit("argument too long");
out = xzalloc((entries+TT.entries+1)*sizeof(char *));
+
+ // Fill out command line to exec
memcpy(out, toys.optargs, entries*sizeof(char *));
TT.entries = 0;
TT.bytes = bytes;
@@ -169,35 +186,21 @@ void xargs_main(void)
for (i = 0; out[i]; ++i) fprintf(stderr, "%s ", out[i]);
if (FLAG(p)) {
fprintf(stderr, "?");
- if (!TT.tty) TT.tty = xfopen("/dev/tty", "re");
- if (!fyesno(TT.tty, 0)) goto skip;
+ doit = yesno(0);
} else fprintf(stderr, "\n");
}
- if (!(pid = XVFORK())) {
- close(0);
- xopen_stdio(FLAG(o) ? "/dev/tty" : "/dev/null", O_RDONLY);
- xexec(out);
- }
- waitpid(pid, &status, 0);
-
- // xargs is yet another weird collection of exit value special cases,
- // different from all the others.
- if (WIFEXITED(status)) {
- if (WEXITSTATUS(status) == 126 || WEXITSTATUS(status) == 127) {
- toys.exitval = WEXITSTATUS(status);
- return;
- } else if (WEXITSTATUS(status) >= 1 && WEXITSTATUS(status) <= 125) {
- toys.exitval = 123;
- } else if (WEXITSTATUS(status) == 255) {
- error_msg("%s: exited with status 255; aborting", out[0]);
- toys.exitval = 124;
- return;
+ if (doit) {
+ if (!(pid = XVFORK())) {
+ xclose(0);
+ open("/dev/null", O_RDONLY);
+ xexec(out);
}
- } else toys.exitval = 127;
+ waitpid(pid, &status, 0);
+ status = WIFEXITED(status) ? WEXITSTATUS(status) : WTERMSIG(status)+127;
+ }
// Abritrary number of execs, can't just leak memory each time...
-skip:
while (dlist) {
struct double_list *dtemp = dlist->next;
@@ -207,5 +210,4 @@ skip:
}
free(out);
}
- if (TT.tty) fclose(TT.tty);
}
diff --git a/www/0bsd-mckusick.txt b/www/0bsd-mckusick.txt
deleted file mode 100644
index 97f85e27..00000000
--- a/www/0bsd-mckusick.txt
+++ /dev/null
@@ -1,180 +0,0 @@
-From - Wed Oct 17 13:27:51 2018
-X-Account-Key: account1
-X-UIDL: GmailId166832be205bc2bd
-X-Mozilla-Status: 1013
-X-Mozilla-Status2: 00000000
-X-Mozilla-Keys:
-Delivered-To: rob@landley.net
-Received: by 2002:ab0:208c:0:0:0:0:0 with SMTP id r12csp943206uak;
- Wed, 17 Oct 2018 10:56:23 -0700 (PDT)
-X-Google-Smtp-Source: ACcGV61EHdCAKXqiC2g4VHKVIL9kgr4swWkJtL9r6jorwOeN6QWG09j9dd8vuBA2AqOxUrypnI88
-X-Received: by 2002:a17:902:16a4:: with SMTP id h33-v6mr26279849plh.3.1539798983448;
- Wed, 17 Oct 2018 10:56:23 -0700 (PDT)
-ARC-Seal: i=1; a=rsa-sha256; t=1539798983; cv=none;
- d=google.com; s=arc-20160816;
- b=E/rO76Tc0QzdNYVqa3mOrkhv21WxRyex6QvEcEw2ejkTXu3csi2hFDckupiXuJyBYi
- zXk7prvMPwpP229CvoeWCl723QCCDRFU0b1S/1Z7gD9I3gk/t6Vnp0U1pJ/oFhUaExlJ
- l2/HwgzW0eVnMQsJHKlzP8zNqJhOUFD+xI35NiRa9J1tH0BomncWOz7lTXlvaTED2Vdz
- ZHoFuv89BUKCkKGbfm4/O0KTNECK6rK1Db87M/rGCpUQpCQacVr29Lf3AWLQikDR62dB
- vCqIMCD3mvRcPPOo8VIN/xyQQ9J4OcBZ/jZ/zfxcbZc11fng8GNHlp33hCxuyKHUwbeT
- nOmw==
-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
- h=date:content-transfer-encoding:content-id:mime-version:comments
- :in-reply-to:reply-to:subject:to:from:message-id;
- bh=HpIGga40Wz3PXDOHP7PrAJqWHlOoA7xl5QvPk2tjJig=;
- b=JdV87WgS3oz/oa3fJSLdgU42ag+CKECK7OuT/DLvHfmwc2XtIMkx99zexEOi3S8DJp
- eaxLjf70GfCzWyq2fP11rUjemnTxW9R9efZEkZanvq36rbj7A+3/NmzvYPLwm8bihlke
- Gu8/FoVrE8ZANi252MKvejMVYsrYsyEJnO/vmiteVR5wD8mwHtYQnDXmwta6ZhH/ko+t
- uWXkHxOxs6y21CElD+40BvkIGGwFNd4FptjTA1T0rgw0PTUB/igdKvvwk1LotqbERJv5
- nhNHc47pJ4EU2o7G4yAwBBVETXQYYc8rl259VCKiSuGy0hEKGKweVieTEAe8V+NrZzd2
- UV7A==
-ARC-Authentication-Results: i=1; mx.google.com;
- spf=pass (google.com: best guess record for domain of mckusick@mckusick.com designates 70.36.157.235 as permitted sender) smtp.mailfrom=mckusick@mckusick.com
-Return-Path: <mckusick@mckusick.com>
-Received: from chez.mckusick.com (chez.mckusick.com. [70.36.157.235])
- by mx.google.com with ESMTPS id 129-v6si18906639pfd.201.2018.10.17.10.56.23
- for <rob@landley.net>
- (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
- Wed, 17 Oct 2018 10:56:23 -0700 (PDT)
-Received-SPF: pass (google.com: best guess record for domain of mckusick@mckusick.com designates 70.36.157.235 as permitted sender) client-ip=70.36.157.235;
-Authentication-Results: mx.google.com;
- spf=pass (google.com: best guess record for domain of mckusick@mckusick.com designates 70.36.157.235 as permitted sender) smtp.mailfrom=mckusick@mckusick.com
-Received: from chez.mckusick.com (localhost [IPv6:::1])
- by chez.mckusick.com (8.15.2/8.15.2) with ESMTP id w9HI1egQ039009
- for <rob@landley.net>; Wed, 17 Oct 2018 11:01:40 -0700 (PDT)
- (envelope-from mckusick@mckusick.com)
-Message-Id: <201810171801.w9HI1egQ039009@chez.mckusick.com>
-From: Kirk McKusick <mckusick@mckusick.com>
-To: Rob Landley <rob@landley.net>
-Subject: Re: License naming question.
-X-URL: http://WWW.McKusick.COM/
-Reply-To: Kirk McKusick <mckusick@mckusick.com>
-In-reply-to: <9bf40da7-afb3-d3d6-3759-d1566c99aa20@landley.net>
-Comments: In-reply-to Rob Landley <rob@landley.net>
- message dated "Tue, 16 Oct 2018 17:57:10 -0500."
-MIME-Version: 1.0
-Content-Type: text/plain; charset="us-ascii"
-Content-ID: <39007.1539799300.1@chez.mckusick.com>
-Content-Transfer-Encoding: quoted-printable
-Date: Wed, 17 Oct 2018 11:01:40 -0700
-X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,MISSING_MID,
- UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.1
-X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on chez.mckusick.com
-
-> To: mckusick@mckusick.com
-> From: Rob Landley <rob@landley.net>
-> Subject: License naming question.
-> Date: Tue, 16 Oct 2018 17:57:10 -0500
-> =
-
-> Hi,
-> =
-
-> We spoke at Ohio Linuxfest back in 2013 (you attended my Rise and
-> Fall of Copyleft talk, and then we talked in the hallway afterwards).
-> =
-
-> I _think_ I told you about my plans to try to promote public domain
-> equivalent licensing, a concept which has a wikipedia page now:
-> =
-
-> https://en.wikipedia.org/wiki/Public_domain_equivalent_license
-> =
-
-> For toybox what I did was take the OpenBSD suggested template license
-> off their website and remove the half-sentence requiring people to
-> copy that specific license text into derived works, and the resulting
-> license made it past Google's lawyers! My toybox project has been
-> providing the command line for android since Marshmallow
-> (https://lwn.net/Articles/629362/) and we're making progress on
-> getting android to build under android, the Bionic libc maintainer
-> recently sent me a roadmap update about that:
-> =
-
-> https://github.com/landley/toybox/commit/92b359f00057
-> =
-
-> I called the resulting license "Zero Clause BSD" (by analogy with
-> "Creative Commons Zero" and the existing 4 clause, 3 clause, and 2
-> clause BSD licenses), and I even got SPDX approval for it in 2015
-> (because Samsung asked me to shortly after Google merged it into
-> AOSP, they'd been adding it aftermarket before then and having an
-> SPDX identifier for the license simplified their internal bureaucracy).
-> =
-
-> Then a couple months after SPDX approved it, somebody _else_ submitted
-> the same license to Eric Raymond's old Open Source Initiative using
-> "Free" in the name, as in Free Software Foundation. (A sadly loaded
-> term these days.)
-> =
-
-> I hadn't known they were still in the license approval business
-> (they stopped approving new licenses in... 2012? And I remember
-> them explicitly _rejecting_ CC0 saying public domain isn't a license,
-> which their FAQ still talks about at
-> https://opensource.org/faq#public-domain). But they approved the
-> toybox license under a different name, then asked SPDX to retroactively
-> change their name for it. (SPDX didn't, but OSI refused to admit
-> it made a mistake, even though they said they had a policy to keep
-> the names in sync. They hadn't done their homework.)
-> =
-
-> Now every time the license is considered for a new use, the confusion
-> OSI caused tends to derail things:
-> =
-
-> https://github.com/david-a-wheeler/spdx-tutorial/issues/1
-> =
-
-> When github itself was considering adding 0BSD to its license
-> pulldown (which would have been a big win), I was asked what I
-> thought of the naming confusion, and I wrote two long things on my
-> rationale with lots of links to earlier stuff, which you can read
-> here if you'd like:
-> =
-
-> https://github.com/github/choosealicense.com/issues/464
-> =
-
-> Anyway, I recently decided to ask OSI to admit they made a mistake
-> and change their name for the license to match what SPDX did, and
-> there was unanimous approval...
-> =
-
-> http://lists.opensource.org/pipermail/license-review_lists.opensource.or=
-g/2018-September/003519.html
-> =
-
-> Until the same guy who was objecting last time showed up to continue
-> to object. He ignord the "who used it first" axis, and said he
-> wanted to know which name was used more today, and then when he
-> lost that argument he said he objects to calling something a BSD
-> license that isn't using Berkeley's original wording.
-> =
-
-> My question is: do you object to the name "Zero Clause BSD" for a
-> public domain equivalent license that's the OpenBSD suggested
-> template license with half a sentence removed?
-> =
-
-> If you want to stay out of this, I understand. I'm pretty sure I
-> asked you this in 2013 before I started pushing the name, and
-> wouldn't have if you'd objected then, but that was long ago and the
-> water under the bridge is dead...
-> =
-
-> Thanks for your time, sorry that took so long to explain. (And even
-> longer if you read the big long github choosealicense thread. :)
-> =
-
-> Rob
-
-Thanks for the through explanation of the situation.
-
-I have no objections to the name "Zero Clause BSD" for your license.
-
-I hope that you are successful in getting OSI to change their name
-for the license to match what SPDX did.
-
- Kirk McKusick
-
diff --git a/www/design.html b/www/design.html
index 6225ce2f..d1531e87 100644
--- a/www/design.html
+++ b/www/design.html
@@ -17,36 +17,13 @@ of importance:</p>
<b><h3>Features</h3></b>
-<p>These days toybox is the command line of Android, so anything they android
-guys say to do gets at the very least closely listened to.</p>
-
-<p>Toybox should provide the command line utilities of a build
-environment capable of recompiling itself under itself from source code.
-This minimal build system conceptually consists of 4 parts: toybox,
-a C library, a compiler, and a kernel. Toybox needs to provide all the
-commands (with all the behavior) necessary to run the configure/make/install
-of each package and boot the resulting system into a usable state.</p>
-
-<p>In addition, it should be possible to bootstrap up to arbitrary complexity
-under the result by compiling and installing additional packages into this
-minimal system, as measured by building both Linux From Scratch and the
-Android Open Source Project under the result. Any "circular dependencies"
-should be solved by toybox including the missing dependencies itself
-(see "Shared Libraries" below).</p>
-
-<p>Finally, toybox may provide some "convenience" utilties
-like top and vi that aren't necessarily used in a build but which turn
-the minimal build environment into a minimal development environment
-(supporting edit/compile/test cycles in a text console), configure
-network infrastructure for communication with other systems (in a build
-cluster), and so on.</p>
-
<p>The hard part is deciding what NOT to include.
A project without boundaries will bloat itself
to death. One of the hardest but most important things a project must
do is draw a line and say "no, this is somebody else's problem, not
-something we should do."
-Some things are simply outside the scope of the project: even though
+something we should do."</p>
+
+<p>Some things are simply outside the scope of the project: even though
posix defines commands for compiling and linking, we're not going to include
a compiler or linker (and support for a potentially infinite number of hardware
targets). And until somebody comes up with a ~30k ssh implementation (with
@@ -56,13 +33,12 @@ going to point you at dropbear or bearssl.</p>
<p>The <a href=roadmap.html>roadmap</a> has the list of features we're
trying to implement, and the reasons why we decided to include those
features. After the 1.0 release some of that material may get moved here,
-but for now it needs its own page. The <a href=status.html>status</a>
-page shows the project's progress against the roadmap.</p>
+but for now it needs its own page.</p>
<p>There are potential features (such as a screen/tmux implementation)
that might be worth adding after 1.0, in part because they could share
infrastructure with things like "less" and "vi" so might be less work for
-us to do than for an external from scratch implementation. But for now, major
+us to do than an external from-scratch implementation. But for now, major
new features outside posix, android's existing commands, and the needs of
development systems, are a distraction from the 1.0 release.</p>
@@ -422,26 +398,6 @@ work.</p>
<p>(This is why we use an external https wrapper program, because depending on
openssl or similar to be linked in would change the behavior of toybox.)</p>
-<a name="license" />
-<h2>License</h2>
-
-<p>Toybox is licensed <a href=license.html>0BSD</a>, which is a public domain
-equivalent license approved by <a href=https://spdx.org/licenses/0BSD.html>SPDX</a>. This works like other BSD licenses except that it doesn't
-require copying specific license text into the resulting project when
-you copy code. (We care about attribution, not ownership, and the internet's
-really good at pointing out plagiarism.)</p>
-
-<p>This means toybox usually can't use external code contributions, and must
-implement new versions of everything unless the external code's original
-author (and any additional contributors) grants permission to relicense.
-Just as a GPLv2 project can't incorporate GPLv3 code and a BSD-licensed
-project can't incorporate either kind of GPL code, we can't incorporate
-most BSD or Apache licensed code without changing our license terms.</p>
-
-<p>The exception to this is code under an existing public domain equivalent
-license, such as the xz decompressor or
-<a href=https://github.com/mkj/dropbear/blob/master/libtommath/LICENSE>libtommath</a> and <a href=https://github.com/mkj/dropbear/blob/master/libtomcrypt/LICENSE>libtomcrypt</a>.</p>
-
<a name="codestyle" />
<h2>Coding style</h2>
@@ -484,14 +440,13 @@ them and other code. Yes, c99 allows you to put them anywhere, but they're
harder to find if you do that. If there's a large enough distance between
the declaration and the code using it to make you uncomfortable, maybe the
function's too big, or is there an if statement or something you can
-use as an excuse to start a new closer block? Use a longer variable name
-that's easier to search for perhaps?</p>
+use as an excuse to start a new closer block?</p>
<p>An * binds to a variable name not a type name, so space it that way.
(In C "char *a, b;" and "char* a, b;" mean the same thing: "a" is a pointer
but "b" is not. Spacing it the second way is not how C works.)</p>
-<p>If statements with a single line body go on the same line if the result
+<p>If statments with a single line body go on the same line if the result
fits in 80 columns, on a second line if it doesn't. We usually only use
curly brackets if we need to, either because the body is multiple lines or
because we need to distinguish which if an else binds to. Curly brackets go
diff --git a/www/faq.html b/www/faq.html
index 37ab9157..c5709eff 100755
--- a/www/faq.html
+++ b/www/faq.html
@@ -5,7 +5,6 @@
<li><h2><a href="#capitalize">Do you capitalize toybox?</a></h2></li>
<li><h2><a href="#why_toybox">Why toybox? (What was wrong with busybox?)</a></h2></li>
<li><h2><a href="#support_horizon">Why a 7 year support horizon?</a></h2></li>
-<li><h2><a href="#releases">Why time based releases?</a></h2></li>
<li><h2><a href="#code">Where do I start understanding the toybox source code?</a></h2></li>
</ul>
@@ -102,52 +101,9 @@ for it and let the functionality cleanly drop out. I also keep old Ubuntu
images around in VMs and perform the occasional defconfig build there to
see what breaks.</p>
-<h2><a name="releases" />Q: Why time based releases?</h2>
-<p>A: Toybox targets quarterly releases (a similar schedule to the Linux
-kernel) because Martin Michlmayr's
-<a href=http://www.youtube.com/watch?v=IKsQsxubuAA>talk</a> on the
-subject was convincing.</p>
-
-<p>Releases provide synchronization points where the developers certify
-"it worked for me". Each release is a known version with predictable behavior,
-and right or wrong at least everyone should be seeing
-similar results where you might be able to google an unexpected outcome.
-Releases focus end-user testing on specific versions
-where issues can be reproduced, diagnosed, and fixed.
-Releases also force the developers to do periodic tidying, packaging,
-documentation review, finish up partially implemented features languishing
-in their private trees, and give regular checkpoints to measure progress.</p>
-
-<p>Over time feature sets change, data formats change, control knobs change...
-For example toybox's switch from "ls -q" to "ls -b" as the default output
-format wasn't exactly a bug, it was a design improvement... but the
-difference is academic if the change breaks somebody's script.
-Releases give you the option to schedule upgrades later, and not to rock
-the boat just now: just use a known working release version.</p>
-
-<p>The counter-argument is that "continuous integration"
-can be made robust with sufficient automated testing. But like the
-<a href=http://www.shirky.com/weblog/2013/11/healthcare-gov-and-the-gulf-between-planning-and-reality/>waterfall method</a>, this places insufficent
-emphasis on end-user feedback and learning from real world experience.
-Developer testing is either testing that the code does what the developers
-expect given expected inputs running in an expected environment, or it's
-regression testing against bugs previously found in the field. No plan
-survives contact with the enemy, and technology always breaks once it
-leaves the lab and encounters real world data and use cases, not just
-at runtime but in different build environments.</p>
-
-<p>The best way to give new users a reasonable first experience is to point
-them at specific stable versions where development quiesced and
-extra testing occurred. There will still be teething troubles, but multiple
-people experiencing the _same_ teething troubles can potentially
-help each other out.</p>
-
-<p>As for why releases on a schedule are better than releases "when it's
-ready", watch the video.</p>
-
-<h2><a name="code" />Q: Where do I start understanding the source code?</h2>
-
-<p>A: Toybox is written in C. There are longer writeups of the
+<h2><a name="code" />Where do I start understanding the source code?</h2>
+
+<p>Toybox is written in C. There are longer writeups of the
<a href=design.html>design ideas</a> and a <a href=code.html>code walkthrough</a>,
and the <a href=about.html>about page</a> summarizes what we're trying to
accomplish, but here's a quick start:</p>
diff --git a/www/header.html b/www/header.html
index e43574cc..0d5baa90 100644
--- a/www/header.html
+++ b/www/header.html
@@ -32,9 +32,6 @@
<li><a href="design.html">Design goals</a></li>
<li><a href="code.html">Source code walkthrough</a></li>
<li><a href="http://lists.landley.net/listinfo.cgi/toybox-landley.net">Mailing List</a></li>
- <ul>
- <li>(<a href="https://www.mail-archive.com/toybox@lists.landley.net">mirror</a>)</li>
- </ul>
<li>IRC #toybox on freenode.net</li>
<li><a href=https://github.com/landley/toybox/commits/master.atom>Commit RSS feed</a></li>
<li><a href="/notes.html">Maintainer's Blog</a></li>
diff --git a/www/license.html b/www/license.html
index 55521e73..f250410f 100755
--- a/www/license.html
+++ b/www/license.html
@@ -28,18 +28,17 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</p>
<a href=http://unlicense.org>unlicense</a>, and <a href=http://wtfpl.net/>wtfpl</a>,
the intent is to effectively place the licensed material into the public domain,
which after decades of FUD (such as the time OSI's ex-lawyer compared
-<a href=https://web.archive.org/web/20160530090006/http://www.cod5.org/archive/>placing code into the public domain</a> to
+<a href=http://www.cod5.org/archive/>placing code into the public domain</a> to
<a href=http://www.linuxjournal.com/article/6225>abandoning trash by the
side of a highway</a>) is considered somehow unsafe. But if some random third
party
<a href=https://github.com/mkj/dropbear/blob/master/libtomcrypt/LICENSE>takes
public domain code</a> and slaps <a href=http://www.opensource.apple.com/source/gnuzip/gnuzip-25/gzip/gzip.c>some other license on it</a>, then it's fine.</p>
-<p>To work around this perception, the above license is the
-<a href=https://www.openbsd.org/policy.html>OpenBSD suggested template
-license</a>, <a href=https://github.com/landley/toybox/commit/ee86b1d8e25cb0ca9d418b33eb0dc5e7716ddc1e>minus the half sentence</a>
-requiring the license text be copied verbatim into derived works. If 2BSD is
-ok, then 0BSD should be ok, despite being equivalent to placing code in the
+<p>To work around this perception, the above license is a standard 2-clause BSD
+license <a href=https://github.com/landley/toybox/commit/ee86b1d8e25cb0ca9d418b33eb0dc5e7716ddc1e>minus the half sentence</a>
+requiring text copied verbatim into derived works. If 2BSD is
+ok, the 0BSD should be ok, despite being equivalent to placing code in the
public domain.</p>
<p>Modifying the license in this way avoids the hole android toolbox fell into where
@@ -50,8 +49,4 @@ additional restrictions" and BSD's "you must include this large hunk of text"
by sticking the two licenses at
<a href=http://git.busybox.net/busybox/tree/networking/ping.c?id=887a1ad57fe978cd320be358effbe66df8a068bf>opposite ends of the file</a> and hoping nobody
noticed.</a>
-
-<p>Note: I asked <a href=https://www.oreilly.com/openbook/opensources/book/kirkmck.html>Kirk McKusick</a> for permission to call this a BSD license at
-a conference shortly before I started using the name,
-and <a href=0bsd-mckusick.txt>again in 2018</a>.</p>
<!--#include file="footer.html" -->
diff --git a/www/news.html b/www/news.html
index 5497fdf4..08191ea3 100755
--- a/www/news.html
+++ b/www/news.html
@@ -8,432 +8,6 @@ a development environment. See the links on the left for details.</p>
<h2>News</h2>
-<a name="18-10-2019" /><a href="#18-10-2019"><hr><h2><b>October 18, 2019</b></h2></a>
-<blockquote>
-<p>"In those days spirits were brave, the stakes were high, men were real
-men, women were real women and small furry creatures from Alpha Centauri
-were real small furry creatures from Alpha Centauri."
-</p> <p>- The Hitchhiker's Guide to the Galaxy</p>
-</blockquote>
-
-<p><a href=downloads/toybox-0.8.2.tar.gz>Toybox 0.8.2</a>
-(<a href=https://github.com/landley/toybox/releases/tag/0.8.2>git commit</a>)
-is finally out (only two months late).</p>
-
-<p>The new commands this time are minor variants of existing ones
-(<b>dnsdomainname</b> is hostname -d, <b>arch</b> is uname -m), but about
-1/3 of toysh got implemented in pending, <a href=https://github.com/landley/mkroot>mkroot</a> got merged as a "make root" target (see Build),
-and Android's <a href=http://lists.landley.net/pipermail/toybox-landley.net/2019-August/010845.html>hermetic build</a>
-work continued resulting in a lot of fixes.</p>
-
-<p>The android-specific <b>getprop</b>, <b>setprop</b>, <b>start</b>, and <b>stop</b>
-commands were removed from toybox because they grew dependencies on android
-libraries, and since toybox tries to avoid mandatory external dependencies
-they moved to another package.</p>
-
-<p><u>Build</u>:
-The new "make root" target builds a simple toybox root filesystem,
-using scripts/mkroot.sh which is a stripped
-down version of the external <a href=https://github.com/landley/mkroot>mkroot</a>
-project merged into toybox. (Alas, at the moment it wants sh and route out
-of pending, which aren't quite load bearing yet.)</p>
-
-<p>The new "scripts/mcm-buildall.sh" convenience script builds cross
-compilers based on gcc+musl multiple targets (arm, x86, mips, m68k, s390,
-microblaze...)
-using <a href=https://github.com/richfelker/musl-cross-make>musl-cross-make</a>,
-and a new scripts/cross.sh to easily cross compile for one or more targets
-using the resulting compilers. (This works with "make root", "make
-toybox", and other builds understanding the CROSS_COMPILE environment variable.)</p>
-
-<p>Setting the environment variable ASAN=1 enables the
-llvm address sanitizer. (You may need to
-export ASAN_SYMBOLIZER_PATH on debian to use it, they add the version number to
-the filename in /usr/bin which confuses llvm.)</p>
-
-<p>Patrick Oppenlander fixed make -j (our make is a wrapper around
-scripts/make.sh which was already doing a parallel build, but if you called
-make with -j it wouldn't wait for make.sh to finish and the build broke).</b>
-
-<p>Lots of fixes for the MacOS build.</p>
-
-<p><u>New options</u>:
-We upgraded <b>tar</b> to extract some older tarballs, <b>file</b> added -b and -s
-options and can also recognize older tarballs,
-some xz archives, .otf fonts, perf/simpleperf data files,
-android boot images, and dtb files. Upgraded <b>file</b> to show the device type
-for block and char devices, the target for symlinks, and it says _why_ it can't
-open a file.</p>
-
-<p>Several commands ignore some options rather than erroring on them:
-<b>patch</b> ignores the -f -g# and --no-backup-if-mismatch options
-(all of which we were already doing by default anyway), and <b>xargs</b>
-ignores -P# (which requests parallel execution, maybe add it later but
-single threading works), and Denys Nykula made <b>wget</b> ignore
---no-check-ceritificate and <b>gzip</b> ignore -n (again, we weren't doing
-either anyway) to satisfy pkgsrc.</p>
-
-<p>William Haddon taught <b>diff</b> and <b>patch</b> to support special characters in path
-names (via quoting) and more timestamp formats.
-Eric Molitor implemented <b>nl</b> -v (with negative and zero starting values),
-and fixed a MacOS compatibility issue in the build scripts.
-Tom Cherry added <b>netcat</b> -U (UNIX domain socket support).
-Denys Nykula taught <b>wget</b> to call ftpget for ftp:// URLs.
-Ethan Sommer added ln -t and rmdir --ignore-fail-on-non-empty.
-Elliott Hughes added <b>grep</b> -R, <b>killall</b> -w, tar --mode,
- fixed <b>ls</b> -Z and spacing in -lZ and --full-time,
-added <b>xargs</b> --max-args and removed xargs -I (which we never actually
-supported) and tweaked the size calculation to more closely match other
-versions,
-added xargs -o and made -p read from /dev/tty, added <b>blkid</b> -s, SEC_TYPE for ext3,
-msdos, and ntfs, f2fs and ntfs LABEL, fixed vfat/ntfs UUID, and switched
-the endianness for UUID of msdos/ntfs/vfat, simplified the octal mode
-display in <b>lsof</b>, added <b>pidof</b> -x (thus making the default behavior _not_
-be -x).</p>
-
-<p>When readdir() succeeds but stat() fails, <b>ls</b> now prints "??? ? ? filename"
-entries instead of "cannot access" errors. (Still trying to make ls / on
-android work more gracefully with the SELinux weirdness they added in 9.)</p>
-
-<p>Added %C to <b>stat</b> and made it show device type in its default output,
-<b>cmp</b> now works
-with 1 argument (implicit - as second argument reading from stdin).
-<b>sed</b> added exit codes to the q command (q123), added Q, and fixed a
-bad error message with "!".
-Removed TAIL_SEEK config option (it just always does that now),
-<b>find</b> grew several new options (%Z, -true, -false, and -newerXY), <b>ln</b> added -T.
-The argument to <b>mktmp</b> --tmpdir is now optional.</p>
-
-<p><u>Bugfixes</u>:
-The unshare probe bit-rotted so it was impossible to build <b>unshare</b>
-and <b>nsenter</b> on some distros.
-Commit 771e94e2a08 broke toybox's ability to say "unknown command" when
-you pointed a symlink at it that it that didn't correspond to a command,
-pointing a symlink at another symlink
-to make toybox run a command under a name it doesn't recognize
-(ln -s toybox sh; ln -s sh ash) had an off by one error,
-<b>ifconfig</b> no longer error_exits if the "read mac address" ioctl fails (Android N
-and later block that for non-root users to prevent device tracking).
-When the libcrypto library was disabled, md5sum was building commands it
-hasn't got built-in support for yet (like sha3sum) which acted like redundant
-copies of md5sum,
-<b>tar</b> wasn't correctly reading or writing sparse files with a hole at
-the end, and tar tzf blah.tar.xz was calling xz when it meant xzcat,
-<b>xargs</b> would spuriously fail on large memory systems (due to a missing
-"unsigned" in a typecast),
-<b>basename</b> can now remove suffixes starting with a dash,
-<b>cp</b> -r unlinks() an existing symlink before trying to
-recreate the symlink (otherwise cp -r into an existing directory will
-try to follow the existing symlink and create another symlink at its
-destination, failing if a file already exists there, which
-was confusing gentoo's package manager), <b>timeout</b> now produces the
-right exit code when the timed command intercepts the exit signal,
-and <b>hostname</b> -d no longer segfaults on machines with no domain name.</p>
-
-<p>Denys Nykula fixed the <b>ftpget</b> freeze (it was sending REST instead
-of RETR), made <b>mv</b> work with a trailing slash in the source,
-fixed a <b>find</b> segfault,
-and made <b>env</b> always exec rather than recursing to a builtin
-(on the theory #!/usr/bin/env is expected to search the $PATH).</p>
-
-<p>Elliott improved <b>killall</b>'s handling of long filenames, made <b>kill</b> work
-when killall5 is disabled (missing FORCE_FLAGS), fixed error reporting in
-<b>hostname</b>, fixed several things in <b>xargs</b>,
-made <b>printf</b> \c and \0 octal escapes work, fixed a <b>find</b> -name corner
-case (find src/*.c -name file.c) and find dangling symlink behavior,
-made some <b>rm</b> error messages consistent, fixed \x behavior in echo and
-printf, fixed linestack.c's buffer length for utf8 U+XXXX escape printing,
-fixed a race in <b>losetup</b>, fixed <b>grep</b> -F with multiple matches on the same
-line and an -I failure in the existing grep tests, made <b>readlink</b> notice
-when it has more than one argument, and made various
-fixes to <b>modinfo</b>.</p>
-
-<p>Ethan Sommer reported that <b>stat</b> of an suid/sticky file output 5 digits of
-octal stat date instead of 4.
-Rob fixed an unaligned access in <b>grep</b>. Alessio Balsini removed an incorrect
-null termination in <b>losetup</b>.
-Jarno Mäkipää fixed <b>hexedit</b>
-scrolling up and down on older terminals, and fixed <b>ls</b> segfaulting with a broken
-(non-UTF8) locale (didn't expect wcrtomb to return -1).
-Andrew Ilijic made ls put 2 spaces between columns like other implementations
-(which helps when terminals get confused and apply UTF8 combining characters
-to the space after a filename).
-</p>
-
-<p><u>Library</u>:
-Added dlist_lpop() to use a dlist as a stack (it removes the last entry
-instead of the first), and dlist_pop() now works on a dlist_terminate()d list.
-DIRTREE_STATLESS returns entries we couldn't stat() (with a zeroed ->st
-field, and ->again |= 2), but filling in the file type from readdir().
-Coversions between signal names and numbers now include all the Linux signals,
-not just posix ones. The functions sig_to_num() and num_to_sig() moved into
-lib/portability.h, because MacOS has different signals.
-TOYFLAG_MAYFORK allows commands to run in toysh's process without forking,
-but also makes them accessable from the toybox multiplexer or standalone.
-A MAYFORK command has to clean up after itself (even in error paths) and
-can't discard anything we need to keep (such as closing stdout).</p>
-
-<p>Elliott did a big xbind/xconnect cleanup (adding xbindany and xconnectany),
-taught xregcomp that an empty regex matches the whole line
-(because FreeBSD, and thus MacOS, doesn't already do that), and
-replaced several uses of get_line() (which does single byte reads)
-with getline() (which doesn't).</p>
-
-<p><u>Plumbing</u>:
-"make clean" doesn't produce a screenful of unnecessary output now,
-rm, ln, cp, kill, and netcat use the FLAG() macros now, makedevs uses the new
-GLOBALS naming format, timeout now uses xwaitpid(), and we fixed an
-off by one error in xwaitpid().</p>
-
-<p>Elliott removed a workaround for old NDK versions from getconf and
-moved sort off of get_rawline() (which let us remove it).
-Rob undid some loop unrolling in md5sum/sha1sum (we have libcrypto if you want
-an assembly optimized version instead of an understandable version).</p>
-
-<p>Android ndk-r20 doesn't define the __ANDROID_NDK__ symbol, so we switched
-to using clang's __has_include() (which is an undefined macro and thus a NOP
-resolving to false on gcc).</p>
-
-<p><u>Pending</u>:
-Rob did a lot of work on toysh: continuation support works (it knows when to ask
-for another line of text and when to run what it's got), as do
-nested if/else/elif statements, and while and for loops (supporting "for i"
-and "for i in", but not for ((;;)) yet).
-It parses pipes and redirections but doesn't perform them yet.
-The next big todo chunk is environment variable resolution.
-</p>
-
-<p>Gavin Howard fixed some bugs in bc, such as not returning error when raising
-zero to a negative power.
-Jarno Mäkipää continues to extend vi, adding yank and push, support for tabs,
-rewriting delete, changing the drawing code, etc. Elliott also added several
-fixes and features to vi,
-fixed host to cope with large DNS responses, switched crontab to
-use getline(), did work on man, fixed fixed several things in dd,
-implemented diff --strip-trailing-cr and made diff not need /tmp.
-Mike Bennett added extended attribute support to ip.c's route change.</p>
-
-<p><u>Test suite</u>: The killall and pgrep tests were having occasional
-spurious failures due to a race condition (the test script would fork()
-to call sleep and for just a moment there were two instances of the test
-script, reporting an extra process if killall or pgrep ran then).
-
-<p>Elliott Hughes did a lot of work on the test suite: add kill -l tests,
-make losetup.test notice (and skip) if loopback
-devices area already in use, blkid.test can TEST_HOST e2fsprogs blkid now,
-modinfo.test notices (and skips) if there's no /proc/modules or modules
-directory, ifconfig.test skips if "dummy0 up" fails and disabled the
-pointtopoint tests entirely (the kernel never supported it?),
-truncate.test is less
-confused by SELinux, hostname.test can run some tests as non-root,
-addressed a race condition in killall.test on slow systems,
-made chgrp.test, chown.test, and tar.test handle an empty /etc/passwd or /etc/group
-(we were checking whether they were _there_ but some android devics have
-empty ones),
-fixed a couple things in env.test, extended killall.test to explicitly cover
-long and short names (and not assume the shell is /bin/sh), taught split.test not to rely on bash process substitution,
-added missing TZ=utc to touch.test, fixed cp.test to pass for root
-or with a restrictive umask, and fixed the FAILCOUNT arithmetic to use more portable
-$(()). Elliott also made some tests more flexible (find.test can handle any
-error message about symlink loops, etc), and disabled others (such as du)
-when SELinux is enabled.</p>
-
-<p>Rob taught testcmd not to use the shell builtin for TEST_HOST unless there
-isn't one in the $PATH, work if $PWD has a space in it,
-and make kill.test stop testing the shell builtin
-insead of the command, quieted tests that were producing output
-other than their PASS/FAIL line, and made NOSPACE tests ignore the
-presence/absence of leading/trailing whitespace as well as differences
-in the amount of space.</p>
-
-<p><u>Documentation</u>:
-The <a href=roadmap.html>roadmap</a> got freshened up a bit, with updates
-for android from Elliott.
-In <a href=design.html>the design page</a> the Features section starts with
-4 new paragraphs about the scope of toybox, and a new License section talks
-about 0BSD.
-The "./toybox --help" output now explains how to do install_flat by hand.</p>
-
-<p><u>Sheer pedantry</u>:
-Elliott fixed a double close in loopfiles_lines() so strace doesn't
-have an EBADF in it, and added a missing "static" in lib/net.c.</p>
-
-<a name="21-05-2019" /><a href="#21-05-2019"><hr><h2><b>May 21, 2019</b></h2></a>
-<blockquote>
-<p>"I like the cover," he said. "'Don't Panic.' It's the first helpful or intelligible thing anybody's said to me all day."</p> <p>- The Hitchhiker's Guide to the Galaxy</p>
-</blockquote>
-
-<p><a href=downloads/toybox-0.8.1.tar.gz>Toybox 0.8.1</a>
-(<a href=https://github.com/landley/toybox/releases/tag/0.8.1>git commit</a>)
-is out.</p>
-
-<p>Android is now using toybox as part of a <a href=http://lists.landley.net/pipermail/toybox-landley.net/2018-November/009824.html>"hermetic" build</a>
-(meaning Android is building under toybox, which is halfway to Android
-building under Android). See Android's <a href=https://android.googlesource.com/platform/prebuilts/build-tools/+log>build-tools</a> and <a href=https://android.googlesource.com/platform/build/soong/+log>soong</a> repositories to follow along with development, or check the list for the <a href=http://lists.landley.net/pipermail/toybox-landley.net/2019-May/010485.html>current status</a>.</p>
-
-<p><u>New commands</u>: Isaac Dunham added <b>mcookie</b>, which is used by
-X11. Elliott Hughes added <b>devmem</b>, which replaces toolbox's "r".</p>
-
-<p><u>Promoted</u>: <b>tar</b>, <b>gunzip</b>, and <b>zcat</b> were cleaned
-up and moved out of pending.
-Tar is a near-rewrite with support for --owner --group and --sparse,
-capable of autodetecting "wget blah.tar.bz2 -O - | tar xv", a --restrict option
-that only allows files to extract into a single subdirectory, and so on.</p>
-
-<p><u>Added to pending</u>:
-Jarno Mäkipää contributed a new <b>vi</b> implementation. Makepost added
-<b>man</b>.</p>
-
-<p><u>Updates</u>: Elliott added <b>find</b> -wholename/-iwholename, -printf,
-and -context, <b>grep</b> --exclude-dir, and <b>echo</b> -E.
-Rob added <b>blkid</b> -U and -L, <b>mount</b> now has UUID= support via blkid -U,
-you can now specify TZ="blah" in the <b>date</b> -d input string (although
-why the double quotes are required is an open question), and <b>sed</b> now
-understands ,+N relative ranges. Makepost added <b>rm</b> -v.
-The human_readable fields in <b>ps</b>/<b>top</b>/<b>iotop</b> now use all
-available space to show more precision, <b>iotop</b> displays swap bandwidth
-properly (it was showing a signed field as unsigned), and
-<b>touch</b> -t and -d autodetect the time format.</p>
-
-<p><u>Cleanups</u>: In pending Rob did some bc cleanup,
-Colin Davidson did some arp cleanup,
-Uros Prestor fixed route argument parsing, and
-in bc Daniel Rosenberg fixed bc_vec_concat()'s allocation and
-Gavin Howard fixed an overflow bug in bc_num_ulong().</p>
-
-<p>Elliott made scan_key() detect cursor keys and such with several more
-terminal types, made more better about directories and non-tty output,
-cleaned up inconsistent uses of ARRAY_LEN(), taught file
-to recognize a c-sky ELF machine, and fixed timezone and daylight
-savings time issues in date and its tests.
-Rob simplified netcat and ping using new lib/net.c infrastructure.
-When run as non-PID 1 (for a chroot) oneit's exit code now indicates
-which signal it's exiting due to.
-Hadrian Węgrzynowski #defined constants for mkpathat.
-Date now uses the current time for unspecified fields (instead of zeroing
-them), and should set the weekday properly.
-Sort's -k2.3,4.5 syntax is now documented and behaves more closely to
-other implementations (silly as that behavior is).
-Significant speedup to sed s/a/b/g on a megabyte long line (it was
-O(n^2) and now it's quite snappy).</p>
-
-<p>Several cases of warning about stdout failing to write were silenced
-because things like piping the output to head means stdout is a special
-case: its output is often discarded and that's fine. And xprintf()
-and friends only checks stdout for errors so it can exit early ("yes | head"
-should not spin endlessly) without actually flushing anything.
-There's an ongoing design debate about line buffering stdin and stdout
-that'll have to be resolved next dev cycle.</p>
-
-<p><u>Bugs</u>:
-Elliott sent in a lot of fixes for building AOSP with toybox:
-support for more date formats, sed substitution of empty capture groups
-and an endless loop with -EPIPE, fixed find -path/-ipath, made loggit()
-only feed LOG_AUTH to syslog when we have a tty, gave grep a bunch
-of --longname synonyms for short options, added getfattr --only-values,
-and timeout --foreground --preserve-status and --signal.</p>
-
-<p>Top got a lot of tweaks: it no longer collates thread's CPU usage into the
-parent thread (in -H mode), hides the cursor in interactive mode, updates the
-display properly in batch mode, and accepts ENTER
-as a synonym for SPACE when refreshing the display. The header lines
-now abbreviate long numbers with units (via human_readable()),
-more reliably spans the terminal width, and says "Thread" instead
-of "Task" when it's showing threads. The task/thread count now adds up
-(understanding more kernel states and treating unknown ones as "sleeping").
-Top now treats -o "" as an error (previously it displayed an empty screen).</p>
-
-<p>William Djupström pointed out login needs to chown() the tty, and made it
-clear the environment when -p is absent.
-Vidar Holen fixed inverted find -exec exit status.
-Rob made chgrp() stop relying on libc's printf("%s", NULL) printing "(null)"
-because a <a href=https://github.com/varnishcache/varnish-cache/issues/2879>newly added gcc bug</a> turns that into a build break, and
-fixed an outright embarassing xstrndup() bug.
-Liwugang fixed a segfault when stat's format string had a trailing %.
-A missing else in grep meant -x was sometimes ignored.</p>
-
-<p><u>Infrastructure</u>:
-in the build scripts/portability.sh now tests that the compiler it's trying
-to use exists up front. We no longer link against librt because on glibc that's
-pulling in libpthread for some unknown reason.</p>
-
-<p>TOYFLAG_ARGFAIL() lets commands return custom exit values when option parsing
-fails (because AOSP build scripts cared), so timeout --unknown returns 125
-and so on: chroot, diff, cmp, env, grep, nohup, and sort also use it now with
-various values.</p>
-
-<p>New FLAG() macros: FLAG(x) expands to (toys.optflags&FLAG_x) and returns
-zero if the command line argument's bit isn't set and nonzero if it is
-(meaning -x was or wasn't encountered on the command line this time by
-lib/args.c). Lots of commands got converted to use them.</p>
-
-<p>New lib/env.c with reset_env(), xsetenv(), and xunsetenv() which frees
-the old environment variable when it wasn't inherited from exec(). This
-lets long-running loops reset environment variables without memory leaks.</p>
-
-<p>New xnotify() plumbing in lib/portability.c with Linux and Mac versions
-(which should also work on BSD).</p>
-
-<p>New xparsedate() and xvali_date() functions allow date, tar --mtime, and
-touch to understand the same date formats,
-xpopen_both() now knows how to use existing filehandles for the child's
-stdin/stdout, and no longer redirects stderr (which hides errors),
-new nanomove(), nanodiff(), union socksaddr, xrecvwait(),
-and human_readable_long() to show more than 3 digits of output.</p>
-
-<p>Taught xgetaddrinfo() to return a wildcard address for a NULL host,
-xconnbind() sets SO_REUSEADDR by default,
-fileunderdir() returns the abspath to the file now (since we had to work
-it out anyway), and
-xabspath() uses O_PATH now (because Android's SELinux rules got more aggressive).</p>
-
-<p>Several new xsendfile() variants, including sendfile_len() to copy
-a specific amount of data and xsendfile_pad() to append zeroes to the
-output when there isn't enough input.</p>
-
-<p>regexec0() is now using libc's REG_STARTEND supported by every libc out
-there _except_ musl. (It originated in BSD and was adopted by glibc, bionic,
-and uClibc 15 years ago, and is also supported in macosx. Musl's maintainer
-<a href=https://www.openwall.com/lists/musl/2013/01/15/26>turned down</a>
-the feature request as an invalid use case he didn't think they should
-be trying to do.)</p>
-
-<p><u>Docs</u>:
-the <a href=license.html>license page</a> now has an SPDX identifier, and links to more
-history/context. The actual LICENSE file had its title line removed
-so <a href=https://github.com/github/choosealicense.com/pull/643#issuecomment-463746027>github could recognize it</a> as 0BSD. (We're still waiting for
-"<a href=https://github.com/github/choosealicense.com/pull/643#issuecomment-464380789>a while</a>" to pass before github actually does, though.)</p>
-
-<p>A new www/doc/mount.txt file describes how mount works under the covers.</p>
-
-<p>Rob consistently misspelled "canonical" and "millisecond", mountpoint
-has a synopsis now,
-Kevin van der Kamp fixed a typo in netstat's help text, and Elliott
-Hughes fixed typos everywhere and made the tense, capitalization, and
-punctuation of help text more consistent.</p>
-
-<p>New paragraph in the code style part of design.html explaining that
-"char* a, b;" is not how C works, and since you wind up with "char *a, b;"
-anyway you might as well say that.</p>
-
-<p>Given dreamhost's tendency to repeatedly delete the mailing list
-archive, the nav bar on the left links to a backup web archive now too.</p>
-
-<p>The FAQ now says why we do time based releases.</p>
-
-<p><u>Testing</u>: Added VERBOSE=nopass to not show passing tests.
-The test suite now does an rm -rf on testdir between each command so
-debris files don't accumulate.
-New skipnot function skips the next test if a command line fails, and
-toyonly function only runs command when we're testing the toybox version
-of command. (This isn't the same as TEST_HOST, the host version could be
-toybox.)
-The find -newer test calls "sleep .1" to avoid intermittently failing with an
-identical timestamp.
-Elliott added the start of a file.test rogues gallery.
-No longer call lsattr in "make tests" because the behavior differs by
-filesystem and it needs fixing somehow.</p>
-
<a name="08-02-2019" /><a href="#08-02-2019"><hr><h2><b>February 8, 2019</b></h2></a>
<blockquote>
<p>"Most readers get as far as the Future Semiconditionally Modified
diff --git a/www/roadmap.html b/www/roadmap.html
index ba155dbb..9c284dba 100755
--- a/www/roadmap.html
+++ b/www/roadmap.html
@@ -6,14 +6,12 @@
<p>We have several potential use cases for a new set of command line
utilities, and are using those to determine which commands to implement
-for Toybox's 1.0 release. (Most of these have their own section in the
-<a href=status.html>status page</a>.)</p>
+for Toybox's 1.0 release.</p>
-<p>The most interesting publicly available standards are POSIX-2008
-(also known as the Single
+<p>The most interesting standards are POSIX-2008 (also known as the Single
Unix Specification version 4) and the Linux Standard Base (version 4.1).
-The main test harness is including toybox in <a href=https://landley.net/aboriginal/about.html>Aboriginal Linux</a> and if that can
-build itself using the result to <a href=https://github.com/landley/control-images>build Linux From Scratch</a> (version 6.8).
+The main test harness including toybox in Aboriginal Linux and if that can
+build itself using the result to build Linux From Scratch (version 6.8).
We also aim to replace Android's Toolbox.</p>
<p>At a secondary level we'd like to meet other use cases. We've analyzed
@@ -24,7 +22,7 @@ and some end user requests.</p>
<p>Finally, we'd like to provide a good replacement for the Bash shell,
which was the first program Linux ever ran and remains the standard shell
of Linux no matter what Ubuntu says. This doesn't mean including the full
-set of Bash 4.x functionality, but does involve {various,features} &lt(beyond)
+set of Bash 4.x functionality, but does involve {various,features} beyond
posix.</p>
<p>See the <a href=status.html>status page</a> for the combined list
@@ -48,33 +46,34 @@ and progress towards implementing it.</p>
<h2>Use case: standards compliance.</h2>
<h3><a name=susv4 /><a href="#susv4">POSIX-2008/SUSv4</a></h3>
-<p>The best standards describe reality rather than attempting to impose a
-new one. A good standard should document, not legislate.
-Standards which document existing reality tend to be approved by
-more than one standards body, such ANSI and ISO both approving C. That's why
+<p>The best standards are the kind that describe reality, rather than
+attempting to impose a new one. (I.E. a good standard should document, not
+legislate.)</p>
+
+<p>The kind of standards which describe existing reality tend to be approved by
+more than one standards body, such ANSI and ISO both approving C. That's why
the IEEE POSIX committee's 2008 standard, the Single Unix Specification version
4, and the Open Group Base Specification edition 7 are all the same standard
-from three sources, but most people just call it "posix" (portable operating
-system derived from unix). It's available <a href=https://pubs.opengroup.org/onlinepubs/9699919799>online in full</a>, and may be downloaded as a tarball.</p>
+from three sources.</p>
+
+<p>The <a href="http://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html">"utilities"
+section</a>
+of these standards is devoted to the unix command line, and are the best such
+standard for our purposes. (My earlier work on BusyBox was implemented with
+regard to SUSv3, an earlier version of this standard.)</p>
<h3>Problems with the standard</h3>
-<p>Unfortunately posix describes an incomplete subset of reality,
-lacking any mention of commands such as init or mount required to
-actually boot a system. It describes logname but not login. It provides ipcrm
-and ipcs, but not ipcmk, so you can use System V IPC resources but not create
-them. And widely used real-world commands such as tar and cpio (the basis
-of initramfs and RPM) which were present in earlier
-versions of the standard have been removed, while obsolete commands like
-cksum, sccs and uucp remain with no mention of modern counterparts like
-crc32/sha1sum, svn/git or scp/rsync. Meanwhile the commands themselves
-are missing dozens of features and specify silly things like ebcdic
-support in dd or that wc should use %d (not %ld) for byte counts. So
-we have to extensively filter posix to get a useful set of recommendations.</p>
-
-<p>Starting with the
-<a href="http://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html">full "utilities" list</a>,
-we first remove generally obsolete
+<p>Unfortunately, these standards describe a subset of reality, lacking any
+mention of commands such as init, login, or mount required to actually boot a
+system. It provides ipcrm and ipcs, but not ipcmk, so you can use System V IPC
+resources but not create them.</p>
+
+<p>These standards also contain a large number of commands that are
+inappropriate for toybox to implement in its 1.0 release. (Perhaps some of
+these could be reintroduced in later releases, but not now.)</p>
+
+<p>Starting with the full "utilities" list, we first remove generally obsolete
commands (compess ed ex pr uncompress uccp uustat uux), commands for the
pre-CVS "SCCS" source control system (admin delta get prs rmdel sact sccs unget
val what), fortran support (asa fort77), and batch processing support (batch
@@ -89,16 +88,22 @@ revisited later, but not for toybox 1.0.)</p>
separate executables (alias bg cd command fc fg getopts hash jobs kill read
type ulimit umask unalias wait). These may be revisited as part of a built-in
toybox shell, but are not exported into $PATH via symlinks. (If you fork a
-child process and have it "cd" then exit, you've accomplished nothing.)
-Again, what posix provides is incomplete: a shell also needs exit, if, while,
-for, case, export, set, unset, trap, exec... (And for bash compatibility
-function, source...)</p>
+child process and have it "cd" then exit, you've accomplished nothing.
+This is not a complete list, a shell also needs exit, if, while, for, case,
+export, set, unset, trap, exec... And for bash compatability, function and
+source.)</p>
+
+<blockquote><b>
+<span id=shell>
+alias bg cd command fc fg getopts hash jobs kill read type ulimit umask
+unalias wait exit if while for case export set unset trap exec function source
+</span>
+</b></blockquote>
<p>A few other commands are judgement calls, providing command-line
internationalization support (iconv locale localedef), System V inter-process
communication (ipcrm ipcs), and cross-tty communication from the minicomputer
-days (talk mesg write). The "pax" utility <a href=https://slashdot.org/story/06/09/04/1335226/debian-kicks-jrg-schilling>failed</a> to replace tar,
-"mailx" is
+days (talk mesg write). The "pax" utility was supplanted by tar, "mailx" is
a command line email client, and "lp" submits files for printing to... what
exactly? (cups?) The standard defines crontab but not crond.</p>
@@ -129,10 +134,9 @@ a truck through the holes and declare themselves compilant. But it means what
they DID standardize tends to be respected (if sometimes obsolete).</p>
<p>The Linux Standard Base's failure mode is different, they respond to
-pressure by including anything their members pay them enough to promote,
-such as allowing Red Hat to push
+pressure by including special-case crap, such as allowing Red Hat to shoehorn
RPM into the standard even though all sorts of distros (Debian, Slackware, Arch,
-Gentoo) don't use it and never will. This means anything in the LSB is
+Gentoo) don't use it and probably never will. This means anything in the LSB is
at best a suggestion: arbitrary portions of this standard are widely
ignored.</p>
@@ -172,7 +176,7 @@ for examples.)</p>
<p>Since we've already committed to using our own judgement to skip bits of
POSIX, and LSB's "judgement" in this regard is purely bug workarounds to declare
various legacy tool implementations "compliant", this means we're mostly
-interested in the set of LSB tools that aren't mentioned in posix.</p>
+interested in the set of tools that aren't specified in posix at all.</p>
<p>Of these, gettext and msgfmt are internationalization, install_initd and
remove_initd weren't present in Ubuntu 10.04, lpr is out of scope,
@@ -193,9 +197,14 @@ su sync tar umount useradd userdel usermod zcat
<a name="dev_env">
<h2><a href="#dev_env">Use case: provide a self-hosting development environment</a></h2>
-<p>The following commands were enough to build the <a href=http://landley.net/aboriginal/about.html>Aboriginal Linux</a> development
+<p>The following commands are enough to build the <a href=http://landley.net/aboriginal/about.html>Aboriginal Linux</a> development
environment, boot it to a shell prompt, and build <a href=http://www.linuxfromscratch.org/lfs/view/6.8/>Linux From Scratch 6.8</a> under it.</p>
+<p>This use case includes running init scripts and other shell scripts, running
+configure, make, and install in each package, and providing basic command line
+facilities such as a text editor. (It does not include a compiler toolchain or
+C library, those are outside the scope of this project.)</p>
+
<blockquote><b>
<span id=development>
bzcat cat cp dirname echo env patch rmdir sha1sum sleep sort sync
@@ -212,77 +221,57 @@ resize2fs tune2fs fsck.ext2 genext2fs mke2fs xzcat
</span>
</b></blockquote>
-<p>This use case includes running init scripts and other shell scripts, running
-configure, make, and install in each package, and providing basic command line
-facilities such as a text editor. (It does not include a compiler toolchain or
-C library, those are outside the scope of the toybox project, although mkroot
-has a <a href=https://landley.net/code/qcc>potentialy follow-up project</a>.
-For now we use distro toolchains,
-<a href=https://github.com/richfelker/musl-cross-make>musl-cross-make</a>,
-and the Android NDK for build testing.)
-That build system also instaled bash 2.05b as #!/bin/sh and its scripts
-required bash extensions not present in shells such as busybox ash.
-To replace that toysh needs to supply several bash extensions _and_ work
+<p>Aboriginal Linux also installs bash 2.05b as #!/bin/sh and its scripts
+require bash extensions not present in shells such as busybox ash.
+This means that toysh needs to supply several bash extensions _and_ work
when called under the name "bash".</p>
-<p>The development methodology used a <a href=http://landley.net/aboriginal/FAQ.html#debug_logging>command logging wrapper</a>
-that intercepted each command called out of the $PATH and append the
-command line to a log file, then <a href=https://github.com/landley/aboriginal/blob/master/more/report-recorded-commands.sh>analyze</a> the result to create a
-<a href=https://landley.net/notes-2008.html#23-01-2008>list of commands</a>,
-then <a href=https://github.com/landley/aboriginal/blob/master/host-tools.sh>create a directory of symlinks</a> pointing to those commands out of the
-host $PATH. Then the new implementation can replace these commands one
-at a time, checking the results and the log output to spot any behavior
-changes.</p>
-
-<h3>Stages and moving targets</h3>
-
-<p>This use case has two stages: 1) building a bootable system that can
-rebuild itself from source, and 2) a build environment capable
-of bootstrapping up to arbitrary complexity (as exemplified by building
-Linux From Scratch and Beyond Linux From Scratch under the resulting
-system). To accomplish just the first goal, the old build
-still needs the following busybox commands for which toybox does not yet
-supply adequate replacements:</p>
+<p>The <a href=http://landley.net/aboriginal>Aboriginal Linux</a>
+self-bootstrapping build still uses the following busybox commands,
+not yet supplied by toybox:</p>
-<blockquote><b>
-awk dd diff expr fdisk ftpd gzip less route sh sha512sum tr unxz vi wget xzcat
-</b></blockquote>
-
-<p>All of those except awk, ftpd, and less have partial implementations
-in "pending".</p>
+<blockquote><p>
+awk bunzip2 bzcat dd diff expr fdisk ftpd ftpget
+ftpput gunzip gzip less ping route sh
+sha512sum tar test tr unxz vi wget xzcat zcat
+</p></blockquote>
-<p>In 2017 Aboriginal Linux development ended, replaced by the
-<a href=https://github.com/landley/mkroot>mkroot</a> project
-designed to use an existing cross+native toolchain (such as
-<a href=https://github.com/richfelker/musl-cross-make>musl-cross-make</a>
-or the Android NDK) instead of building its own. In 2019 the still-incomplete
-mkroot was merged into toybox as the "make root" target. This is intended
-as a simpler way of providing essentially the same build environment, and doesn't
-significantly affect the rest of this analysis (although the "rebuild itself
-from source" test now includes building musl-cross-make under either mkroot
-or toybox's "make airlock" host environment).</p>
+<p>Many of those are in "pending". The remaining "difficult"
+commands are vi, awk, and sh.</p>
<p>Building Linux From Scratch is not the same as building the
<a href=https://source.android.com>Android Open Source Project</a>,
-but after toybox 1.0 we plan to try
-<a href=http://landley.net/aboriginal/about.html#hairball>modifying the AOSP build</a>
+but after toybox 1.0 focus may shift to <a href=http://landley.net/aboriginal/about.html#hairball>modifying the AOSP build</a>
to reduce dependencies. (It's fairly likely we'll have to add at least
a read-only git utility so repo can download the build's source code,
but that's actually <a href=https://www.youtube.com/watch?v=P7n6G2IL6eo>not
that hard</a>. We'll probably also need our own "make" at some point after
-1.0, which is its own moving target thanks to cmake and ninja and so on.)
-The ongoing Android <a href=http://lists.landley.net/pipermail/toybox-landley.net/2018-January/009330.html>hermetic build</a> work is already advancing
-this goal.</p>
+1.0.)</p>
+
+<p>Note: Aboriginal Linux was
+<a href=https://landley.net/aboriginal/news.html>restarted</a> (I.E. <a href=https://github.com/landley/mkroot>replaced</a>) due to toolchain licensing issues, but the new project is a simpler implementation of the same goals,
+and when finished should provide the same test environment for toybox.
+This section needs to be rewritten whem mkroot is complete enough to build
+Linux From Scratch.</p>
+
+<p>The development methodology used a <a href=http://landley.net/aboriginal/FAQ.html#debug_logging>command logging wrapper</a>
+that intercepted each command called out of the $PATH and append the
+command line to a log file, then <a href=https://github.com/landley/aboriginal/blob/master/more/report-recorded-commands.sh>analyze</a> the result to create a
+<a href=https://landley.net/notes-2008.html#23-01-2008>list of commands</a>,
+then <a href=https://github.com/landley/aboriginal/blob/master/host-tools.sh>create a directory of symlinks</a> pointing to those commands out of the
+host $PATH. Then the new implementation can replace these commands one
+at a time, checking the results and the log output to spot any behavior
+changes.</p>
<hr />
<h2><a name=android /><a href="#android">Use case: Replacing Android Toolbox</a></h2>
<p>Android has a policy against GPL in userspace, so even though BusyBox
predates Android by many years, they couldn't use it. Instead they grabbed
-an old version of ash (later replaced by
-<a href="https://www.mirbsd.org/mksh.htm">mksh</a>)
-and implemented their own command line utility set
-called "toolbox" (which toybox has already mostly replaced).</p>
+an old version of ash and implemented their own command line utility set
+called "toolbox". ash was later replaced by
+<a href="https://www.mirbsd.org/mksh.htm">mksh</a>; toolbox is being
+replaced by toybox.</p>
<p>Toolbox doesn't have its own repository, instead it's part of Android's
<a href=https://android.googlesource.com/platform/system/core>system/core
@@ -294,19 +283,16 @@ notes</a>.</p>
<h3>Toolbox commands:</h3>
-<p>According to <a href=https://android.googlesource.com/platform/system/core/+/master/toolbox/Android.bp>
-system/core/toolbox/Android.bp</a> the toolbox directory builds the
+<p>According to <a href=https://android.googlesource.com/platform/system/core/+/master/toolbox/Android.mk>
+system/core/toolbox/Android.mk</a> the toolbox directory builds the
following commands:</p>
<blockquote><b>
-getevent getprop modprobe setprop start
+dd getevent newfs_msdos
</b></blockquote>
-<p>getprop/setprop/start were in toybox and moved back because they're so
-tied to non-public system interfaces. modprobe shares the implementation
-used in init. getevent probably does make sense as a toybox command, but at the
-moment it's built with a python script that pulls all the constants from the
-latest kernel headers, which is very convenient.</p>
+<p>The toolbox makefile also builds the BSD grep right now, because toybox
+grep is missing <code>--color</code>.</p>
<h3>Other Android /system/bin commands</h3>
@@ -336,42 +322,35 @@ binaries in /system/bin are:</p>
<li><b>traceroute/traceroute6</b> - trace network route (iputils)</li>
</ul>
-<p>The names in parentheses are the upstream source of the command.</p>
+<p>The names in parentheses are the source.</p>
<h3>Analysis</h3>
-<p>For reference, combining everything listed above that's still "fair game"
-for toybox, we get:</p>
+<p>For reference, combining everything listed above, we get:</p>
<blockquote><b>
arping blkid e2fsck dd fsck.f2fs fsck_msdos getevent gzip ip iptables
-ip6tables iw logwrapper make_ext4fs make_f2fs modpobe newfs_msdos ping ping6
+ip6tables iw logwrapper make_ext4fs make_f2fs newfs_msdos ping ping6
reboot resize2fs sh ss tc tracepath tracepath6 traceroute traceroute6
</b></blockquote>
<p>We may eventually implement all of that, but for toybox 1.0 we need to
-focus a bit. If Android has an acceptable external package, and the command
-isn't needed for system bootstrapping, replacing the external package is
-not a priority.</p>
+focus a bit. For our first pass, let's just replace all the "toolbox"
+commands.</p>
-<p>However, several commands toybox plans to implement anyway could potentially
-replace existing Android versions, so we should take into account Android's use
-cases when doing so. This includes:</p>
+<p>This means toybox should implement (or finish implementing):</p>
<blockquote><b>
<span id=toolbox>
-dd getevent gzip modprobe newfs_msdos sh
+dd getevent grep gzip newfs_msdos
</span>
</b></blockquote>
-<p>Update: <a href=https://android.googlesource.com/platform/system/core/+/master/system/core/Android.bp>
-external/toybox/Android.bp</a> has symlinks for the following toys out
-of "pending". (The toybox modprobe is also built for the device, but
-it isn't actually used and is only there for sanity checking against
-the libmodprobe-based implementation.) These should be a priority for
-cleanup:</p>
+<p>Update: Android.mk is currently building the following toybox files out
+of "pending". These should be a priority for cleanup (ones marked with *
+don't have a symlink, so they're a lot less visible):</p>
<blockquote><b>
-bc dd diff expr getfattr lsof more stty tr traceroute
+chrt dd expr getfattr* lsof modprobe more setfattr* tar tr traceroute
</b></blockquote>
<p>Android wishlist:</p>
@@ -383,10 +362,8 @@ mtools genvfatfs mke2fs gene2fs
<hr />
<h2><a name=aosp /><a href="#aosp">Use case: Building AOSP</a></h2>
-<p>The list of external tools used to build AOSP was
-<a href="https://android.googlesource.com/platform/build/soong/+/master/ui/build/paths/config.go">here</a>,
-but as they're switched over to toybox they disappear and reappear
-<a href="https://android.googlesource.com/platform/prebuilts/build-tools/+/refs/heads/master/path/linux-x86/">here</a>.</p>
+<p>The list of external tools used to build AOSP is
+<a href="https://android.googlesource.com/platform/build/soong/+/master/ui/build/paths/config.go">here</a>.</p>
<blockquote><b>
awk basename bash bc bzip2 cat chmod cmp comm cp cut date dd diff dirname du