From eb7e847adcecf11cd8fd99077ba3a582abe60146 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 25 May 2017 17:56:11 -0700 Subject: Be more consistent about periods in help text. --- toys/lsb/md5sum.c | 4 ++-- toys/lsb/pidof.c | 2 +- toys/lsb/seq.c | 2 +- toys/lsb/umount.c | 8 ++++---- toys/net/netcat.c | 2 +- toys/other/bzcat.c | 2 +- toys/other/chcon.c | 6 +++--- toys/other/eject.c | 2 +- toys/other/flock.c | 8 ++++---- toys/other/fsync.c | 2 +- toys/other/lsattr.c | 42 +++++++++++++++++++++--------------------- toys/other/oneit.c | 8 ++++---- toys/other/pmap.c | 4 ++-- toys/other/reboot.c | 2 +- toys/other/rmmod.c | 2 +- toys/other/taskset.c | 6 +++--- toys/other/timeout.c | 2 +- toys/other/truncate.c | 2 +- toys/other/xxd.c | 12 ++++++------ toys/pending/getfattr.c | 6 +++--- toys/pending/klogd.c | 2 +- toys/pending/last.c | 4 ++-- toys/pending/mdev.c | 2 +- toys/pending/setfattr.c | 8 ++++---- toys/pending/sh.c | 4 ++-- toys/pending/syslogd.c | 2 +- toys/posix/cat.c | 8 ++++---- toys/posix/chgrp.c | 4 ++-- toys/posix/cut.c | 12 ++++++------ toys/posix/df.c | 2 +- toys/posix/echo.c | 2 +- toys/posix/head.c | 2 +- toys/posix/mkdir.c | 4 ++-- toys/posix/od.c | 2 +- toys/posix/rmdir.c | 2 +- toys/posix/sed.c | 8 ++++---- toys/posix/sort.c | 2 +- toys/posix/tail.c | 2 +- toys/posix/tee.c | 4 ++-- 39 files changed, 100 insertions(+), 100 deletions(-) diff --git a/toys/lsb/md5sum.c b/toys/lsb/md5sum.c index 9efdc872..fbad784a 100644 --- a/toys/lsb/md5sum.c +++ b/toys/lsb/md5sum.c @@ -30,7 +30,7 @@ config MD5SUM Output one hash (32 hex digits) for each input file, followed by filename. -b brief (hash only, no filename) - -c Check each line of FILE is the same hash+filename we'd output. + -c Check each line of FILE is the same hash+filename we'd output config SHA1SUM bool "sha1sum" @@ -43,7 +43,7 @@ config SHA1SUM and 128 for sha512) for each input file, followed by filename. -b brief (hash only, no filename) - -c Check each line of FILE is the same hash+filename we'd output. + -c Check each line of FILE is the same hash+filename we'd output config SHA224SUM bool "sha224sum" diff --git a/toys/lsb/pidof.c b/toys/lsb/pidof.c index e1facfa8..40e732b5 100644 --- a/toys/lsb/pidof.c +++ b/toys/lsb/pidof.c @@ -15,7 +15,7 @@ config PIDOF Print the PIDs of all processes with the given names. - -s single shot, only return one pid. + -s single shot, only return one pid -o omit PID(s) */ diff --git a/toys/lsb/seq.c b/toys/lsb/seq.c index 0202c670..d5a6c0d1 100644 --- a/toys/lsb/seq.c +++ b/toys/lsb/seq.c @@ -19,7 +19,7 @@ config SEQ -f Use fmt_str as a printf-style floating point format string -s Use sep_str as separator, default is a newline character - -w Pad to equal width with leading zeroes. + -w Pad to equal width with leading zeroes */ #define FOR_seq diff --git a/toys/lsb/umount.c b/toys/lsb/umount.c index e6994f19..cebe2f0a 100644 --- a/toys/lsb/umount.c +++ b/toys/lsb/umount.c @@ -19,11 +19,11 @@ config UMOUNT Unmount the listed filesystems. -a Unmount all mounts in /proc/mounts instead of command line list - -D Don't free loopback device(s). - -f Force unmount. - -l Lazy unmount (detach from filesystem now, close when last user does). + -D Don't free loopback device(s) + -f Force unmount + -l Lazy unmount (detach from filesystem now, close when last user does) -n Don't use /proc/mounts - -r Remount read only if unmounting fails. + -r Remount read only if unmounting fails -t Restrict "all" to mounts of TYPE (or use "noTYPE" to skip) -v Verbose */ diff --git a/toys/net/netcat.c b/toys/net/netcat.c index 24420d6b..13ba3114 100644 --- a/toys/net/netcat.c +++ b/toys/net/netcat.c @@ -15,7 +15,7 @@ config NETCAT -f use FILENAME (ala /dev/ttyS0) instead of network -p local port number - -q quit SECONDS after EOF on stdin, even if stdout hasn't closed yet. + -q quit SECONDS after EOF on stdin, even if stdout hasn't closed yet -s local source address -w SECONDS timeout to establish connection -W SECONDS timeout for idle connection diff --git a/toys/other/bzcat.c b/toys/other/bzcat.c index ff598491..6e8d0e85 100644 --- a/toys/other/bzcat.c +++ b/toys/other/bzcat.c @@ -24,7 +24,7 @@ config BUNZIP2 Read from stdin if no files listed. -c force output to stdout - -f force decompression. (If FILE doesn't end in .bz, replace original.) + -f force decompression (if FILE doesn't end in .bz, replace original) -k keep input files (-c and -t imply this) -t test integrity -v verbose diff --git a/toys/other/chcon.c b/toys/other/chcon.c index 6dbdd13f..a071eef5 100644 --- a/toys/other/chcon.c +++ b/toys/other/chcon.c @@ -13,9 +13,9 @@ config CHCON Change the SELinux security context of listed file[s]. - -h change symlinks instead of what they point to. - -R recurse into subdirectories. - -v verbose output. + -h change symlinks instead of what they point to + -R recurse into subdirectories + -v verbose output */ #define FOR_chcon diff --git a/toys/other/eject.c b/toys/other/eject.c index 31eab144..bd7af567 100644 --- a/toys/other/eject.c +++ b/toys/other/eject.c @@ -17,7 +17,7 @@ config EJECT -s SCSI device -t Close tray - -T Open/close tray (toggle). + -T Open/close tray (toggle) */ #define FOR_eject diff --git a/toys/other/flock.c b/toys/other/flock.c index 5f0190a9..3dc75870 100644 --- a/toys/other/flock.c +++ b/toys/other/flock.c @@ -12,10 +12,10 @@ config FLOCK Manage advisory file locks. - -s Shared lock. - -x Exclusive lock (default). - -u Unlock. - -n Non-blocking: fail rather than wait for the lock. + -s Shared lock + -x Exclusive lock (default) + -u Unlock + -n Non-blocking: fail rather than wait for the lock */ #define FOR_flock diff --git a/toys/other/fsync.c b/toys/other/fsync.c index bd73f398..d7812b90 100644 --- a/toys/other/fsync.c +++ b/toys/other/fsync.c @@ -14,7 +14,7 @@ config FSYNC Synchronize a file's in-core state with storage device. - -d Avoid syncing metadata. + -d Avoid syncing metadata */ #define FOR_fsync diff --git a/toys/other/lsattr.c b/toys/other/lsattr.c index 8b91ef78..a361dc8e 100644 --- a/toys/other/lsattr.c +++ b/toys/other/lsattr.c @@ -19,11 +19,11 @@ config LSATTR List file attributes on a Linux second extended file system. (AacDdijsStu defined in chattr --help) - -R Recursively list attributes of directories and their contents. - -a List all files in directories, including files that start with '.'. - -d List directories like other files, rather than listing their contents. - -l List long flag names. - -v List the file's version/generation number. + -R Recursively list attributes of directories and their contents + -a List all files in directories, including files that start with '.' + -d List directories like other files, rather than listing their contents + -l List long flag names + -v List the file's version/generation number config CHATTR bool "chattr" @@ -33,26 +33,26 @@ config CHATTR Change file attributes on a Linux second extended file system. - -R Recurse. - -v Set the file's version/generation number. + -R Recurse + -v Set the file's version/generation number Operators: - '-' Remove attributes. - '+' Add attributes. - '=' Set attributes. + '-' Remove attributes + '+' Add attributes + '=' Set attributes Attributes: - A Don't track atime. - a Append mode only. - c Enable compress. - D Write dir contents synchronously. - d Don't backup with dump. - i Cannot be modified (immutable). - j Write all data to journal first. - s Zero disk storage when deleted. - S Write file contents synchronously. - t Disable tail-merging of partial blocks with other files. - u Allow file to be undeleted. + A Don't track atime + a Append mode only + c Enable compress + D Write dir contents synchronously + d Don't backup with dump + i Cannot be modified (immutable) + j Write all data to journal first + s Zero disk storage when deleted + S Write file contents synchronously + t Disable tail-merging of partial blocks with other files + u Allow file to be undeleted */ #define FOR_lsattr #include "toys.h" diff --git a/toys/other/oneit.c b/toys/other/oneit.c index 68b5bd8c..24bd45c6 100644 --- a/toys/other/oneit.c +++ b/toys/other/oneit.c @@ -13,10 +13,10 @@ config ONEIT Simple init program that runs a single supplied command line with a controlling tty (so CTRL-C can kill it). - -c Which console device to use (/dev/console doesn't do CTRL-C, etc). - -p Power off instead of rebooting when command exits. - -r Restart child when it exits. - -3 Write 32 bit PID of each exiting reparented process to fd 3 of child. + -c Which console device to use (/dev/console doesn't do CTRL-C, etc) + -p Power off instead of rebooting when command exits + -r Restart child when it exits + -3 Write 32 bit PID of each exiting reparented process to fd 3 of child (Blocking writes, child must read to avoid eventual deadlock.) Spawns a single child process (because PID 1 has signals blocked) diff --git a/toys/other/pmap.c b/toys/other/pmap.c index a93ea3ee..abb0a337 100644 --- a/toys/other/pmap.c +++ b/toys/other/pmap.c @@ -15,8 +15,8 @@ config PMAP Reports the memory map of a process or processes. - -x Show the extended format. - -q Do not display some header/footer lines. + -x Show the extended format + -q Do not display some header/footer lines */ #define FOR_pmap diff --git a/toys/other/reboot.c b/toys/other/reboot.c index 15eea285..c883e340 100644 --- a/toys/other/reboot.c +++ b/toys/other/reboot.c @@ -15,7 +15,7 @@ config REBOOT Restart, halt or powerdown the system. -f Don't signal init - -n Don't sync before stopping the system. + -n Don't sync before stopping the system */ #define FOR_reboot diff --git a/toys/other/rmmod.c b/toys/other/rmmod.c index 10c134c2..d9f0a15a 100644 --- a/toys/other/rmmod.c +++ b/toys/other/rmmod.c @@ -12,7 +12,7 @@ config RMMOD Unload the module named MODULE from the Linux kernel. -f Force unload of a module - -w Wait until the module is no longer used. + -w Wait until the module is no longer used */ diff --git a/toys/other/taskset.c b/toys/other/taskset.c index abc38723..8ffdab78 100644 --- a/toys/other/taskset.c +++ b/toys/other/taskset.c @@ -13,7 +13,7 @@ config NPROC Print number of processors. - --all Show all processors, not just ones this task can run on. + --all Show all processors, not just ones this task can run on config TASKSET bool "taskset" @@ -27,8 +27,8 @@ config TASKSET Mask is a hex string where each bit represents a processor the process is allowed to run on. PID without a mask displays existing affinity. - -p Set/get the affinity of given PID instead of a new command. - -a Set/get the affinity of all threads of the PID. + -p Set/get the affinity of given PID instead of a new command + -a Set/get the affinity of all threads of the PID */ #define FOR_taskset diff --git a/toys/other/timeout.c b/toys/other/timeout.c index e39dc7a3..9b93466a 100644 --- a/toys/other/timeout.c +++ b/toys/other/timeout.c @@ -20,7 +20,7 @@ config TIMEOUT (minutes), "h" (hours), "d" (days), or "s" (seconds, the default). -s Send specified signal (default TERM) - -k Send KILL signal if child still running this long after first signal. + -k Send KILL signal if child still running this long after first signal -v Verbose */ diff --git a/toys/other/truncate.c b/toys/other/truncate.c index 6092d5a9..142d3c7a 100644 --- a/toys/other/truncate.c +++ b/toys/other/truncate.c @@ -12,7 +12,7 @@ config TRUNCATE Set length of file(s), extending sparsely if necessary. - -c Don't create file if it doesn't exist. + -c Don't create file if it doesn't exist -s New size (with optional prefix and suffix) SIZE prefix: + add, - subtract, < shrink to, > expand to, diff --git a/toys/other/xxd.c b/toys/other/xxd.c index 99de2ee2..0ff5947f 100644 --- a/toys/other/xxd.c +++ b/toys/other/xxd.c @@ -16,12 +16,12 @@ config XXD Hexdump a file to stdout. If no file is listed, copy from stdin. Filename "-" is a synonym for stdin. - -c n Show n bytes per line (default 16). - -g n Group bytes by adding a ' ' every n bytes (default 2). - -l n Limit of n bytes before stopping (default is no limit). - -p Plain hexdump (30 bytes/line, no grouping). - -r Reverse operation: turn a hexdump into a binary file. - -s n Skip to offset n. + -c n Show n bytes per line (default 16) + -g n Group bytes by adding a ' ' every n bytes (default 2) + -l n Limit of n bytes before stopping (default is no limit) + -p Plain hexdump (30 bytes/line, no grouping) + -r Reverse operation: turn a hexdump into a binary file + -s n Skip to offset n */ #define FOR_xxd diff --git a/toys/pending/getfattr.c b/toys/pending/getfattr.c index b17cdc1d..c58994d6 100644 --- a/toys/pending/getfattr.c +++ b/toys/pending/getfattr.c @@ -14,9 +14,9 @@ config GETFATTR Read POSIX extended attributes. - -d Show values as well as names. - -h Do not dereference symbolic links. - -n Show only attributes with the given name. + -d Show values as well as names + -h Do not dereference symbolic links + -n Show only attributes with the given name */ #define FOR_getfattr diff --git a/toys/pending/klogd.c b/toys/pending/klogd.c index d950981d..517edafd 100644 --- a/toys/pending/klogd.c +++ b/toys/pending/klogd.c @@ -14,7 +14,7 @@ config KLOGD usage: klogd [-n] [-c N] -c N Print to console messages more urgent than prio N (1-8)" - -n Run in foreground. + -n Run in foreground config KLOGD_SOURCE_RING_BUFFER bool "enable kernel ring buffer as log source." diff --git a/toys/pending/last.c b/toys/pending/last.c index 4b7b472e..fd33ad53 100644 --- a/toys/pending/last.c +++ b/toys/pending/last.c @@ -15,8 +15,8 @@ config LAST Show listing of last logged in users. - -W Display the information without host-column truncation. - -f FILE Read from file FILE instead of /var/log/wtmp. + -W Display the information without host-column truncation + -f FILE Read from file FILE instead of /var/log/wtmp */ #define FOR_last diff --git a/toys/pending/mdev.c b/toys/pending/mdev.c index 1cf4e7cd..a270e520 100644 --- a/toys/pending/mdev.c +++ b/toys/pending/mdev.c @@ -13,7 +13,7 @@ config MDEV Create devices in /dev using information from /sys. - -s Scan all entries in /sys to populate /dev. + -s Scan all entries in /sys to populate /dev config MDEV_CONF bool "Configuration file for mdev" diff --git a/toys/pending/setfattr.c b/toys/pending/setfattr.c index 9a41a4da..7e8bae24 100644 --- a/toys/pending/setfattr.c +++ b/toys/pending/setfattr.c @@ -14,10 +14,10 @@ config SETFATTR Write POSIX extended attributes. - -h Do not dereference symlink. - -n Set given attribute. - -x Remove given attribute. - -v Set value for attribute -n (default is empty). + -h Do not dereference symlink + -n Set given attribute + -x Remove given attribute + -v Set value for attribute -n (default is empty) */ #define FOR_setfattr diff --git a/toys/pending/sh.c b/toys/pending/sh.c index 76b4e13b..0bfd32c5 100644 --- a/toys/pending/sh.c +++ b/toys/pending/sh.c @@ -67,8 +67,8 @@ config CD Change current directory. With no arguments, go $HOME. - -P Physical path: resolve symlinks in path. - -L Local path: .. trims directories off $PWD (default). + -P Physical path: resolve symlinks in path + -L Local path: .. trims directories off $PWD (default) config EXIT bool diff --git a/toys/pending/syslogd.c b/toys/pending/syslogd.c index 73542cac..50d93189 100644 --- a/toys/pending/syslogd.c +++ b/toys/pending/syslogd.c @@ -20,7 +20,7 @@ config SYSLOGD -O FILE Default log file -f FILE Config file -p Alternative unix domain socket - -n Avoid auto-backgrounding. + -n Avoid auto-backgrounding -S Smaller output -m MARK interval (RANGE: 0 to 71582787) -R HOST Log to IP or hostname on PORT (default PORT=514/UDP)" diff --git a/toys/posix/cat.c b/toys/posix/cat.c index 4da2ec27..bc77f04b 100644 --- a/toys/posix/cat.c +++ b/toys/posix/cat.c @@ -19,7 +19,7 @@ config CAT Copy (concatenate) files to stdout. If no files listed, copy from stdin. Filename "-" is a synonym for stdin. - -u Copy one byte at a time (slow). + -u Copy one byte at a time (slow) config CAT_V bool "cat -etv" @@ -30,8 +30,8 @@ config CAT_V -e Mark each newline with $ -t Show tabs as ^I - -v Display nonprinting characters as escape sequences. Use M-x for - high ascii characters (>127), and ^x for other nonprinting chars. + -v Display nonprinting characters as escape sequences with M-x for + high ascii characters (>127), and ^x for other nonprinting chars config CATV bool "catv" @@ -44,7 +44,7 @@ config CATV -e Mark each newline with $ -t Show tabs as ^I - -v Don't use ^x or M-x escapes. + -v Don't use ^x or M-x escapes */ #define FOR_cat diff --git a/toys/posix/chgrp.c b/toys/posix/chgrp.c index 62e9eb1d..e6ea9a45 100644 --- a/toys/posix/chgrp.c +++ b/toys/posix/chgrp.c @@ -18,11 +18,11 @@ config CHGRP -f suppress most error messages. -h change symlinks instead of what they point to - -R recurse into subdirectories (implies -h). + -R recurse into subdirectories (implies -h) -H with -R change target of symlink, follow command line symlinks -L with -R change target of symlink, follow all symlinks -P with -R change symlink, do not follow symlinks (default) - -v verbose output. + -v verbose output config CHOWN bool "chown" diff --git a/toys/posix/cut.c b/toys/posix/cut.c index 13be5e74..2cb3ef19 100644 --- a/toys/posix/cut.c +++ b/toys/posix/cut.c @@ -17,12 +17,12 @@ config CUT Print selected parts of lines from each FILE to standard output. - -b LIST select only these bytes from LIST. - -c LIST select only these characters from LIST. - -f LIST select only these fields. - -d DELIM use DELIM instead of TAB for field delimiter. - -s do not print lines not containing delimiters. - -n don't split multibyte characters (Ignored). + -b LIST select only these bytes from LIST + -c LIST select only these characters from LIST + -f LIST select only these fields + -d DELIM use DELIM instead of TAB for field delimiter + -s do not print lines not containing delimiters + -n don't split multibyte characters (ignored) */ #define FOR_cut #include "toys.h" diff --git a/toys/posix/df.c b/toys/posix/df.c index eb506a4c..9c6b2c3f 100644 --- a/toys/posix/df.c +++ b/toys/posix/df.c @@ -21,7 +21,7 @@ config DF -k Sets units back to 1024 bytes (the default without -P) -h Human readable output (K=1024) -H Human readable output (k=1000) - -t type Display only filesystems of this type. + -t type Display only filesystems of this type Pedantic provides a slightly less useful output format dictated by Posix, and sets the units to 512 bytes instead of the default 1024 bytes. diff --git a/toys/posix/echo.c b/toys/posix/echo.c index 33de6781..f16b7910 100644 --- a/toys/posix/echo.c +++ b/toys/posix/echo.c @@ -20,7 +20,7 @@ config ECHO Write each argument to stdout, with one space between each, followed by a newline. - -n No trailing newline. + -n No trailing newline -e Process the following escape sequences: \\ backslash \0NNN octal values (1 to 3 digits) diff --git a/toys/posix/head.c b/toys/posix/head.c index f300760d..e3d78866 100644 --- a/toys/posix/head.c +++ b/toys/posix/head.c @@ -15,7 +15,7 @@ config HEAD Copy first lines from files to stdout. If no files listed, copy from stdin. Filename "-" is a synonym for stdin. - -n Number of lines to copy. + -n Number of lines to copy */ #define FOR_head diff --git a/toys/posix/mkdir.c b/toys/posix/mkdir.c index 95bdf333..e88a2988 100644 --- a/toys/posix/mkdir.c +++ b/toys/posix/mkdir.c @@ -14,8 +14,8 @@ config MKDIR Create one or more directories. - -m set permissions of directory to mode. - -p make parent directories as needed. + -m set permissions of directory to mode + -p make parent directories as needed -v verbose config MKDIR_Z diff --git a/toys/posix/od.c b/toys/posix/od.c index 5ccea58c..ea7f6ac5 100644 --- a/toys/posix/od.c +++ b/toys/posix/od.c @@ -20,7 +20,7 @@ config OD plus optional size in bytes aliases: -b=-t o1, -c=-t c, -d=-t u2, -o=-t o2, -s=-t d2, -x=-t x2 -v Don't collapse repeated lines together - -w Total line width in bytes (default 16). + -w Total line width in bytes (default 16) */ #define FOR_od diff --git a/toys/posix/rmdir.c b/toys/posix/rmdir.c index 7421bb38..90920ef6 100644 --- a/toys/posix/rmdir.c +++ b/toys/posix/rmdir.c @@ -14,7 +14,7 @@ config RMDIR Remove one or more directories. - -p Remove path. + -p Remove path */ #include "toys.h" diff --git a/toys/posix/sed.c b/toys/posix/sed.c index 2fcd7624..cf7d15e9 100644 --- a/toys/posix/sed.c +++ b/toys/posix/sed.c @@ -23,10 +23,10 @@ config SED -e add SCRIPT to list -f add contents of SCRIPT_FILE to list - -i Edit each file in place. - -n No default output. (Use the p command to output matched lines.) - -r Use extended regular expression syntax. - -E Alias for -r. + -i Edit each file in place + -n No default output (use the p command to output matched lines) + -r Use extended regular expression syntax + -E Alias for -r -s Treat input files separately (implied by -i) A SCRIPT is a series of one or more COMMANDs separated by newlines or diff --git a/toys/posix/sort.c b/toys/posix/sort.c index 2b0f5c08..1cb5b191 100644 --- a/toys/posix/sort.c +++ b/toys/posix/sort.c @@ -33,7 +33,7 @@ config SORT_BIG -d dictionary order (use alphanumeric and whitespace chars only) -f force uppercase (case insensitive sort) -i ignore nonprinting characters - -M month sort (jan, feb, etc). + -M month sort (jan, feb, etc) -x Hexadecimal numerical sort -s skip fallback sort (only sort with keys) -z zero (null) terminated lines diff --git a/toys/posix/tail.c b/toys/posix/tail.c index 22b5ac6d..675d815d 100644 --- a/toys/posix/tail.c +++ b/toys/posix/tail.c @@ -17,7 +17,7 @@ config TAIL Copy last lines from files to stdout. If no files listed, copy from stdin. Filename "-" is a synonym for stdin. - -n output the last NUMBER lines (default 10), +X counts from start. + -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 diff --git a/toys/posix/tee.c b/toys/posix/tee.c index 6167c8ad..5936b7b3 100644 --- a/toys/posix/tee.c +++ b/toys/posix/tee.c @@ -15,8 +15,8 @@ config TEE Copy stdin to each listed file, and also to stdout. Filename "-" is a synonym for stdout. - -a append to files. - -i ignore SIGINT. + -a append to files + -i ignore SIGINT */ #define FOR_tee -- cgit v1.2.3 From 8fb41fc77ff29091a562c42f6ad83ba19d24fa03 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 27 May 2017 14:57:45 -0500 Subject: Add separators in help -a with command name. --- toys/other/help.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/toys/other/help.c b/toys/other/help.c index 4722528c..f7d84817 100644 --- a/toys/other/help.c +++ b/toys/other/help.c @@ -68,6 +68,11 @@ void help_main(void) for (i = 0; i < toys.toycount; i++) { if (toys.optflags & FLAG_h) xprintf("
\n
\n");
+    else {
+      memset(toybuf, '-', 78);
+      memcpy(toybuf+3, toy_list[i].name, strlen(toy_list[i].name));
+      printf("%s\n\n", toybuf);
+    }
     do_help(toy_list+i);
     if (toys.optflags & FLAG_h) xprintf("
\n"); } -- cgit v1.2.3 From cf2e8d08b3e06a7bdf95c30282a976bbf072a168 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 27 May 2017 15:54:16 -0500 Subject: Replace two space indents with tab indents in help text (for consistency). --- toys/lsb/hostname.c | 4 ++-- toys/other/bzcat.c | 2 +- toys/other/lsattr.c | 14 +++++++------- toys/posix/cat.c | 6 +++--- toys/posix/comm.c | 6 +++--- toys/posix/du.c | 24 ++++++++++++------------ 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/toys/lsb/hostname.c b/toys/lsb/hostname.c index f30d1fbd..0a1f9b18 100644 --- a/toys/lsb/hostname.c +++ b/toys/lsb/hostname.c @@ -14,8 +14,8 @@ config HOSTNAME Get/Set the current hostname - -b Set hostname to 'localhost' if otherwise unset - -F Set hostname to contents of FILENAME + -b Set hostname to 'localhost' if otherwise unset + -F Set hostname to contents of FILENAME */ #define FOR_hostname diff --git a/toys/other/bzcat.c b/toys/other/bzcat.c index 6e8d0e85..0c79773a 100644 --- a/toys/other/bzcat.c +++ b/toys/other/bzcat.c @@ -26,7 +26,7 @@ config BUNZIP2 -c force output to stdout -f force decompression (if FILE doesn't end in .bz, replace original) -k keep input files (-c and -t imply this) - -t test integrity + -t test integrity -v verbose config BZCAT diff --git a/toys/other/lsattr.c b/toys/other/lsattr.c index a361dc8e..ec7d88e5 100644 --- a/toys/other/lsattr.c +++ b/toys/other/lsattr.c @@ -19,11 +19,11 @@ config LSATTR List file attributes on a Linux second extended file system. (AacDdijsStu defined in chattr --help) - -R Recursively list attributes of directories and their contents - -a List all files in directories, including files that start with '.' - -d List directories like other files, rather than listing their contents - -l List long flag names - -v List the file's version/generation number + -R Recursively list attributes of directories and their contents + -a List all files in directories, including files that start with '.' + -d List directories like other files, rather than listing their contents + -l List long flag names + -v List the file's version/generation number config CHATTR bool "chattr" @@ -33,8 +33,8 @@ config CHATTR Change file attributes on a Linux second extended file system. - -R Recurse - -v Set the file's version/generation number + -R Recurse + -v Set the file's version/generation number Operators: '-' Remove attributes diff --git a/toys/posix/cat.c b/toys/posix/cat.c index bc77f04b..a0e2d56b 100644 --- a/toys/posix/cat.c +++ b/toys/posix/cat.c @@ -42,9 +42,9 @@ config CATV Display nonprinting characters as escape sequences. Use M-x for high ascii characters (>127), and ^x for other nonprinting chars. - -e Mark each newline with $ - -t Show tabs as ^I - -v Don't use ^x or M-x escapes + -e Mark each newline with $ + -t Show tabs as ^I + -v Don't use ^x or M-x escapes */ #define FOR_cat diff --git a/toys/posix/comm.c b/toys/posix/comm.c index ded262f5..3e93de4f 100644 --- a/toys/posix/comm.c +++ b/toys/posix/comm.c @@ -17,9 +17,9 @@ config COMM columns as output: lines only in FILE1; lines only in FILE2; and lines in both files. Filename "-" is a synonym for stdin. - -1 suppress the output column of lines unique to FILE1 - -2 suppress the output column of lines unique to FILE2 - -3 suppress the output column of lines duplicated in FILE1 and FILE2 + -1 suppress the output column of lines unique to FILE1 + -2 suppress the output column of lines unique to FILE2 + -3 suppress the output column of lines duplicated in FILE1 and FILE2 */ #define FOR_comm diff --git a/toys/posix/du.c b/toys/posix/du.c index fad46a32..0d9a676d 100644 --- a/toys/posix/du.c +++ b/toys/posix/du.c @@ -17,20 +17,20 @@ config DU Show disk usage, space consumed by files and directories. Size in: - -k 1024 byte blocks (default) - -K 512 byte blocks (posix) - -m megabytes - -h human readable format (e.g., 1K 243M 2G ) + -k 1024 byte blocks (default) + -K 512 byte blocks (posix) + -m megabytes + -h human readable format (e.g., 1K 243M 2G ) What to show: - -a all files, not just directories - -H follow symlinks on cmdline - -L follow all symlinks - -s only total size of each argument - -x don't leave this filesystem - -c cumulative total - -d N only depth < N - -l disable hardlink filter + -a all files, not just directories + -H follow symlinks on cmdline + -L follow all symlinks + -s only total size of each argument + -x don't leave this filesystem + -c cumulative total + -d N only depth < N + -l disable hardlink filter */ #define FOR_du -- cgit v1.2.3 From 1abba7db3df9cd4b7e86355504d39a29312ebedb Mon Sep 17 00:00:00 2001 From: Ilya Kuzmich Date: Sun, 28 May 2017 17:03:26 +0300 Subject: teach head -v and -q Not POSIX, but implemented in coreutils and busybox. Tests use sed to compensate for the stdin naming difference. Signed-off-by: Ilya Kuzmich --- tests/head.test | 10 ++++++++++ toys/posix/head.c | 10 +++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/head.test b/tests/head.test index 83d93996..6ed027c4 100755 --- a/tests/head.test +++ b/tests/head.test @@ -11,9 +11,19 @@ testing "-number" "head -2 input && echo yes" "one\ntwo\nyes\n" \ "one\ntwo\nthree\nfour" "" testing "head, default lines" "head" "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n" "" "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12" +# coreutils & busybox name stdin as "standard input", toybox uses "-" +testing "-v file" "head -v -n 1 input" "==> input <==\none\n" "one\ntwo\n" "" +testing "-v stdin" "head -v -n 1 | sed 's/==> standard input <==/==> - <==/'" \ + "==> - <==\none\n" "" "one\ntwo\n" + +testing "file and stdin" "head -n 1 input - | sed 's/==> standard input <==/==> - <==/'" \ + "==> input <==\none\n\n==> - <==\nfoo\n" "one\ntwo\n" "foo\nbar\n" + echo "foo bar baz" > file1 testing "head, multiple files" "head -n 2 input file1" "==> input <==\none\ntwo\n\n==> file1 <==\nfoo\nbar\n" "one\ntwo\nthree\n" "" +testing "-q, multiple files" "head -q -n 2 input file1" "one\ntwo\nfoo\nbar\n" \ + "one\ntwo\nthree\n" "" rm file1 diff --git a/toys/posix/head.c b/toys/posix/head.c index e3d78866..63eb85b0 100644 --- a/toys/posix/head.c +++ b/toys/posix/head.c @@ -4,7 +4,7 @@ * * See http://opengroup.org/onlinepubs/9699919799/utilities/head.html -USE_HEAD(NEWTOY(head, "?n#<0=10", TOYFLAG_USR|TOYFLAG_BIN)) +USE_HEAD(NEWTOY(head, "?n#<0=10qv", TOYFLAG_USR|TOYFLAG_BIN)) config HEAD bool "head" @@ -16,6 +16,8 @@ config HEAD stdin. Filename "-" is a synonym for stdin. -n Number of lines to copy + -q Never print headers + -v Always print headers */ #define FOR_head @@ -30,9 +32,9 @@ static void do_head(int fd, char *name) { int i, len, lines=TT.lines, size=sizeof(toybuf); - if (toys.optc > 1) { + 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"); + if (TT.file_no) xprintf("\n"); xprintf("==> %s <==\n", name); xflush(); } @@ -46,6 +48,8 @@ static void do_head(int fd, char *name) xwrite(1, toybuf, i); } + + TT.file_no++; } void head_main(void) -- cgit v1.2.3 From 51a1e91d263ad14ffd4b57ff0c22d3ff02799ceb Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 31 May 2017 11:01:11 -0700 Subject: Allow ':' in property names. Bug: http://b/62114389 Test: setprop Change-Id: I165bcc01bb2422d991f746c5e6490cbdfb74472f --- toys/android/setprop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/android/setprop.c b/toys/android/setprop.c index c1356156..ec411f41 100644 --- a/toys/android/setprop.c +++ b/toys/android/setprop.c @@ -38,7 +38,7 @@ void setprop_main(void) if (strstr(name, "..")) error_exit("'..' is not allowed in a property name"); for (p = name; *p; ++p) - if (!isalnum(*p) && !strchr("@_.-", *p)) + if (!isalnum(*p) && !strchr(":@_.-", *p)) error_exit("invalid character '%c' in name '%s'", *p, name); if (__system_property_set(name, value)) -- cgit v1.2.3