commit 2c4bc42
xplshn
·
2026-06-17 03:01:07 +0000 UTC
parent 84fdd47
update docs Signed-off-by: xplshn <anto@xplshn.com.ar>
158 files changed,
+701,
-1024
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-b3sum: compute blake3 checksums
5-usage: b3sum [-bct] [-l length] [file ...]
6
7-compute and check blake3 message digests
8-*/
9 #include "util.h"
10 #include "arg.h"
11
12@@ -3968,6 +3963,9 @@ check(const char *name, FILE *file)
13 return ret;
14 }
15
16+// ?man b3sum: compute blake3 checksums
17+// ?man arguments: file ...
18+// ?man compute and check blake3 message digests
19 int
20 main(int argc, char *argv[])
21 {
22@@ -3986,7 +3984,7 @@ main(int argc, char *argv[])
23 case 'c':
24 func = check;
25 break;
26- // ?man -l length: output digest length in bytes
27+ // ?man -l:str: -l length: output digest length in bytes
28 case 'l':
29 outlen = strtoul(EARGF(usage()), &end, 10);
30 if (*end)
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-blkdiscard: discard sectors on a device
5-usage: blkdiscard device
6
7-discard sectors on a block device
8-*/
9
10 #include <sys/ioctl.h>
11 #include <sys/mount.h>
12@@ -28,6 +23,9 @@ usage(void)
13 eprintf("usage: %s device\n", argv0);
14 }
15
16+// ?man blkdiscard: discard sectors on a device
17+// ?man arguments: device
18+// ?man discard sectors on a block device
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-chvt: change foreground virtual terminal
5-usage: chvt num
6
7-change the active virtual terminal
8-*/
9
10 #include <sys/ioctl.h>
11 #include <sys/types.h>
12@@ -35,6 +30,9 @@ usage(void)
13 eprintf("usage: %s num\n", argv0);
14 }
15
16+// ?man chvt: change foreground virtual terminal
17+// ?man arguments: num
18+// ?man change the active virtual terminal
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-ctrlaltdel: set ctrl-alt-del function
5-usage: ctrlaltdel -h | -s
6
7-set the behavior of the ctrl-alt-del key combination
8-*/
9
10 #include <sys/syscall.h>
11
12@@ -20,6 +15,9 @@ usage(void)
13 eprintf("usage: %s -h | -s\n", argv0);
14 }
15
16+// ?man ctrlaltdel: set ctrl-alt-del function
17+// ?man arguments: -h | -s
18+// ?man set the behavior of the ctrl-alt-del key combination
19 int
20 main(int argc, char *argv[])
21 {
+7,
-8
1@@ -1,12 +1,4 @@
2-/* ?man
3-depmod: generate modules.dep and map files
4-usage: depmod [-n] [-b basedir] [version]
5
6-depmod generates modules.dep containing dependency information for modprobe
7-
8-// ?man -n: dry run print results to stdout instead of writing files
9-// ?man -b basedir: use basedir as prefix for module directories
10-*/
11
12 #include "fs.h"
13 #include "util.h"
14@@ -268,6 +260,11 @@ usage(void)
15 eprintf("usage: %s [-n] [-b basedir] [version]\n", argv0);
16 }
17
18+// ?man depmod: generate modules.dep and map files
19+// ?man arguments: version
20+// ?man depmod generates modules.dep containing dependency information for modprobe
21+// ?man // ?man -n: dry run print results to stdout instead of writing files
22+// ?man // ?man -b basedir: use basedir as prefix for module directories
23 int
24 main(int argc, char *argv[])
25 {
26@@ -284,9 +281,11 @@ main(int argc, char *argv[])
27 FILE *f_dep, *f_alias, *f_sym;
28
29 ARGBEGIN {
30+ // ?man -n: specify n option
31 case 'n':
32 nflag = 1;
33 break;
34+ // ?man -b:dir: specify b option
35 case 'b':
36 basedir = EARGF(usage());
37 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-eject: eject removable media
5-usage: eject [-t] [device ...]
6
7-eject optical discs or other removable storage media
8-*/
9
10 #include <sys/ioctl.h>
11 #include <sys/stat.h>
12@@ -53,6 +48,9 @@ usage(void)
13 eprintf("usage: %s [-t] [device ...]\n", argv0);
14 }
15
16+// ?man eject: eject removable media
17+// ?man arguments: device ...
18+// ?man eject optical discs or other removable storage media
19 int
20 main(int argc, char *argv[])
21 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-freeramdisk: free ramdisk memory
5-usage: freeramdisk
6
7-free memory associated with a ramdisk device
8-*/
9
10 #include <sys/ioctl.h>
11 #include <sys/mount.h>
12@@ -23,6 +18,8 @@ usage(void)
13 eprintf("usage: %s\n", argv0);
14 }
15
16+// ?man freeramdisk: free ramdisk memory
17+// ?man free memory associated with a ramdisk device
18 int
19 main(int argc, char *argv[])
20 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-fsfreeze: suspend access to a filesystem
5-usage: fsfreeze (-f | -u) mountpoint
6
7-freeze or unfreeze a filesystem to allow safe backups
8-*/
9
10 #include <sys/ioctl.h>
11 #include <sys/stat.h>
12@@ -26,6 +21,9 @@ usage(void)
13 eprintf("usage: %s (-f | -u) mountpoint\n", argv0);
14 }
15
16+// ?man fsfreeze: suspend access to a filesystem
17+// ?man arguments: (-f | -u) mountpoint
18+// ?man freeze or unfreeze a filesystem to allow safe backups
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-hwclock: query or set the hardware clock
5-usage: hwclock [-rsw] [-u] [dev]
6
7-view or adjust the hardware real time clock
8-*/
9
10 #include <sys/ioctl.h>
11 #include <sys/stat.h>
12@@ -119,6 +114,9 @@ usage(void)
13 eprintf("usage: %s [-rsw] [-u] [dev]\n", argv0);
14 }
15
16+// ?man hwclock: query or set the hardware clock
17+// ?man arguments: dev
18+// ?man view or adjust the hardware real time clock
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,9 +1,4 @@
2-/* ?man
3-insmod: insert a module into the Linux kernel
4-usage: insmod filename [args...]
5
6-insmod inserts a kernel module from filename into the running kernel
7-*/
8 #include <sys/stat.h>
9 #include <sys/syscall.h>
10
11@@ -21,6 +16,9 @@ usage(void)
12 eprintf("usage: %s filename [args...]\n", argv0);
13 }
14
15+// ?man insmod: insert a module into the Linux kernel
16+// ?man arguments: filename [args...
17+// ?man insmod inserts a kernel module from filename into the running kernel
18 int
19 main(int argc, char *argv[])
20 {
+2,
-5
1@@ -1,9 +1,4 @@
2-/* ?man
3-lsmod: show the status of modules in the Linux kernel
4-usage: lsmod
5
6-lsmod formats and displays /proc/modules, showing currently loaded modules
7-*/
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <string.h>
11@@ -20,6 +15,8 @@ usage(void)
12 eprintf("usage: %s\n", argv0);
13 }
14
15+// ?man lsmod: show the status of modules in the Linux kernel
16+// ?man lsmod formats and displays /proc/modules, showing currently loaded modules
17 int
18 main(int argc, char *argv[])
19 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-lsusb: list usb devices
5-usage: lsusb
6
7-display information about usb buses and connected devices
8-*/
9
10 #include <limits.h>
11 #include <stdio.h>
12@@ -52,6 +47,8 @@ usage(void)
13 eprintf("usage: %s\n", argv0);
14 }
15
16+// ?man lsusb: list usb devices
17+// ?man display information about usb buses and connected devices
18 int
19 main(int argc, char *argv[])
20 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-mkswap: set up a swap area
5-usage: mkswap device
6
7-initialize a linux swap area on a device or file
8-*/
9
10 #include <sys/stat.h>
11
12@@ -37,6 +32,9 @@ usage(void)
13 eprintf("usage: %s device\n", argv0);
14 }
15
16+// ?man mkswap: set up a swap area
17+// ?man arguments: device
18+// ?man initialize a linux swap area on a device or file
19 int
20 main(int argc, char *argv[])
21 {
+45,
-39
1@@ -1,15 +1,4 @@
2-/* ?man
3-modprobe: add or remove modules from the Linux kernel
4-usage: modprobe [-alqrv] [module [symbol=value ...]]
5-
6-modprobe loads or removes kernel modules from the running system.
7-It reads modules.dep, modules.alias, and modules.symbols from the appropriate
8-/lib/modules/release directory to resolve module names and dependencies,
9-loading prerequisites first.
10-
11-Without -r, modprobe loads the named module (and any required dependencies)
12-into the kernel.
13-*/
14+
15 #include "arg.h"
16 #include "fs.h"
17 #include "util.h"
18@@ -545,6 +534,14 @@ usage(void)
19 "module [symbol=value ...]\n", argv0);
20 }
21
22+// ?man modprobe: add or remove modules from the Linux kernel
23+// ?man arguments: module [symbol=value ...
24+// ?man modprobe loads or removes kernel modules from the running system.
25+// ?man It reads modules.dep, modules.alias, and modules.symbols from the appropriate
26+// ?man /lib/modules/release directory to resolve module names and dependencies,
27+// ?man loading prerequisites first.
28+// ?man Without -r, modprobe loads the named module (and any required dependencies)
29+// ?man into the kernel.
30 int
31 main(int argc, char *argv[])
32 {
33@@ -554,37 +551,46 @@ main(int argc, char *argv[])
34 int i, ret = 0;
35
36 ARGBEGIN {
37+ // ?man -a: specify a option
38 case 'a':
39 // ?man -a: Load all modules named on the command line (rather than stopping after the first).
40 aflag = 1; break;
41+ // ?man -r: specify r option
42 case 'r':
43 // ?man -r: Remove the named modules from the kernel. Dependencies are not automatically removed.
44 rflag = 1; break;
45+ // ?man -q: specify q option
46 case 'q':
47 // ?man -q: Quiet mode. Suppress error messages.
48 qflag = 1; break;
49+ // ?man -v: specify v option
50 case 'v':
51 // ?man -v: Verbose mode. Print each action taken.
52 vflag = 1; break;
53+ // ?man -l: specify l option
54 case 'l':
55 // ?man -l: List available modules matching the optional _pattern_ (a fnmatch(3) glob).
56 lflag = 1; break;
57 #if FEATURE_MODPROBE_SHOW_DEPENDS
58+ // ?man -D: specify D option
59 case 'D':
60 // ?man -D: Print the sequence of insmod commands that would be used to load the module, without actually loading anything.
61 Dflag = 1; break;
62 #endif
63 #if FEATURE_MODPROBE_BLACKLIST
64+ // ?man -b: specify b option
65 case 'b':
66 // ?man -b: Skip modules listed as blacklist in /etc/modprobe.d/.
67 bflag = 1; break;
68 #endif
69 #if FEATURE_MODPROBE_SYSLOG
70+ // ?man -s: specify s option
71 case 's':
72 // ?man -s: Log messages to syslog(3) (facility LOG_DAEMON) instead of standard error.
73 sflag = 1; break;
74 #endif
75 #if FEATURE_MODPROBE_DIR_OVERRIDE
76+ // ?man -d:file: specify d option
77 case 'd':
78 // ?man -d dir: Use dir as the base directory for module files instead of /lib/modules/release.
79 strlist_append(&moddirs, EARGF(usage())); break;
80@@ -658,33 +664,33 @@ end:
81 if (fshut(stdin, "<stdin>") | fshut(stdout, "<stdout>"))
82 ret = 2;
83
84- /* ?man
85- ## FILES
86-
87- `/etc/modprobe.conf`
88- : Global configuration file.
89-
90- Files under `/etc/modprobe.d/`
91- : Per-module configuration snippets.
92-
93- `/lib/modules/`_release_`/modules.dep`
94- : Module dependency map generated by `depmod(8)`.
95-
96- ## EXIT STATUS
97-
98- 0
99- : Success.
100-
101- 1
102- : Module not found or kernel rejected the operation.
103-
104- 2
105- : I/O error on stdout or stdin.
106-
107- ## SEE ALSO
108-
109- insmod(8), rmmod(8), lsmod(8), depmod(8)
110- */
111+ // ?man
112+ // ?man ## FILES
113+ // ?man
114+ // ?man `/etc/modprobe.conf`
115+ // ?man : Global configuration file.
116+ // ?man
117+ // ?man Files under `/etc/modprobe.d/`
118+ // ?man : Per-module configuration snippets.
119+ // ?man
120+ // ?man `/lib/modules/`_release_`/modules.dep`
121+ // ?man : Module dependency map generated by `depmod(8)`.
122+ // ?man
123+ // ?man ## EXIT STATUS
124+ // ?man
125+ // ?man 0
126+ // ?man : Success.
127+ // ?man
128+ // ?man 1
129+ // ?man : Module not found or kernel rejected the operation.
130+ // ?man
131+ // ?man 2
132+ // ?man : I/O error on stdout or stdin.
133+ // ?man
134+ // ?man ## SEE ALSO
135+ // ?man
136+ // ?man insmod(8), rmmod(8), lsmod(8), depmod(8)
137+ // ?man
138
139 return ret;
140 }
+5,
-7
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-mount: mount a filesystem
5-usage: mount [-BMRan] [-t fstype] [-o options] [source] [target]
6
7-mount a filesystem to the directory tree
8-*/
9
10 #include <sys/mount.h>
11 #include <sys/stat.h>
12@@ -195,6 +190,9 @@ usage(void)
13 argv0);
14 }
15
16+// ?man mount: mount a filesystem
17+// ?man arguments: source] [target
18+// ?man mount a filesystem to the directory tree
19 int
20 main(int argc, char *argv[])
21 {
22@@ -223,12 +221,12 @@ main(int argc, char *argv[])
23 case 'a':
24 aflag = 1;
25 break;
26- // ?man -o: specify output file
27+ // ?man -o:str: specify output file
28 case 'o':
29 estrlcat(fsopts, EARGF(usage()), sizeof(fsopts));
30 parseopts(fsopts, &flags, data, sizeof(data));
31 break;
32- // ?man -t: sort or specify timestamp
33+ // ?man -t:str: sort or specify timestamp
34 case 't':
35 types = EARGF(usage());
36 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-mountpoint: check if a directory is a mountpoint
5-usage: mountpoint [-dqx] target
6
7-determine if a directory is a mountpoint
8-*/
9
10 #include <sys/stat.h>
11 #include <sys/sysmacros.h>
12@@ -24,6 +19,9 @@ usage(void)
13 eprintf("usage: %s [-dqx] target\n", argv0);
14 }
15
16+// ?man mountpoint: check if a directory is a mountpoint
17+// ?man arguments: target
18+// ?man determine if a directory is a mountpoint
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-pivot_root: change the root filesystem
5-usage: pivot_root new-root put-old
6
7-change the root filesystem of the current process
8-*/
9
10 #include <sys/syscall.h>
11
12@@ -20,6 +15,9 @@ usage(void)
13 eprintf("usage: %s new-root put-old\n", argv0);
14 }
15
16+// ?man pivot_root: change the root filesystem
17+// ?man arguments: new-root put-old
18+// ?man change the root filesystem of the current process
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-readahead: read files into page cache
5-usage: readahead file...
6
7-preload file contents into the page cache
8-*/
9
10 #include <fcntl.h>
11 #include <limits.h>
12@@ -19,6 +14,9 @@ usage(void)
13 eprintf("usage: %s file...\n", argv0);
14 }
15
16+// ?man readahead: read files into page cache
17+// ?man arguments: file...
18+// ?man preload file contents into the page cache
19 int
20 main(int argc, char *argv[])
21 {
+7,
-8
1@@ -1,12 +1,4 @@
2-/* ?man
3-rmmod: remove a module from the Linux kernel
4-usage: rmmod [-fw] module...
5
6-rmmod removes a kernel module from the running kernel
7-
8-// ?man -f: force removal of a module even if it is busy or in use
9-// ?man -w: wait for the module to become unused before removing
10-*/
11 #include <sys/syscall.h>
12
13 #include <fcntl.h>
14@@ -24,6 +16,11 @@ usage(void)
15 eprintf("usage: %s [-fw] module...\n", argv0);
16 }
17
18+// ?man rmmod: remove a module from the Linux kernel
19+// ?man arguments: module...
20+// ?man rmmod removes a kernel module from the running kernel
21+// ?man // ?man -f: force removal of a module even if it is busy or in use
22+// ?man // ?man -w: wait for the module to become unused before removing
23 int
24 main(int argc, char *argv[])
25 {
26@@ -32,9 +29,11 @@ main(int argc, char *argv[])
27 int flags = O_NONBLOCK;
28
29 ARGBEGIN {
30+ // ?man -f: specify f option
31 case 'f':
32 flags |= O_TRUNC;
33 break;
34+ // ?man -w: specify w option
35 case 'w':
36 flags &= ~O_NONBLOCK;
37 break;
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-swaplabel: print or change swap label
5-usage: swaplabel [-L label] device
6
7-display or modify the label and uuid of a swap device
8-*/
9
10 #include <sys/types.h>
11
12@@ -29,6 +24,9 @@ usage(void)
13 eprintf("usage: %s [-L label] device\n", argv0);
14 }
15
16+// ?man swaplabel: print or change swap label
17+// ?man arguments: device
18+// ?man display or modify the label and uuid of a swap device
19 int
20 main(int argc, char *argv[])
21 {
22@@ -40,7 +38,7 @@ main(int argc, char *argv[])
23 int i;
24
25 ARGBEGIN {
26- // ?man -L: specify option flag
27+ // ?man -L:str: specify option flag
28 case 'L':
29 setlabel = 1;
30 label = EARGF(usage());
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-swapoff: disable swap devices
5-usage: swapoff -a | device
6
7-disable paging and swapping on specified devices
8-*/
9
10 #include <sys/swap.h>
11
12@@ -21,6 +16,9 @@ usage(void)
13 eprintf("usage: %s -a | device\n", argv0);
14 }
15
16+// ?man swapoff: disable swap devices
17+// ?man arguments: -a | device
18+// ?man disable paging and swapping on specified devices
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-swapon: enable swap devices
5-usage: swapon [-dp] -a | device
6
7-enable paging and swapping on specified devices
8-*/
9
10 #include <sys/swap.h>
11
12@@ -21,6 +16,9 @@ usage(void)
13 eprintf("usage: %s [-dp] -a | device\n", argv0);
14 }
15
16+// ?man swapon: enable swap devices
17+// ?man arguments: -a | device
18+// ?man enable paging and swapping on specified devices
19 int
20 main(int argc, char *argv[])
21 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-switch_root: switch to another root filesystem
5-usage: switch_root [-c console] [newroot] [init] (PID 1)
6
7-switch to another filesystem as the root of the mount tree
8-*/
9
10 #include <sys/mount.h>
11 #include <sys/stat.h>
12@@ -71,6 +66,9 @@ usage(void)
13 eprintf("usage: %s [-c console] [newroot] [init] (PID 1)\n", argv0);
14 }
15
16+// ?man switch_root: switch to another root filesystem
17+// ?man arguments: newroot] [init] (PID 1)
18+// ?man switch to another filesystem as the root of the mount tree
19 int
20 main(int argc, char *argv[])
21 {
22@@ -80,7 +78,7 @@ main(int argc, char *argv[])
23 struct statfs stfs;
24
25 ARGBEGIN {
26- // ?man -c: print count or perform stdout action
27+ // ?man -c:str: print count or perform stdout action
28 case 'c':
29 console = EARGF(usage());
30 break;
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-sysctl: configure kernel parameters
5-usage: sysctl [-p file] variable[=value]...
6
7-view and modify kernel parameters at runtime
8-*/
9
10 #include <fcntl.h>
11 #include <limits.h>
12@@ -165,6 +160,9 @@ usage(void)
13 eprintf("usage: %s [-p file] variable[=value]...\n", argv0);
14 }
15
16+// ?man sysctl: configure kernel parameters
17+// ?man arguments: variable[=value]...
18+// ?man view and modify kernel parameters at runtime
19 int
20 main(int argc, char *argv[])
21 {
22@@ -176,7 +174,7 @@ main(int argc, char *argv[])
23 int r = 0;
24
25 ARGBEGIN {
26- // ?man -p: preserve file attributes
27+ // ?man -p:file: preserve file attributes
28 case 'p':
29 file = EARGF(usage());
30 break;
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-tunctl: configure tun/tap interfaces
5-usage: tunctl [-dtT] [-u owner] [device]
6
7-create or destroy tun/tap network interfaces
8-*/
9
10 #include <sys/ioctl.h>
11 #include <sys/socket.h>
12@@ -35,6 +30,9 @@ usage(void)
13 eprintf("usage: %s [-dtT] [-u owner] [device]\n", argv0);
14 }
15
16+// ?man tunctl: configure tun/tap interfaces
17+// ?man arguments: device
18+// ?man create or destroy tun/tap network interfaces
19 int
20 main(int argc, char *argv[])
21 {
22@@ -59,7 +57,7 @@ main(int argc, char *argv[])
23 case 'T':
24 Tflag = 1;
25 break;
26- // ?man -u: unbuffered output
27+ // ?man -u:str: unbuffered output
28 case 'u':
29 owner = EARGF(usage());
30 break;
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-umount: unmount filesystems
5-usage: umount [-lfn] [-O options] target...
6
7-unmount a filesystem from the directory tree
8-*/
9
10 #include <sys/mount.h>
11
12@@ -130,6 +125,9 @@ usage(void)
13 exit(1);
14 }
15
16+// ?man umount: unmount filesystems
17+// ?man arguments: target...
18+// ?man unmount a filesystem from the directory tree
19 int
20 main(int argc, char *argv[])
21 {
22@@ -158,7 +156,7 @@ main(int argc, char *argv[])
23 case 'n':
24 break;
25 #if FEATURE_UMOUNT_OPTIONS
26- // ?man -O: specify option flag
27+ // ?man -O:str: specify option flag
28 case 'O':
29 oflag = EARGF(usage());
30 break;
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-unshare: run program in new namespaces
5-usage: unshare [-muinpU] cmd [args...]
6
7-run a program with some namespaces unshared from the parent
8-*/
9
10 #include <sched.h>
11 #include <stdio.h>
12@@ -20,6 +15,9 @@ usage(void)
13 eprintf("usage: %s [-muinpU] cmd [args...]\n", argv0);
14 }
15
16+// ?man unshare: run program in new namespaces
17+// ?man arguments: cmd [args...
18+// ?man run a program with some namespaces unshared from the parent
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-vtallow: allow non-root vt access
5-usage: vtallow n | y
6
7-allow non-root users to access virtual terminal devices
8-*/
9
10 #include <sys/types.h>
11 #include <sys/stat.h>
12@@ -28,6 +23,9 @@ usage(void)
13 eprintf("usage: %s n | y\n", argv0);
14 }
15
16+// ?man vtallow: allow non-root vt access
17+// ?man arguments: n | y
18+// ?man allow non-root users to access virtual terminal devices
19 int
20 main(int argc, char *argv[])
21 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-host: dns lookup utility
5-usage: host [-t type] name [server]
6
7-look up hostnames and IP addresses using dns
8-*/
9
10 #include "util.h"
11 #include "arg.h"
12@@ -262,6 +257,9 @@ parse_response(const unsigned char *resp, int resp_len, const char *query_name)
13 return 0;
14 }
15
16+// ?man host: dns lookup utility
17+// ?man arguments: name [server
18+// ?man look up hostnames and IP addresses using dns
19 int
20 main(int argc, char *argv[])
21 {
22@@ -276,7 +274,7 @@ main(int argc, char *argv[])
23 int i, r;
24
25 ARGBEGIN {
26- // ?man -t: sort or specify timestamp
27+ // ?man -t:str: sort or specify timestamp
28 case 't':
29 tflag = EARGF(usage());
30 break;
+5,
-7
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-httpd: simple http daemon
5-usage: httpd [-e string] [-d string] [-v] [dir]
6
7-serve static files over http
8-*/
9
10 #include "util.h"
11 #include "arg.h"
12@@ -256,6 +251,9 @@ serve_file:
13 close(fd);
14 }
15
16+// ?man httpd: simple http daemon
17+// ?man arguments: dir
18+// ?man serve static files over http
19 int
20 main(int argc, char *argv[])
21 {
22@@ -264,11 +262,11 @@ main(int argc, char *argv[])
23 char *enc;
24
25 ARGBEGIN {
26- // ?man -e: specify expression or pattern
27+ // ?man -e:str: specify expression or pattern
28 case 'e':
29 eflag = EARGF(usage());
30 break;
31- // ?man -d: specify directory
32+ // ?man -d:str: specify directory
33 case 'd':
34 dflag = EARGF(usage());
35 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-ifconfig: configure network interfaces
5-usage: ifconfig [-a] [interface [action ...]]
6
7-configure network interface parameters and view stats
8-*/
9
10 #include <arpa/inet.h>
11 #include <ctype.h>
12@@ -102,6 +97,9 @@ list_interfaces(int all)
13 free(ifaces);
14 }
15
16+// ?man ifconfig: configure network interfaces
17+// ?man arguments: interface [action ...
18+// ?man configure network interface parameters and view stats
19 int
20 main(int argc, char *argv[])
21 {
+22,
-34
1@@ -1,39 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-ip: show or configure routing and devices
5-usage: ip [addr | link | route] [args...]
6
7-configure and view network devices, routing, and tunnels
8-
9-## COMMANDS
10-
11-### addr [show | list [dev <device>]]
12-show interface addresses
13-
14-### addr add <ip>/<prefix> dev <device>
15-add address to interface
16-
17-### addr del <ip>/<prefix> dev <device>
18-delete address from interface
19-
20-### addr flush dev <device>
21-flush all addresses from interface
22-
23-### link [show | list [dev <device>]]
24-show interface link states
25-
26-### link set <interface> [up | down | mtu <mtu> | address <mac> | arp on|off | multicast on|off | allmulticast on|off | promisc on|off | name <newname> | txqueuelen <qlen>]
27-configure interface settings
28-
29-### route [show | list]
30-show routing table
31-
32-### route add <prefix> [via <gateway>] [dev <device>] [metric <metric>]
33-add route to routing table
34-
35-### route del <prefix> [via <gateway>] [dev <device>] [metric <metric>]
36-delete route from routing table
37-*/
38
39 #include <arpa/inet.h>
40 #include <ctype.h>
41@@ -379,6 +345,28 @@ do_route(int argc, char *argv[])
42 return 1;
43 }
44
45+// ?man ip: show or configure routing and devices
46+// ?man arguments: addr | link | route] [args...
47+// ?man configure and view network devices, routing, and tunnels
48+// ?man ## COMMANDS
49+// ?man ### addr [show | list [dev <device>]]
50+// ?man show interface addresses
51+// ?man ### addr add <ip>/<prefix> dev <device>
52+// ?man add address to interface
53+// ?man ### addr del <ip>/<prefix> dev <device>
54+// ?man delete address from interface
55+// ?man ### addr flush dev <device>
56+// ?man flush all addresses from interface
57+// ?man ### link [show | list [dev <device>]]
58+// ?man show interface link states
59+// ?man ### link set <interface> [up | down | mtu <mtu> | address <mac> | arp on|off | multicast on|off | allmulticast on|off | promisc on|off | name <newname> | txqueuelen <qlen>]
60+// ?man configure interface settings
61+// ?man ### route [show | list]
62+// ?man show routing table
63+// ?man ### route add <prefix> [via <gateway>] [dev <device>] [metric <metric>]
64+// ?man add route to routing table
65+// ?man ### route del <prefix> [via <gateway>] [dev <device>] [metric <metric>]
66+// ?man delete route from routing table
67 int
68 main(int argc, char *argv[])
69 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-netcat: read and write data across network connections
5-usage: netcat [-lu] [-p localport] [host] [port]
6
7-arbitrary data transmission over tcp or udp
8-*/
9
10 #include <sys/socket.h>
11 #include <sys/types.h>
12@@ -53,6 +48,9 @@ resolve(const char *host, const char *port, int family, int socktype,
13 return 0;
14 }
15
16+// ?man netcat: read and write data across network connections
17+// ?man arguments: host] [port
18+// ?man arbitrary data transmission over tcp or udp
19 int
20 main(int argc, char *argv[])
21 {
22@@ -76,7 +74,7 @@ main(int argc, char *argv[])
23 case 'l':
24 lflag = 1;
25 break;
26- // ?man -p: preserve file attributes
27+ // ?man -p:str: preserve file attributes
28 case 'p':
29 local_port = EARGF(usage());
30 break;
+8,
-10
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-ping: send icmp echo requests
5-usage: ping [-c count] [-i interval] [-s size] [-t ttl] [-w deadline] [-q] host
6
7-send icmp echo requests to verify network connectivity
8-*/
9
10 #include "util.h"
11 #include "arg.h"
12@@ -107,6 +102,9 @@ print_stats(const char *host, int sent, int received, double min_rtt, double max
13 }
14 }
15
16+// ?man ping: send icmp echo requests
17+// ?man arguments: host
18+// ?man send icmp echo requests to verify network connectivity
19 int
20 main(int argc, char *argv[])
21 {
22@@ -143,23 +141,23 @@ main(int argc, char *argv[])
23 socklen_t fromlen;
24
25 ARGBEGIN {
26- // ?man -c: print count or perform stdout action
27+ // ?man -c:str: print count or perform stdout action
28 case 'c':
29 cflag = EARGF(usage());
30 break;
31- // ?man -i: interactive mode or prompt for confirmation
32+ // ?man -i:str: interactive mode or prompt for confirmation
33 case 'i':
34 iflag = EARGF(usage());
35 break;
36- // ?man -s: silent mode or print summary
37+ // ?man -s:str: silent mode or print summary
38 case 's':
39 sflag = EARGF(usage());
40 break;
41- // ?man -t: sort or specify timestamp
42+ // ?man -t:str: sort or specify timestamp
43 case 't':
44 tflag = EARGF(usage());
45 break;
46- // ?man -w: wait for completion
47+ // ?man -w:str: wait for completion
48 case 'w':
49 wflag = EARGF(usage());
50 break;
+5,
-7
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-tftp: tftp client
5-usage: tftp -h host [-p port] [-x | -c] file
6
7-transfer files to and from a remote tftp server
8-*/
9
10 #include <sys/time.h>
11 #include <sys/types.h>
12@@ -253,6 +248,9 @@ usage(void)
13 eprintf("usage: %s -h host [-p port] [-x | -c] file\n", argv0);
14 }
15
16+// ?man tftp: tftp client
17+// ?man arguments: -h host file
18+// ?man transfer files to and from a remote tftp server
19 int
20 main(int argc, char *argv[])
21 {
22@@ -263,11 +261,11 @@ main(int argc, char *argv[])
23 int ret;
24
25 ARGBEGIN {
26- // ?man -h: suppress headers or print help
27+ // ?man -h:str: suppress headers or print help
28 case 'h':
29 host = EARGF(usage());
30 break;
31- // ?man -p: preserve file attributes
32+ // ?man -p:str: preserve file attributes
33 case 'p':
34 port = EARGF(usage());
35 break;
+8,
-9
1@@ -1,10 +1,5 @@
2 /* see license file for copyright and license details */
3-/* ?man
4-wget: retrieve files from the web
5-usage: wget [-cqS] [-O file] [-P dir] [-T timeout] [-U user_agent] [-post-data data] [-post-file file] [-header header] [-no-check-certificate] [-spider] url
6
7-download files over http or https
8-*/
9
10 #include "util.h"
11 #include "arg.h"
12@@ -298,6 +293,9 @@ req_printf(struct TlsSocket *ts, const char *fmt, ...)
13 tls_write(ts, buf, len);
14 }
15
16+// ?man wget: retrieve files from the web
17+// ?man arguments: url
18+// ?man download files over http or https
19 int
20 main(int argc, char *argv[])
21 {
22@@ -329,19 +327,19 @@ main(int argc, char *argv[])
23 size_t i;
24
25 ARGBEGIN {
26- // ?man -O: specify output file path
27+ // ?man -O:str: specify output file path
28 case 'O':
29 Oflag = EARGF(usage());
30 break;
31- // ?man -P: specify output directory prefix
32+ // ?man -P:str: specify output directory prefix
33 case 'P':
34 Pflag = EARGF(usage());
35 break;
36- // ?man -T: set network read and connect timeout
37+ // ?man -T:num: set network read and connect timeout
38 case 'T':
39 timeout_sec = estrtonum(EARGF(usage()), 0, 100000);
40 break;
41- // ?man -U: set User-Agent header
42+ // ?man -U:str: set User-Agent header
43 case 'U':
44 user_agent = EARGF(usage());
45 break;
46@@ -357,6 +355,7 @@ main(int argc, char *argv[])
47 case 'S':
48 Sflag = 1;
49 break;
50+ // ?man --: specify - option
51 case '-':
52 if (strcmp(argv[0], "-no-check-certificate") == 0) {
53 no_check_certificate = 1;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-basename: strip directory and suffix from filenames
5-usage: basename path [suffix]
6
7-print filename with leading directories and optional suffix removed
8-*/
9
10 #include <libgen.h>
11 #include <stdio.h>
12@@ -18,6 +13,9 @@ usage(void)
13 eprintf("usage: %s path [suffix]\n", argv0);
14 }
15
16+// ?man basename: strip directory and suffix from filenames
17+// ?man arguments: path [suffix
18+// ?man print filename with leading directories and optional suffix removed
19 int
20 main(int argc, char *argv[])
21 {
+5,
-8
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-cal: display a calendar
5-usage: cal [-1 | -3 | -y | -n num]
6
7-print a formatted calendar of the specified month or year
8-*/
9
10 #include <limits.h>
11 #include <stdint.h>
12@@ -156,6 +151,8 @@ usage(void)
13 #endif
14 }
15
16+// ?man cal: display a calendar
17+// ?man print a formatted calendar of the specified month or year
18 int
19 main(int argc, char *argv[])
20 {
21@@ -194,11 +191,11 @@ main(int argc, char *argv[])
22 year--;
23 }
24 break;
25- // ?man -c: print count or perform stdout action
26+ // ?man -c:num: print count or perform stdout action
27 case 'c':
28 ncols = estrtonum(EARGF(usage()), 0, MIN((unsigned long long)SIZE_MAX, (unsigned long long)LLONG_MAX));
29 break;
30- // ?man -f: force the operation
31+ // ?man -f:num: force the operation
32 case 'f':
33 fday = estrtonum(EARGF(usage()), 0, 6);
34 break;
35@@ -206,7 +203,7 @@ main(int argc, char *argv[])
36 case 'm': /* Monday */
37 fday = 1;
38 break;
39- // ?man -n: print line numbers or counts
40+ // ?man -n:num: print line numbers or counts
41 case 'n':
42 nmons = estrtonum(EARGF(usage()), 1, MIN((unsigned long long)SIZE_MAX, (unsigned long long)LLONG_MAX));
43 break;
+15,
-16
1@@ -1,12 +1,6 @@
2 /* See LICENSE file for copyright and license details. */
3
4-/* ?man
5-cat: concatenate files and print to standard output
6-usage: cat [-u] [file ...]
7
8-cat reads each file in sequence and writes it to standard output
9-if no file is given, or a file is -, standard input is read
10-*/
11
12 #include <fcntl.h>
13 #include <string.h>
14@@ -20,12 +14,17 @@ usage(void)
15 eprintf("usage: %s [-u] [file ...]\n", argv0);
16 }
17
18+// ?man cat: concatenate files and print to standard output
19+// ?man arguments: file ...
20+// ?man cat reads each file in sequence and writes it to standard output
21+// ?man if no file is given, or a file is -, standard input is read
22 int
23 main(int argc, char *argv[])
24 {
25 int fd, ret = 0;
26
27 ARGBEGIN {
28+ // ?man -u: specify u option
29 case 'u':
30 // ?man -u: ignored; accepted for posix compatibility; output is always unbuffered
31 break;
32@@ -58,16 +57,16 @@ main(int argc, char *argv[])
33 }
34 }
35
36- /* ?man
37- ## Exit status
38-
39- cat exits 0 on success, and >0 if an error occurs reading any file
40- or writing to standard output
41-
42- ## See also
43-
44- cp(1), dd(1)
45- */
46+ // ?man
47+ // ?man ## Exit status
48+ // ?man
49+ // ?man cat exits 0 on success, and >0 if an error occurs reading any file
50+ // ?man or writing to standard output
51+ // ?man
52+ // ?man ## See also
53+ // ?man
54+ // ?man cp(1), dd(1)
55+ // ?man
56
57 return ret;
58 }
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-chgrp: change group ownership
5-usage: chgrp [-h] [-R [-H | -L | -P]] group file ...
6
7-change the group ownership of files and directories
8-*/
9
10 #include <sys/stat.h>
11
12@@ -43,6 +38,9 @@ usage(void)
13 eprintf("usage: %s [-h] [-R [-H | -L | -P]] group file ...\n", argv0);
14 }
15
16+// ?man chgrp: change group ownership
17+// ?man arguments: group file ...
18+// ?man change the group ownership of files and directories
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-chmod: change file modes
5-usage: chmod [-R] mode file ...
6
7-change the file mode bits of files and directories
8-*/
9
10 #include <fcntl.h>
11 #include <sys/stat.h>
12@@ -38,6 +33,9 @@ usage(void)
13 eprintf("usage: %s [-R] mode file ...\n", argv0);
14 }
15
16+// ?man chmod: change file modes
17+// ?man arguments: mode file ...
18+// ?man change the file mode bits of files and directories
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-chown: change ownership
5-usage: chown [-h] [-R [-H | -L | -P]] owner[:[group]] file ...
6
7-change the user and group ownership of files and directories
8-*/
9
10 #include <errno.h>
11 #include <fcntl.h>
12@@ -49,6 +44,9 @@ usage(void)
13 argv0, argv0);
14 }
15
16+// ?man chown: change ownership
17+// ?man arguments: owner[:[group]] file ...
18+// ?man change the user and group ownership of files and directories
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-cksum: checksum and count bytes
5-usage: cksum [file ...]
6
7-print crc checksum and byte counts for files
8-*/
9
10 #include <fcntl.h>
11 #include <inttypes.h>
12@@ -105,6 +100,9 @@ usage(void)
13 eprintf("usage: %s [file ...]\n", argv0);
14 }
15
16+// ?man cksum: checksum and count bytes
17+// ?man arguments: file ...
18+// ?man print crc checksum and byte counts for files
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-cmp: compare two files
5-usage: cmp [-l | -s] file1 file2
6
7-compare two files byte by byte
8-*/
9
10 #include <stdio.h>
11 #include <stdlib.h>
12@@ -18,6 +13,9 @@ usage(void)
13 enprintf(2, "usage: %s [-l | -s] file1 file2\n", argv0);
14 }
15
16+// ?man cmp: compare two files
17+// ?man arguments: file1 file2
18+// ?man compare two files byte by byte
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-comm: compare two sorted files
5-usage: comm [-123] file1 file2
6
7-compare two sorted files line by line
8-*/
9
10 #include <stdio.h>
11 #include <stdlib.h>
12@@ -36,6 +31,9 @@ usage(void)
13 eprintf("usage: %s [-123] file1 file2\n", argv0);
14 }
15
16+// ?man comm: compare two sorted files
17+// ?man arguments: file1 file2
18+// ?man compare two sorted files line by line
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-cp: copy files and directories
5-usage: cp [-afipv] [-R [-H | -L | -P]] source ... dest
6
7-copy files and directories to a destination
8-*/
9
10 #include <sys/stat.h>
11
12@@ -17,6 +12,9 @@ usage(void)
13 eprintf("usage: %s [-afipv] [-R [-H | -L | -P]] source ... dest\n", argv0);
14 }
15
16+// ?man cp: copy files and directories
17+// ?man arguments: source ... dest
18+// ?man copy files and directories to a destination
19 int
20 main(int argc, char *argv[])
21 {
+5,
-7
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-cut: cut out fields from lines
5-usage: cut -b list [-n] [file ...]
6
7-print selected parts of lines from files
8-*/
9
10 #include <stdio.h>
11 #include <stdlib.h>
12@@ -166,6 +161,9 @@ usage(void)
13 argv0, argv0, argv0);
14 }
15
16+// ?man cut: cut out fields from lines
17+// ?man arguments: -b list [file ...
18+// ?man print selected parts of lines from files
19 int
20 main(int argc, char *argv[])
21 {
22@@ -177,12 +175,12 @@ main(int argc, char *argv[])
23 case 'b':
24 // ?man -c: print count or perform stdout action
25 case 'c':
26- // ?man -f: force the operation
27+ // ?man -f:mode: force the operation
28 case 'f':
29 mode = ARGC();
30 parselist(EARGF(usage()));
31 break;
32- // ?man -d: specify directory
33+ // ?man -d:str: specify directory
34 case 'd':
35 delim = EARGF(usage());
36 if (!*delim)
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-date: print or set system date and time
5-usage: date [-u] [-d time] [+format | mmddHHMM[[CC]yy]]
6
7-display or configure the system date and time
8-*/
9
10 #include <ctype.h>
11 #include <stdio.h>
12@@ -68,6 +63,9 @@ setdate(const char *s, struct tm *now)
13 eprintf("clock_settime:");
14 }
15
16+// ?man date: print or set system date and time
17+// ?man arguments: +format | mmddHHMM[[CC]yy
18+// ?man display or configure the system date and time
19 int
20 main(int argc, char *argv[])
21 {
22@@ -80,7 +78,7 @@ main(int argc, char *argv[])
23 eprintf("time:");
24
25 ARGBEGIN {
26- // ?man -d: specify directory
27+ // ?man -d:num: specify directory
28 case 'd':
29 t = estrtonum(EARGF(usage()), 0, LLONG_MAX);
30 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-dd: convert and copy a file
5-usage: dd [operand...]
6
7-copy a file while performing conversions
8-*/
9
10 #include <ctype.h>
11 #include <fcntl.h>
12@@ -78,6 +73,9 @@ summary(void)
13 fprintf(stderr, "%"PRIdMAX"+%"PRIdMAX" records out\n", (intmax_t)ofull, (intmax_t)opart);
14 }
15
16+// ?man dd: convert and copy a file
17+// ?man arguments: operand...
18+// ?man copy a file while performing conversions
19 int
20 main(int argc, char *argv[])
21 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-df: report disk space usage
5-usage: df [-a]
6
7-display free and used disk space on filesystems
8-*/
9
10 #include <sys/statvfs.h>
11
12@@ -96,6 +91,8 @@ usage(void)
13 eprintf("usage: %s [-a]\n", argv0);
14 }
15
16+// ?man df: report disk space usage
17+// ?man display free and used disk space on filesystems
18 int
19 main(int argc, char *argv[])
20 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-dirname: strip non-directory suffix from filename
5-usage: dirname path
6
7-print the directory portion of a pathname
8-*/
9
10 #include <libgen.h>
11 #include <stdio.h>
12@@ -17,6 +12,9 @@ usage(void)
13 eprintf("usage: %s path\n", argv0);
14 }
15
16+// ?man dirname: strip non-directory suffix from filename
17+// ?man arguments: path
18+// ?man print the directory portion of a pathname
19 int
20 main(int argc, char *argv[])
21 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-du: estimate file space usage
5-usage: du [-a | -s] [-d depth] [-h] [-k] [-H | -L | -P] [-x] [file ...]
6
7-display disk space used by files and directories
8-*/
9
10 #include <sys/stat.h>
11 #include <sys/types.h>
12@@ -115,6 +110,9 @@ usage(void)
13 eprintf("usage: %s [-a | -s] [-d depth] [-h] [-k] [-H | -L | -P] [-x] [file ...]\n", argv0);
14 }
15
16+// ?man du: estimate file space usage
17+// ?man arguments: file ...
18+// ?man display disk space used by files and directories
19 int
20 main(int argc, char *argv[])
21 {
22@@ -128,7 +126,7 @@ main(int argc, char *argv[])
23 case 'a':
24 aflag = 1;
25 break;
26- // ?man -d: specify directory
27+ // ?man -d:num: specify directory
28 case 'd':
29 dflag = 1;
30 maxdepth = estrtonum(EARGF(usage()), 0, MIN((unsigned long long)LLONG_MAX, (unsigned long long)SIZE_MAX));
+2,
-5
1@@ -1,15 +1,12 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-echo: write arguments to stdout
5-usage: echo
6
7-print the specified arguments to standard output
8-*/
9
10 #include <stdio.h>
11 #include <string.h>
12 #include "util.h"
13
14+// ?man echo: write arguments to stdout
15+// ?man print the specified arguments to standard output
16 int
17 main(int argc, char *argv[])
18 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-ed: line editor
5-usage: ed [-s] [-p] [file]
6
7-simple text line editor
8-*/
9
10 #include <sys/stat.h>
11 #include <fcntl.h>
12@@ -1705,11 +1700,14 @@ init(char *fname)
13 clearundo();
14 }
15
16+// ?man ed: line editor
17+// ?man arguments: file
18+// ?man simple text line editor
19 int
20 main(int argc, char *argv[])
21 {
22 ARGBEGIN {
23- // ?man -p: preserve file attributes
24+ // ?man -p:str: preserve file attributes
25 case 'p':
26 prompt = EARGF(usage());
27 optprompt = 1;
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-env: run command in modified environment
5-usage: env [-i] [-u var] ... [var=value] ... [cmd [arg ...]]
6
7-set environment variables and run a command
8-*/
9
10 #include <errno.h>
11 #include <stdio.h>
12@@ -22,6 +17,9 @@ usage(void)
13 eprintf("usage: %s [-i] [-u var] ... [var=value] ... [cmd [arg ...]]\n", argv0);
14 }
15
16+// ?man env: run command in modified environment
17+// ?man arguments: ... [var=value] ... [cmd [arg ...
18+// ?man set environment variables and run a command
19 int
20 main(int argc, char *argv[])
21 {
22@@ -32,7 +30,7 @@ main(int argc, char *argv[])
23 case 'i':
24 *environ = NULL;
25 break;
26- // ?man -u: unbuffered output
27+ // ?man -u:str: unbuffered output
28 case 'u':
29 if (unsetenv(EARGF(usage())) < 0)
30 eprintf("unsetenv:");
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-expand: convert tabs to spaces
5-usage: expand [-i] [-t tablist] [file ...]
6
7-convert tab characters to space characters
8-*/
9
10 #include <stdint.h>
11 #include <stdlib.h>
12@@ -92,6 +87,9 @@ usage(void)
13 eprintf("usage: %s [-i] [-t tablist] [file ...]\n", argv0);
14 }
15
16+// ?man expand: convert tabs to spaces
17+// ?man arguments: file ...
18+// ?man convert tab characters to space characters
19 int
20 main(int argc, char *argv[])
21 {
22@@ -104,7 +102,7 @@ main(int argc, char *argv[])
23 case 'i':
24 iflag = 1;
25 break;
26- // ?man -t: sort or specify timestamp
27+ // ?man -t:str: sort or specify timestamp
28 case 't':
29 tl = EARGF(usage());
30 if (!*tl)
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-expr: evaluate expression
5-usage: expr
6
7-evaluate a command line expression and print the result
8-*/
9
10 #include <limits.h>
11 #include <stdio.h>
12@@ -239,6 +234,8 @@ parse(char *expr[], int numexpr)
13 return (valp->str && *valp->str) || valp->num;
14 }
15
16+// ?man expr: evaluate expression
17+// ?man evaluate a command line expression and print the result
18 int
19 main(int argc, char *argv[])
20 {
+2,
-5
1@@ -1,11 +1,8 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-false: return unsuccessful exit status
5-usage: false
6
7-exit with status 1 representing failure
8-*/
9
10+// ?man false: return unsuccessful exit status
11+// ?man exit with status 1 representing failure
12 int
13 main(void)
14 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-find: search for files
5-usage: find [-H | -L] path ... [expression ...]
6
7-search for files in a directory hierarchy
8-*/
9
10 #include "config.h"
11 #include "util.h"
12@@ -1425,6 +1420,9 @@ usage(void)
13 eprintf("usage: %s [-H | -L] path ... [expression ...]\n", argv0);
14 }
15
16+// ?man find: search for files
17+// ?man arguments: path ... [expression ...
18+// ?man search for files in a directory hierarchy
19 int
20 main(int argc, char **argv)
21 {
+5,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-fold: wrap lines to fit width
5-usage: fold [-bs] [-w num | -num] [FILE ...]
6
7-wrap input lines to fit a specified width
8-*/
9
10 #include <ctype.h>
11 #include <stdint.h>
12@@ -89,6 +84,9 @@ usage(void)
13 eprintf("usage: %s [-bs] [-w num | -num] [FILE ...]\n", argv0);
14 }
15
16+// ?man fold: wrap lines to fit width
17+// ?man arguments: FILE ...
18+// ?man wrap input lines to fit a specified width
19 int
20 main(int argc, char *argv[])
21 {
22@@ -104,10 +102,11 @@ main(int argc, char *argv[])
23 case 's':
24 sflag = 1;
25 break;
26- // ?man -w: wait for completion
27+ // ?man -w:num: wait for completion
28 case 'w':
29 width = estrtonum(EARGF(usage()), 1, MIN((unsigned long long)LLONG_MAX, (unsigned long long)SIZE_MAX));
30 break;
31+ // ?man ARGNUM: specify RGNUM option
32 ARGNUM:
33 if (!(width = ARGNUMF()))
34 eprintf("illegal width value, too small\n");
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-getconf: query configuration variables
5-usage: getconf [-v spec] var [path]
6
7-query system configuration variables
8-*/
9
10 #include <errno.h>
11 #include <unistd.h>
12@@ -27,6 +22,9 @@ usage(void)
13 eprintf("usage: %s [-v spec] var [path]\n", argv0);
14 }
15
16+// ?man getconf: query configuration variables
17+// ?man arguments: var [path
18+// ?man query system configuration variables
19 int
20 main(int argc, char *argv[])
21 {
22@@ -36,7 +34,7 @@ main(int argc, char *argv[])
23 char *str;
24
25 ARGBEGIN {
26- // ?man -v: verbose mode; show progress
27+ // ?man -v:str: verbose mode; show progress
28 case 'v':
29 /* ignore */
30 EARGF(usage());
+41,
-23
1@@ -1,11 +1,4 @@
2-/* ?man
3-grep: search files for a pattern
4-usage: grep [-EFHchilnqsvwx] [-e pattern] [-f file] [pattern] [file ...]
5
6-grep searches the named input files for lines matching the given pattern
7-if no files are named, or a file is -, standard input is searched
8-by default, matching lines are written to standard output
9-*/
10 #include "config.h"
11 #include "queue.h"
12 #include "util.h"
13@@ -250,6 +243,11 @@ usage(void)
14 " [-e pattern] [-f file] [pattern] [file ...]\n", argv0);
15 }
16
17+// ?man grep: search files for a pattern
18+// ?man arguments: pattern] [file ...
19+// ?man grep searches the named input files for lines matching the given pattern
20+// ?man if no files are named, or a file is -, standard input is searched
21+// ?man by default, matching lines are written to standard output
22 int
23 main(int argc, char *argv[])
24 {
25@@ -262,45 +260,54 @@ main(int argc, char *argv[])
26
27 ARGBEGIN {
28 #if FEATURE_GREP_CONTEXT
29+ // ?man -A:num: specify A option
30 case 'A':
31 // ?man -A num: print num lines of trailing context after each match
32 Aflag = estrtonum(EARGF(usage()), 0, LONG_MAX);
33 break;
34+ // ?man -B:num: specify B option
35 case 'B':
36 // ?man -B num: print num lines of leading context before each match
37 Bflag = estrtonum(EARGF(usage()), 0, LONG_MAX);
38 break;
39+ // ?man -C:num: specify C option
40 case 'C':
41 // ?man -C num: print num lines of context before and after each match; equivalent to -A num -B num
42 Aflag = Bflag = estrtonum(EARGF(usage()), 0, LONG_MAX);
43 break;
44+ // ?man ARGNUM: specify RGNUM option
45 ARGNUM:
46 Aflag = Bflag = ARGNUMF();
47 break;
48 #endif
49 #if FEATURE_GREP_MAX_COUNT
50+ // ?man -m:num: specify m option
51 case 'm':
52 // ?man -m num: stop reading a file after num matching lines
53 mval = estrtonum(EARGF(usage()), 0, LONG_MAX);
54 break;
55 #endif
56+ // ?man -E: specify E option
57 case 'E':
58 // ?man -E: interpret pattern as an extended regular expression
59 Eflag = 1;
60 Fflag = 0;
61 flags |= REG_EXTENDED;
62 break;
63+ // ?man -F: specify F option
64 case 'F':
65 // ?man -F: interpret pattern as a list of fixed strings separated by newlines
66 Fflag = 1;
67 Eflag = 0;
68 flags &= ~REG_EXTENDED;
69 break;
70+ // ?man -H: specify H option
71 case 'H':
72 // ?man -H: always print the file name with matching lines
73 Hflag = 1;
74 hflag = 0;
75 break;
76+ // ?man -e:file: specify e option
77 case 'e':
78 // ?man -e pattern: specify a pattern to match; may be given multiple times
79 arg = EARGF(usage());
80@@ -310,6 +317,7 @@ main(int argc, char *argv[])
81 efshut(fp, arg);
82 eflag = 1;
83 break;
84+ // ?man -f:file: specify f option
85 case 'f':
86 // ?man -f file: read patterns from file, one per line
87 arg = EARGF(usage());
88@@ -320,41 +328,51 @@ main(int argc, char *argv[])
89 efshut(fp, arg);
90 fflag = 1;
91 break;
92+ // ?man -h: specify h option
93 case 'h':
94 // ?man -h: never print file names with matching lines
95 hflag = 1;
96 Hflag = 0;
97 break;
98+ // ?man -c: specify c option
99 case 'c':
100 // ?man -c: print only a count of matching lines per file
101 /* FALLTHROUGH */
102+ // ?man -l: specify l option
103 case 'l':
104 // ?man -l: print only the names of files with at least one matching line
105 /* FALLTHROUGH */
106+ // ?man -n: specify n option
107 case 'n':
108 // ?man -n: prefix each matching line with its line number within its file
109 /* FALLTHROUGH */
110+ // ?man -q: specify q option
111 case 'q':
112 // ?man -q: quiet mode; exit immediately with status 0 on first match and write nothing
113 mode = ARGC();
114 break;
115+ // ?man -i: specify i option
116 case 'i':
117 // ?man -i: perform case-insensitive matching
118 flags |= REG_ICASE;
119 iflag = 1;
120 break;
121+ // ?man -s: specify s option
122 case 's':
123 // ?man -s: suppress error messages about nonexistent or unreadable files
124 sflag = 1;
125 break;
126+ // ?man -v: specify v option
127 case 'v':
128 // ?man -v: invert the sense of matching to select non-matching lines
129 vflag = 1;
130 break;
131+ // ?man -w: specify w option
132 case 'w':
133 // ?man -w: match only whole words
134 wflag = 1;
135 break;
136+ // ?man -x: specify x option
137 case 'x':
138 // ?man -x: match only whole lines
139 xflag = 1;
140@@ -405,22 +423,22 @@ main(int argc, char *argv[])
141 if (fshut(stdin, "<stdin>") | fshut(stdout, "<stdout>"))
142 match = Error;
143
144- /* ?man
145- ## Exit status
146-
147- 0
148- : one or more lines matched in at least one file
149-
150- 1
151- : no lines matched in any file
152-
153- 2
154- : an error occurred
155-
156- ## See also
157-
158- sed(1), awk(1)
159- */
160+ // ?man
161+ // ?man ## Exit status
162+ // ?man
163+ // ?man 0
164+ // ?man : one or more lines matched in at least one file
165+ // ?man
166+ // ?man 1
167+ // ?man : no lines matched in any file
168+ // ?man
169+ // ?man 2
170+ // ?man : an error occurred
171+ // ?man
172+ // ?man ## See also
173+ // ?man
174+ // ?man sed(1), awk(1)
175+ // ?man
176
177 return match;
178 }
+5,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-head: output first part of files
5-usage: head [-num | -n num] [file ...]
6
7-print the first lines or bytes of files
8-*/
9
10 #include <stdint.h>
11 #include <stdio.h>
12@@ -35,6 +30,9 @@ usage(void)
13 eprintf("usage: %s [-num | -n num] [file ...]\n", argv0);
14 }
15
16+// ?man head: output first part of files
17+// ?man arguments: file ...
18+// ?man print the first lines or bytes of files
19 int
20 main(int argc, char *argv[])
21 {
22@@ -43,10 +41,11 @@ main(int argc, char *argv[])
23 int ret = 0, newline = 0, many = 0;
24
25 ARGBEGIN {
26- // ?man -n: print line numbers or counts
27+ // ?man -n:num: print line numbers or counts
28 case 'n':
29 n = estrtonum(EARGF(usage()), 0, MIN((unsigned long long)LLONG_MAX, (unsigned long long)SIZE_MAX));
30 break;
31+ // ?man ARGNUM: specify RGNUM option
32 ARGNUM:
33 n = ARGNUMF();
34 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-id: print user and group ids
5-usage: id [-n] [-g | -u | -G] [user | uid]
6
7-display real and effective user and group identities
8-*/
9
10 #include <sys/types.h>
11
12@@ -140,6 +135,9 @@ usage(void)
13 eprintf("usage: %s [-n] [-g | -u | -G] [user | uid]\n", argv0);
14 }
15
16+// ?man id: print user and group ids
17+// ?man arguments: user | uid
18+// ?man display real and effective user and group identities
19 int
20 main(int argc, char *argv[])
21 {
+9,
-12
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-join: join lines on common field
5-usage: join [-1 field] [-2 field] [-o list] [-e string]
6
7-join lines of two sorted files on a common field
8-*/
9
10 #include <ctype.h>
11 #include <stdint.h>
12@@ -456,6 +451,8 @@ join(FILE *fa, FILE *fb, size_t jfa, size_t jfb)
13 }
14
15
16+// ?man join: join lines on common field
17+// ?man join lines of two sorted files on a common field
18 int
19 main(int argc, char *argv[])
20 {
21@@ -465,15 +462,15 @@ main(int argc, char *argv[])
22 char *fno;
23
24 ARGBEGIN {
25- // ?man -1: specify option flag
26+ // ?man -1:num: specify option flag
27 case '1':
28 jf[0] = estrtonum(EARGF(usage()), 1, MIN((unsigned long long)LLONG_MAX, (unsigned long long)SIZE_MAX));
29 break;
30- // ?man -2: specify option flag
31+ // ?man -2:num: specify option flag
32 case '2':
33 jf[1] = estrtonum(EARGF(usage()), 1, MIN((unsigned long long)LLONG_MAX, (unsigned long long)SIZE_MAX));
34 break;
35- // ?man -a: print or show all entries
36+ // ?man -a:str: print or show all entries
37 case 'a':
38 fno = EARGF(usage());
39 if (strcmp(fno, "1") == 0)
40@@ -483,21 +480,21 @@ main(int argc, char *argv[])
41 else
42 usage();
43 break;
44- // ?man -e: specify expression or pattern
45+ // ?man -e:str: specify expression or pattern
46 case 'e':
47 replace = EARGF(usage());
48 break;
49- // ?man -o: specify output file
50+ // ?man -o:str: specify output file
51 case 'o':
52 oflag = 1;
53 initolist(&output);
54 makeolist(&output, EARGF(usage()));
55 break;
56- // ?man -t: sort or specify timestamp
57+ // ?man -t:str: sort or specify timestamp
58 case 't':
59 sep = EARGF(usage());
60 break;
61- // ?man -v: verbose mode; show progress
62+ // ?man -v:str: verbose mode; show progress
63 case 'v':
64 pairs = 0;
65 fno = EARGF(usage());
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-kill: send signal to process
5-usage: kill [-s signame | -num | -signame] pid ...
6
7-send a specified signal to processes by pid
8-*/
9
10 #include "sig.h"
11 #include "util.h"
12@@ -49,6 +44,9 @@ usage(void)
13 " %s -l [num]\n", argv0, argv0);
14 }
15
16+// ?man kill: send signal to process
17+// ?man arguments: pid ...
18+// ?man send a specified signal to processes by pid
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-link: create a link to a file
5-usage: link target name
6
7-create a hard link to an existing file
8-*/
9
10 #include <unistd.h>
11
12@@ -16,6 +11,9 @@ usage(void)
13 eprintf("usage: %s target name\n", argv0);
14 }
15
16+// ?man link: create a link to a file
17+// ?man arguments: target name
18+// ?man create a hard link to an existing file
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-ln: make links between files
5-usage: ln [-f] [-L | -P | -s] target [name]
6
7-create hard or symbolic links between files
8-*/
9
10 #include <sys/stat.h>
11
12@@ -23,6 +18,9 @@ usage(void)
13 " %s [-f] [-L | -P | -s] target ... dir\n", argv0, argv0);
14 }
15
16+// ?man ln: make links between files
17+// ?man arguments: target [name
18+// ?man create hard or symbolic links between files
19 int
20 main(int argc, char *argv[])
21 {
+5,
-7
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-logger: log messages
5-usage: logger [-is] [-p priority] [-t tag] [message ...]
6
7-add messages to the system log
8-*/
9
10 #include <stdio.h>
11 #include <stdlib.h>
12@@ -50,6 +45,9 @@ usage(void)
13 eprintf("usage: %s [-is] [-p priority] [-t tag] [message ...]\n", argv0);
14 }
15
16+// ?man logger: log messages
17+// ?man arguments: message ...
18+// ?man add messages to the system log
19 int
20 main(int argc, char *argv[])
21 {
22@@ -62,7 +60,7 @@ main(int argc, char *argv[])
23 case 'i':
24 logflags |= LOG_PID;
25 break;
26- // ?man -p: preserve file attributes
27+ // ?man -p:str: preserve file attributes
28 case 'p':
29 priority = decodepri(EARGF(usage()));
30 break;
31@@ -70,7 +68,7 @@ main(int argc, char *argv[])
32 case 's':
33 logflags |= LOG_PERROR;
34 break;
35- // ?man -t: sort or specify timestamp
36+ // ?man -t:str: sort or specify timestamp
37 case 't':
38 tag = EARGF(usage());
39 break;
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-logname: print login name
5-usage: logname
6
7-display the user login name
8-*/
9
10 #include <stdio.h>
11 #include <unistd.h>
12@@ -17,6 +12,8 @@ usage(void)
13 eprintf("usage: %s\n", argv0);
14 }
15
16+// ?man logname: print login name
17+// ?man display the user login name
18 int
19 main(int argc, char *argv[])
20 {
+4,
-5
1@@ -1,10 +1,5 @@
2 /* see license file for copyright and license details */
3-/* ?man
4-ls: list directory contents
5-usage: ls [-1ACacdFfGghiLlnopqRrtUu] [--color[=always|never|auto]] [file ...]
6
7-list information about files and directories
8-*/
9
10 #include <sys/stat.h>
11 #include <sys/types.h>
12@@ -556,6 +551,9 @@ usage(void)
13 eprintf("usage: %s [-1ACacdFfGghiLlnopqRrtUu] [--color[=always|never|auto]] [file ...]\n", argv0);
14 }
15
16+// ?man ls: list directory contents
17+// ?man arguments: [file ...
18+// ?man list information about files and directories
19 int
20 main(int argc, char *argv[])
21 {
22@@ -708,6 +706,7 @@ main(int argc, char *argv[])
23 uflag = 1;
24 cflag = 0;
25 break;
26+ // ?man --: specify - option
27 case '-':
28 #if FEATURE_LS_COLOR
29 // ?man --color [when]: control coloring
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-mesg: control write access
5-usage: mesg [n|y]
6
7-allow or disallow other users to write to the terminal
8-*/
9
10 #include <sys/stat.h>
11 #include <sys/types.h>
12@@ -21,6 +16,9 @@ usage(void)
13 eprintf("usage: %s [n|y]\n", argv0);
14 }
15
16+// ?man mesg: control write access
17+// ?man arguments: n|y
18+// ?man allow or disallow other users to write to the terminal
19 int
20 main(int argc, char *argv[])
21 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-mkdir: create directories
5-usage: mkdir [-p] [-m mode] name ...
6
7-create directories at specified paths
8-*/
9
10 #include <sys/stat.h>
11
12@@ -19,6 +14,9 @@ usage(void)
13 eprintf("usage: %s [-p] [-m mode] name ...\n", argv0);
14 }
15
16+// ?man mkdir: create directories
17+// ?man arguments: name ...
18+// ?man create directories at specified paths
19 int
20 main(int argc, char *argv[])
21 {
22@@ -33,7 +31,7 @@ main(int argc, char *argv[])
23 case 'p':
24 pflag = 1;
25 break;
26- // ?man -m: set file mode bits for created directories
27+ // ?man -m:mode: set file mode bits for created directories
28 case 'm':
29 mode = parsemode(EARGF(usage()), 0777, mask);
30 break;
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-mkfifo: make fifos
5-usage: mkfifo [-m mode] name ...
6
7-create named pipes at specified paths
8-*/
9
10 #include <sys/stat.h>
11
12@@ -18,6 +13,9 @@ usage(void)
13 eprintf("usage: %s [-m mode] name ...\n", argv0);
14 }
15
16+// ?man mkfifo: make fifos
17+// ?man arguments: name ...
18+// ?man create named pipes at specified paths
19 int
20 main(int argc, char *argv[])
21 {
22@@ -25,7 +23,7 @@ main(int argc, char *argv[])
23 int ret = 0;
24
25 ARGBEGIN {
26- // ?man -m: specify mode or limit
27+ // ?man -m:mode: specify mode or limit
28 case 'm':
29 mode = parsemode(EARGF(usage()), mode, umask(0));
30 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-mv: move or rename files
5-usage: mv [-f] source ... dest
6
7-move or rename files and directories
8-*/
9
10 #include <sys/stat.h>
11
12@@ -48,6 +43,9 @@ usage(void)
13 eprintf("usage: %s [-f] source ... dest\n", argv0);
14 }
15
16+// ?man mv: move or rename files
17+// ?man arguments: source ... dest
18+// ?man move or rename files and directories
19 int
20 main(int argc, char *argv[])
21 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-nice: run command with modified priority
5-usage: nice [-n inc] cmd [arg ...]
6
7-run a command with modified scheduling priority
8-*/
9
10 #include <sys/resource.h>
11
12@@ -28,13 +23,16 @@ usage(void)
13 eprintf("usage: %s [-n inc] cmd [arg ...]\n", argv0);
14 }
15
16+// ?man nice: run command with modified priority
17+// ?man arguments: cmd [arg ...
18+// ?man run a command with modified scheduling priority
19 int
20 main(int argc, char *argv[])
21 {
22 int val = 10, r, savederrno;
23
24 ARGBEGIN {
25- // ?man -n: print line numbers or counts
26+ // ?man -n:num: print line numbers or counts
27 case 'n':
28 val = estrtonum(EARGF(usage()), PRIO_MIN, PRIO_MAX);
29 break;
+12,
-15
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-nl: number lines
5-usage: nl [-p] [-b type] [-d delim] [-f type]
6
7-number the lines of files
8-*/
9
10 #include <limits.h>
11 #include <stdint.h>
12@@ -123,6 +118,8 @@ getlinetype(char *type, regex_t *preg)
13 return type[0];
14 }
15
16+// ?man nl: number lines
17+// ?man number the lines of files
18 int
19 main(int argc, char *argv[])
20 {
21@@ -132,7 +129,7 @@ main(int argc, char *argv[])
22 char *d, *formattype, *formatblit;
23
24 ARGBEGIN {
25- // ?man -d: specify directory
26+ // ?man -d:str: specify directory
27 case 'd':
28 switch (utflen((d = EARGF(usage())))) {
29 case 0:
30@@ -151,27 +148,27 @@ main(int argc, char *argv[])
31 break;
32 }
33 break;
34- // ?man -f: force the operation
35+ // ?man -f:str: force the operation
36 case 'f':
37 type[0] = getlinetype(EARGF(usage()), preg);
38 break;
39- // ?man -b: specify block size or base directory
40+ // ?man -b:str: specify block size or base directory
41 case 'b':
42 type[1] = getlinetype(EARGF(usage()), preg + 1);
43 break;
44- // ?man -h: suppress headers or print help
45+ // ?man -h:str: suppress headers or print help
46 case 'h':
47 type[2] = getlinetype(EARGF(usage()), preg + 2);
48 break;
49- // ?man -i: interactive mode or prompt for confirmation
50+ // ?man -i:num: interactive mode or prompt for confirmation
51 case 'i':
52 incr = estrtonum(EARGF(usage()), 0, MIN((unsigned long long)LLONG_MAX, (unsigned long long)SIZE_MAX));
53 break;
54- // ?man -l: list in long format
55+ // ?man -l:num: list in long format
56 case 'l':
57 blines = estrtonum(EARGF(usage()), 0, MIN((unsigned long long)LLONG_MAX, (unsigned long long)SIZE_MAX));
58 break;
59- // ?man -n: print line numbers or counts
60+ // ?man -n:str: print line numbers or counts
61 case 'n':
62 formattype = EARGF(usage());
63 estrlcpy(format, "%", sizeof(format));
64@@ -193,16 +190,16 @@ main(int argc, char *argv[])
65 case 'p':
66 pflag = 1;
67 break;
68- // ?man -s: silent mode or print summary
69+ // ?man -s:str: silent mode or print summary
70 case 's':
71 sep = EARGF(usage());
72 seplen = unescape(sep);
73 break;
74- // ?man -v: verbose mode; show progress
75+ // ?man -v:num: verbose mode; show progress
76 case 'v':
77 startnum = estrtonum(EARGF(usage()), 0, MIN((unsigned long long)LLONG_MAX, (unsigned long long)SIZE_MAX));
78 break;
79- // ?man -w: wait for completion
80+ // ?man -w:num: wait for completion
81 case 'w':
82 width = estrtonum(EARGF(usage()), 1, INT_MAX);
83 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-nohup: run command immune to hangups
5-usage: nohup cmd [arg ...]
6
7-run a command that persists after logging out
8-*/
9
10 #include <sys/stat.h>
11
12@@ -21,6 +16,9 @@ usage(void)
13 eprintf("usage: %s cmd [arg ...]\n", argv0);
14 }
15
16+// ?man nohup: run command immune to hangups
17+// ?man arguments: cmd [arg ...
18+// ?man run a command that persists after logging out
19 int
20 main(int argc, char *argv[])
21 {
+16,
-19
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-od: dump files in formats
5-usage: od [-bdosvx] [-A addressformat]
6
7-display file contents in octal, hex, or other formats
8-*/
9
10 #include "queue.h"
11 #include "util.h"
12@@ -219,6 +214,8 @@ usage(void)
13 "[-j skip] [-t outputformat] [file ...]\n", argv0);
14 }
15
16+// ?man od: dump files in formats
17+// ?man display file contents in octal, hex, or other formats
18 int
19 main(int argc, char *argv[])
20 {
21@@ -229,7 +226,7 @@ main(int argc, char *argv[])
22 big_endian = (*(uint16_t *)"\0\xff" == 0xff);
23
24 ARGBEGIN {
25- // ?man -A: specify option flag
26+ // ?man -A:str: specify option flag
27 case 'A':
28 s = EARGF(usage());
29 if (strlen(s) != 1 || !strchr("doxn", s[0]))
30@@ -252,12 +249,12 @@ main(int argc, char *argv[])
31 big_endian = (ARGC() == 'E');
32 break;
33 #endif
34- // ?man -j: specify option flag
35+ // ?man -j:str: specify option flag
36 case 'j':
37 if ((skip = parseoffset(EARGF(usage()))) < 0)
38 usage();
39 break;
40- // ?man -N: specify option flag
41+ // ?man -N:str: specify option flag
42 case 'N':
43 if ((max = parseoffset(EARGF(usage()))) < 0)
44 usage();
45@@ -270,24 +267,24 @@ main(int argc, char *argv[])
46 case 's':
47 addtype('d', 2);
48 break;
49- // ?man -t: sort or specify timestamp
50+ // ?man -t:str: sort or specify timestamp
51 case 't':
52 s = EARGF(usage());
53 for (; *s; s++) {
54 switch (*s) {
55- // ?man -a: print or show all entries
56+ // ?man -a: print or show all entries
57 case 'a':
58- // ?man -c: print count or perform stdout action
59+ // ?man -c: print count or perform stdout action
60 case 'c':
61 addtype(*s, 1);
62 break;
63- // ?man -d: specify directory
64+ // ?man -d: specify directory
65 case 'd':
66- // ?man -o: specify output file
67+ // ?man -o: specify output file
68 case 'o':
69- // ?man -u: unbuffered output
70+ // ?man -u: unbuffered output
71 case 'u':
72- // ?man -x: hex format or match whole lines
73+ // ?man -x: hex format or match whole lines
74 case 'x':
75 fmt_char = *s;
76 if (isdigit((unsigned char)*(s + 1))) {
77@@ -295,22 +292,22 @@ main(int argc, char *argv[])
78 s = end - 1;
79 } else {
80 switch (*(s + 1)) {
81- // ?man -C: specify option flag
82+ // ?man -C: specify option flag
83 case 'C':
84 len = sizeof(char);
85 s++;
86 break;
87- // ?man -S: specify option flag
88+ // ?man -S: specify option flag
89 case 'S':
90 len = sizeof(short);
91 s++;
92 break;
93- // ?man -I: specify option flag
94+ // ?man -I: specify option flag
95 case 'I':
96 len = sizeof(int);
97 s++;
98 break;
99- // ?man -L: specify option flag
100+ // ?man -L: specify option flag
101 case 'L':
102 len = sizeof(long);
103 s++;
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-paste: merge lines of files
5-usage: paste [-s] [-d list] file ...
6
7-merge corresponding lines of files side by side
8-*/
9
10 #include <stdlib.h>
11 #include <string.h>
12@@ -91,6 +86,9 @@ usage(void)
13 eprintf("usage: %s [-s] [-d list] file ...\n", argv0);
14 }
15
16+// ?man paste: merge lines of files
17+// ?man arguments: file ...
18+// ?man merge corresponding lines of files side by side
19 int
20 main(int argc, char *argv[])
21 {
22@@ -105,7 +103,7 @@ main(int argc, char *argv[])
23 case 's':
24 seq = 1;
25 break;
26- // ?man -d: specify directory
27+ // ?man -d:str: specify directory
28 case 'd':
29 delim = EARGF(usage());
30 delim_bytelen = unescape(delim);
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-pathchk: check pathnames
5-usage: pathchk [-pP] filename...
6
7-verify that pathnames are valid and portable
8-*/
9
10 #include <sys/stat.h>
11
12@@ -85,6 +80,9 @@ usage(void)
13 eprintf("usage: %s [-pP] filename...\n", argv0);
14 }
15
16+// ?man pathchk: check pathnames
17+// ?man arguments: filename...
18+// ?man verify that pathnames are valid and portable
19 int
20 main(int argc, char *argv[])
21 {
+13,
-16
1@@ -1,9 +1,4 @@
2-/* ?man
3-pax: portable archive interchange
4-usage: pax
5
6-read, write, and list member files of archive files
7-*/
8
9 /* taken from: https://github.com/michaelforney/pax */
10 #ifndef _GNU_SOURCE
11@@ -2337,6 +2332,8 @@ handle_append(const char *filename, const char *algo, const char *format)
12 }
13 }
14
15+// ?man pax: portable archive interchange
16+// ?man read, write, and list member files of archive files
17 int
18 main(int argc, char *argv[])
19 {
20@@ -2356,7 +2353,7 @@ main(int argc, char *argv[])
21 case 'a':
22 aflag = 1;
23 break;
24- // ?man -b: specify block size or base directory
25+ // ?man -b:str: specify block size or base directory
26 case 'b':
27 EARGF(usage());
28 break;
29@@ -2368,7 +2365,7 @@ main(int argc, char *argv[])
30 case 'd':
31 dflag = 1;
32 break;
33- // ?man -f: force the operation
34+ // ?man -f:str: force the operation
35 case 'f':
36 name = EARGF(usage());
37 break;
38@@ -2404,23 +2401,23 @@ main(int argc, char *argv[])
39 case 'n':
40 nflag = 1;
41 break;
42- // ?man -o: specify output file
43+ // ?man -o:str: specify output file
44 case 'o':
45 parseopts(EARGF(usage()));
46 break;
47- // ?man -p: preserve file attributes
48+ // ?man -p:str: preserve file attributes
49 case 'p':
50 for (arg = EARGF(usage()); *arg; ++arg) {
51 switch (*arg) {
52- // ?man -a: print or show all entries
53+ // ?man -a: print or show all entries
54 case 'a': preserve &= ~ATIME; break;
55- // ?man -e: specify expression or pattern
56+ // ?man -e: specify expression or pattern
57 case 'e': preserve = ~0; break;
58- // ?man -m: specify mode or limit
59+ // ?man -m: specify mode or limit
60 case 'm': preserve &= ~MTIME; break;
61- // ?man -o: specify output file
62+ // ?man -o: specify output file
63 case 'o': preserve |= UID | GID; break;
64- // ?man -p: preserve file attributes
65+ // ?man -p: preserve file attributes
66 case 'p': preserve |= MODE; break;
67 default: fatal("unknown -p option");
68 }
69@@ -2430,7 +2427,7 @@ main(int argc, char *argv[])
70 case 'r':
71 mode |= READ;
72 break;
73- // ?man -s: silent mode or print summary
74+ // ?man -s:str: silent mode or print summary
75 case 's':
76 parsereplstr(EARGF(usage()));
77 break;
78@@ -2450,7 +2447,7 @@ main(int argc, char *argv[])
79 case 'w':
80 mode |= WRITE;
81 break;
82- // ?man -x: hex format or match whole lines
83+ // ?man -x:str: hex format or match whole lines
84 case 'x':
85 format = EARGF(usage());
86 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-printf: format and print data
5-usage: printf format [arg ...]
6
7-format and print arguments to standard output
8-*/
9
10 #include <ctype.h>
11 #include <errno.h>
12@@ -79,6 +74,9 @@ usage(void)
13 eprintf("usage: %s format [arg ...]\n", argv0);
14 }
15
16+// ?man printf: format and print data
17+// ?man arguments: format [arg ...
18+// ?man format and print arguments to standard output
19 int
20 main(int argc, char *argv[])
21 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-ps: report process status
5-usage: ps [-aAdef]
6
7-display information about active system processes
8-*/
9
10 #include <sys/ioctl.h>
11 #include <sys/sysinfo.h>
12@@ -155,6 +150,8 @@ usage(void)
13 eprintf("usage: %s [-aAdef]\n", argv0);
14 }
15
16+// ?man ps: report process status
17+// ?man display information about active system processes
18 int
19 main(int argc, char *argv[])
20 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-pwd: print working directory
5-usage: pwd [-LP]
6
7-display the pathname of the current working directory
8-*/
9
10 #include <sys/stat.h>
11
12@@ -34,6 +29,8 @@ usage(void)
13 eprintf("usage: %s [-LP]\n", argv0);
14 }
15
16+// ?man pwd: print working directory
17+// ?man display the pathname of the current working directory
18 int
19 main(int argc, char *argv[])
20 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-readlink: print value of symlink
5-usage: readlink [-fn] path
6
7-display the target of a symbolic link
8-*/
9
10 #include <limits.h>
11 #include <stdio.h>
12@@ -24,6 +19,9 @@ usage(void)
13 #endif
14 }
15
16+// ?man readlink: print value of symlink
17+// ?man arguments: path
18+// ?man display the target of a symbolic link
19 int
20 main(int argc, char *argv[])
21 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-renice: alter priority of processes
5-usage: renice -n num [-g | -p | -u] id ...
6
7-change the scheduling priority of running processes
8-*/
9
10 #include <sys/resource.h>
11
12@@ -47,6 +42,9 @@ usage(void)
13 eprintf("usage: %s -n num [-g | -p | -u] id ...\n", argv0);
14 }
15
16+// ?man renice: alter priority of processes
17+// ?man arguments: -n num id ...
18+// ?man change the scheduling priority of running processes
19 int
20 main(int argc, char *argv[])
21 {
22@@ -57,7 +55,7 @@ main(int argc, char *argv[])
23 int who;
24
25 ARGBEGIN {
26- // ?man -n: print line numbers or counts
27+ // ?man -n:str: print line numbers or counts
28 case 'n':
29 adj = EARGF(usage());
30 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-rm: remove files
5-usage: rm [-f] [-iRr] file ...
6
7-remove files and directory hierarchies
8-*/
9
10 #include <fcntl.h>
11 #include <string.h>
12@@ -51,6 +46,9 @@ forbidden(char *path, struct stat *root)
13 return 0;
14 }
15
16+// ?man rm: remove files
17+// ?man arguments: file ...
18+// ?man remove files and directory hierarchies
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-rmdir: remove empty directories
5-usage: rmdir [-p] dir ...
6
7-remove empty directories from the filesystem
8-*/
9
10 #include <libgen.h>
11 #include <string.h>
12@@ -18,6 +13,9 @@ usage(void)
13 eprintf("usage: %s [-p] dir ...\n", argv0);
14 }
15
16+// ?man rmdir: remove empty directories
17+// ?man arguments: dir ...
18+// ?man remove empty directories from the filesystem
19 int
20 main(int argc, char *argv[])
21 {
+5,
-7
1@@ -1,9 +1,4 @@
2-/* ?man
3-sed: stream editor
4-usage: sed [-nrE] script [file ...]
5
6-stream editor for filtering and transforming text
7-*/
8
9 /* FIXME: summary
10 * decide whether we enforce valid UTF-8, right now it's enforced in certain
11@@ -1754,6 +1749,9 @@ old_next(void)
12 pc = prog - 1;
13 }
14
15+// ?man sed: stream editor
16+// ?man arguments: script [file ...
17+// ?man stream editor for filtering and transforming text
18 int
19 main(int argc, char *argv[])
20 {
21@@ -1771,13 +1769,13 @@ main(int argc, char *argv[])
22 case 'E':
23 gflags.E = 1;
24 break;
25- // ?man -e: specify expression or pattern
26+ // ?man -e:str: specify expression or pattern
27 case 'e':
28 arg = EARGF(usage());
29 compile(arg, 0);
30 script = 1;
31 break;
32- // ?man -f: force the operation
33+ // ?man -f:str: force the operation
34 case 'f':
35 arg = EARGF(usage());
36 compile(arg, 1);
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-sleep: delay for a duration
5-usage: sleep num
6
7-pause execution for a specified amount of time
8-*/
9
10 #include <unistd.h>
11
12@@ -16,6 +11,9 @@ usage(void)
13 eprintf("usage: %s num\n", argv0);
14 }
15
16+// ?man sleep: delay for a duration
17+// ?man arguments: num
18+// ?man pause execution for a specified amount of time
19 int
20 main(int argc, char *argv[])
21 {
+6,
-8
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-sort: sort lines
5-usage: sort [-Cbcdfimnru
6
7-sort or merge lines of text files
8-*/
9
10 #include "queue.h"
11 #include "text.h"
12@@ -400,6 +395,9 @@ usage(void)
13 "] [-o outfile] [-t delim] [-k def]... [file ...]\n", argv0);
14 }
15
16+// ?man sort: sort lines
17+// ?man arguments: -Cbcdfimnru
18+// ?man sort or merge lines of text files
19 int
20 main(int argc, char *argv[])
21 {
22@@ -434,7 +432,7 @@ main(int argc, char *argv[])
23 case 'i':
24 global_flags |= MOD_I;
25 break;
26- // ?man -k: specify option flag
27+ // ?man -k:str: specify option flag
28 case 'k':
29 addkeydef(EARGF(usage()), global_flags);
30 break;
31@@ -450,7 +448,7 @@ main(int argc, char *argv[])
32 case 'n':
33 global_flags |= MOD_N;
34 break;
35- // ?man -o: specify output file
36+ // ?man -o:file: specify output file
37 case 'o':
38 outfile = EARGF(usage());
39 break;
40@@ -464,7 +462,7 @@ main(int argc, char *argv[])
41 sflag = 1;
42 break;
43 #endif
44- // ?man -t: sort or specify timestamp
45+ // ?man -t:str: sort or specify timestamp
46 case 't':
47 fieldsep = EARGF(usage());
48 if (!*fieldsep)
+6,
-8
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-split: split file into pieces
5-usage: split [-a num] [-b num[k|m|g] | -l num] [-d]
6
7-split a file into fixed-size pieces
8-*/
9
10 #include <ctype.h>
11 #include <stdint.h>
12@@ -51,6 +46,9 @@ usage(void)
13 "[file [prefix]]\n", argv0);
14 }
15
16+// ?man split: split file into pieces
17+// ?man arguments: | -l num
18+// ?man split a file into fixed-size pieces
19 int
20 main(int argc, char *argv[])
21 {
22@@ -60,11 +58,11 @@ main(int argc, char *argv[])
23 char name[NAME_MAX + 1], *prefix = "x", *file = NULL;
24
25 ARGBEGIN {
26- // ?man -a: print or show all entries
27+ // ?man -a:num: print or show all entries
28 case 'a':
29 slen = estrtonum(EARGF(usage()), 0, INT_MAX);
30 break;
31- // ?man -b: specify block size or base directory
32+ // ?man -b:str: specify block size or base directory
33 case 'b':
34 always = 1;
35 if ((size = parseoffset(EARGF(usage()))) < 0)
36@@ -77,7 +75,7 @@ main(int argc, char *argv[])
37 base = 10;
38 start = '0';
39 break;
40- // ?man -l: list in long format
41+ // ?man -l:num: list in long format
42 case 'l':
43 always = 0;
44 size = estrtonum(EARGF(usage()), 1, MIN(LLONG_MAX, SSIZE_MAX));
+5,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-tail: output last part of files
5-usage: tail [-f] [-c num | -m num | -n num | -num] [file ...]
6
7-print the last lines or bytes of files
8-*/
9
10 #include <sys/stat.h>
11
12@@ -159,6 +154,9 @@ usage(void)
13 eprintf("usage: %s [-f] [-c num | -m num | -n num | -num] [file ...]\n", argv0);
14 }
15
16+// ?man tail: output last part of files
17+// ?man arguments: file ...
18+// ?man print the last lines or bytes of files
19 int
20 main(int argc, char *argv[])
21 {
22@@ -178,7 +176,7 @@ main(int argc, char *argv[])
23 case 'c':
24 // ?man -m: specify mode or limit
25 case 'm':
26- // ?man -n: print line numbers or counts
27+ // ?man -n:num: print line numbers or counts
28 case 'n':
29 mode = ARGC();
30 numstr = EARGF(usage());
31@@ -187,6 +185,7 @@ main(int argc, char *argv[])
32 if (strchr(numstr, '+'))
33 tail = dropinit;
34 break;
35+ // ?man ARGNUM: specify RGNUM option
36 ARGNUM:
37 n = ARGNUMF();
38 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-tee: duplicate input
5-usage: tee [-ai] [file ...]
6
7-read from standard input and write to standard output and files
8-*/
9
10 #include <fcntl.h>
11 #include <signal.h>
12@@ -18,6 +13,9 @@ usage(void)
13 eprintf("usage: %s [-ai] [file ...]\n", argv0);
14 }
15
16+// ?man tee: duplicate input
17+// ?man arguments: file ...
18+// ?man read from standard input and write to standard output and files
19 int
20 main(int argc, char *argv[])
21 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-test: evaluate condition
5-usage: test
6
7-check file types and compare values, returning 0 or 1
8-*/
9
10 #include <sys/stat.h>
11
12@@ -236,6 +231,8 @@ fourarg(char *argv[])
13 return 0; /* not reached */
14 }
15
16+// ?man test: evaluate condition
17+// ?man check file types and compare values, returning 0 or 1
18 int
19 main(int argc, char *argv[])
20 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-time: time command execution
5-usage: time [-p] cmd [arg ...]
6
7-run a command and report its execution duration
8-*/
9
10 #include <sys/times.h>
11 #include <sys/wait.h>
12@@ -21,6 +16,9 @@ usage(void)
13 eprintf("usage: %s [-p] cmd [arg ...]\n", argv0);
14 }
15
16+// ?man time: time command execution
17+// ?man arguments: cmd [arg ...
18+// ?man run a command and report its execution duration
19 int
20 main(int argc, char *argv[])
21 {
+5,
-8
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-touch: change file timestamps
5-usage: touch [-acm] [-d time | -r ref_file | -t time | -T time]
6
7-update the access and modification times of files
8-*/
9
10 #include <sys/stat.h>
11
12@@ -112,6 +107,8 @@ usage(void)
13 "file ...\n", argv0);
14 }
15
16+// ?man touch: change file timestamps
17+// ?man update the access and modification times of files
18 int
19 main(int argc, char *argv[])
20 {
21@@ -129,7 +126,7 @@ main(int argc, char *argv[])
22 break;
23 // ?man -d: specify directory
24 case 'd':
25- // ?man -t: sort or specify timestamp
26+ // ?man -t:str: sort or specify timestamp
27 case 't':
28 times[0].tv_sec = parsetime(EARGF(usage()));
29 times[0].tv_nsec = 0;
30@@ -138,7 +135,7 @@ main(int argc, char *argv[])
31 case 'm':
32 mflag = 1;
33 break;
34- // ?man -r: operate recursively
35+ // ?man -r:str: operate recursively
36 case 'r':
37 ref = EARGF(usage());
38 if (stat(ref, &st) < 0)
39@@ -146,7 +143,7 @@ main(int argc, char *argv[])
40 times[0] = st.st_atim;
41 times[1] = st.st_mtim;
42 break;
43- // ?man -T: specify option flag
44+ // ?man -T:num: specify option flag
45 case 'T':
46 times[0].tv_sec = estrtonum(EARGF(usage()), 0, LLONG_MAX);
47 times[0].tv_nsec = 0;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-tr: translate characters
5-usage: tr [-cCds] set1 [set2]
6
7-translate, squeeze, or delete characters from standard input
8-*/
9
10 #include <stdlib.h>
11
12@@ -194,6 +189,9 @@ usage(void)
13 eprintf("usage: %s [-cCds] set1 [set2]\n", argv0);
14 }
15
16+// ?man tr: translate characters
17+// ?man arguments: set1 [set2
18+// ?man translate, squeeze, or delete characters from standard input
19 int
20 main(int argc, char *argv[])
21 {
+2,
-5
1@@ -1,11 +1,8 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-true: return successful exit status
5-usage: true
6
7-exit with status 0 representing success
8-*/
9
10+// ?man true: return successful exit status
11+// ?man exit with status 0 representing success
12 int
13 main(void)
14 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-tsort: topological sort
5-usage: tsort [file]
6
7-perform a topological sort on input pairs
8-*/
9
10 #include <stdio.h>
11 #include <string.h>
12@@ -185,6 +180,9 @@ usage(void)
13 enprintf(2, "usage: %s [file]\n", argv0);
14 }
15
16+// ?man tsort: topological sort
17+// ?man arguments: file
18+// ?man perform a topological sort on input pairs
19 int
20 main(int argc, char *argv[])
21 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-tty: print terminal filename
5-usage: tty
6
7-display the filename of the terminal connected to stdin
8-*/
9
10 #include <stdio.h>
11 #include <unistd.h>
12@@ -17,6 +12,8 @@ usage(void)
13 enprintf(2, "usage: %s\n", argv0);
14 }
15
16+// ?man tty: print terminal filename
17+// ?man display the filename of the terminal connected to stdin
18 int
19 main(int argc, char *argv[])
20 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-uname: print system info
5-usage: uname [-amnrsv]
6
7-display system hostname, kernel name, release, and architecture
8-*/
9
10 #include <sys/utsname.h>
11
12@@ -18,6 +13,8 @@ usage(void)
13 eprintf("usage: %s [-amnrsv]\n", argv0);
14 }
15
16+// ?man uname: print system info
17+// ?man display system hostname, kernel name, release, and architecture
18 int
19 main(int argc, char *argv[])
20 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-unexpand: convert spaces to tabs
5-usage: unexpand [-a] [-t tablist] [file ...]
6
7-convert space characters to tab characters
8-*/
9
10 #include <stdint.h>
11 #include <stdlib.h>
12@@ -135,6 +130,9 @@ usage(void)
13 eprintf("usage: %s [-a] [-t tablist] [file ...]\n", argv0);
14 }
15
16+// ?man unexpand: convert spaces to tabs
17+// ?man arguments: file ...
18+// ?man convert space characters to tab characters
19 int
20 main(int argc, char *argv[])
21 {
22@@ -143,7 +141,7 @@ main(int argc, char *argv[])
23 char *tl = "8";
24
25 ARGBEGIN {
26- // ?man -t: sort or specify timestamp
27+ // ?man -t:str: sort or specify timestamp
28 case 't':
29 tl = EARGF(usage());
30 if (!*tl)
+4,
-7
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-uniq: report duplicate lines
5-usage: uniq [-c] [-d | -u] [-f fields] [-s chars]
6
7-filter out repeated lines from sorted files
8-*/
9
10 #include <ctype.h>
11 #include <stdio.h>
12@@ -104,6 +99,8 @@ usage(void)
13 " [input [output]]\n", argv0);
14 }
15
16+// ?man uniq: report duplicate lines
17+// ?man filter out repeated lines from sorted files
18 int
19 main(int argc, char *argv[])
20 {
21@@ -124,11 +121,11 @@ main(int argc, char *argv[])
22 case 'u':
23 uflag = 1;
24 break;
25- // ?man -f: force the operation
26+ // ?man -f:num: force the operation
27 case 'f':
28 fskip = estrtonum(EARGF(usage()), 0, INT_MAX);
29 break;
30- // ?man -s: silent mode or print summary
31+ // ?man -s:num: silent mode or print summary
32 case 's':
33 sskip = estrtonum(EARGF(usage()), 0, INT_MAX);
34 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-unlink: remove a file
5-usage: unlink file
6
7-call the unlink system call to remove a file
8-*/
9
10 #include <unistd.h>
11
12@@ -16,6 +11,9 @@ usage(void)
13 eprintf("usage: %s file\n", argv0);
14 }
15
16+// ?man unlink: remove a file
17+// ?man arguments: file
18+// ?man call the unlink system call to remove a file
19 int
20 main(int argc, char *argv[])
21 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-uudecode: decode uuencoded file
5-usage: uudecode [-m] [-o output] [file]
6
7-decode a file created by uuencode
8-*/
9
10 #include <sys/stat.h>
11
12@@ -231,6 +226,9 @@ usage(void)
13 eprintf("usage: %s [-m] [-o output] [file]\n", argv0);
14 }
15
16+// ?man uudecode: decode uuencoded file
17+// ?man arguments: file
18+// ?man decode a file created by uuencode
19 int
20 main(int argc, char *argv[])
21 {
22@@ -245,7 +243,7 @@ main(int argc, char *argv[])
23 case 'm':
24 mflag = 1; /* accepted but unused (autodetect file type) */
25 break;
26- // ?man -o: specify output file
27+ // ?man -o:str: specify output file
28 case 'o':
29 oflag = 1;
30 ofname = EARGF(usage());
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-uuencode: encode binary file
5-usage: uuencode [-m] [file] name
6
7-encode a binary file into ascii text
8-*/
9
10 #include <sys/stat.h>
11
12@@ -103,6 +98,9 @@ usage(void)
13 eprintf("usage: %s [-m] [file] name\n", argv0);
14 }
15
16+// ?man uuencode: encode binary file
17+// ?man arguments: file] name
18+// ?man encode a binary file into ascii text
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-wc: count lines, words, and bytes
5-usage: wc [-c | -m] [-lw] [file ...]
6
7-display the number of lines, words, and bytes in files
8-*/
9
10 #include <string.h>
11
12@@ -73,6 +68,9 @@ usage(void)
13 eprintf("usage: %s [-c | -m] [-lw] [file ...]\n", argv0);
14 }
15
16+// ?man wc: count lines, words, and bytes
17+// ?man arguments: file ...
18+// ?man display the number of lines, words, and bytes in files
19 int
20 main(int argc, char *argv[])
21 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-who: show logged in users
5-usage: who [-ml]
6
7-display a list of users currently logged into the system
8-*/
9
10 #include <stdio.h>
11 #include <stdlib.h>
12@@ -22,6 +17,8 @@ usage(void)
13 eprintf("usage: %s [-ml]\n", argv0);
14 }
15
16+// ?man who: show logged in users
17+// ?man display a list of users currently logged into the system
18 int
19 main(int argc, char *argv[])
20 {
+9,
-11
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-xargs: build and run command lines
5-usage: xargs [-0prtx] [-E eofstr] [-I replstr] [-L maxlines] [-n
6
7-execute commands built from standard input arguments
8-*/
9
10 #include <sys/wait.h>
11
12@@ -268,6 +263,9 @@ usage(void)
13 argv0);
14 }
15
16+// ?man xargs: build and run command lines
17+// ?man arguments: -n
18+// ?man execute commands built from standard input arguments
19 int
20 main(int argc, char *argv[])
21 {
22@@ -289,7 +287,7 @@ main(int argc, char *argv[])
23 case '0':
24 nulflag = 1;
25 break;
26- // ?man -n: print line numbers or counts
27+ // ?man -n:num: print line numbers or counts
28 case 'n':
29 nflag = 1;
30 maxargs =
31@@ -303,7 +301,7 @@ main(int argc, char *argv[])
32 case 'r':
33 rflag = 1;
34 break;
35- // ?man -s: silent mode or print summary
36+ // ?man -s:num: silent mode or print summary
37 case 's':
38 argmaxsz =
39 estrtonum(EARGF(usage()), 1, MIN((unsigned long long)SIZE_MAX, (unsigned long long)LLONG_MAX));
40@@ -316,11 +314,11 @@ main(int argc, char *argv[])
41 case 'x':
42 xflag = 1;
43 break;
44- // ?man -E: specify option flag
45+ // ?man -E:str: specify option flag
46 case 'E':
47 eofstr = EARGF(usage());
48 break;
49- // ?man -I: specify option flag
50+ // ?man -I:str: specify option flag
51 case 'I':
52 Iflag = 1;
53 xflag = 1;
54@@ -328,13 +326,13 @@ main(int argc, char *argv[])
55 maxargs = 1;
56 replstr = EARGF(usage());
57 break;
58- // ?man -L: specify option flag
59+ // ?man -L:num: specify option flag
60 case 'L':
61 Lflag = 1;
62 maxlines =
63 estrtonum(EARGF(usage()), 1, MIN((unsigned long long)SIZE_MAX, (unsigned long long)LLONG_MAX));
64 break;
65- // ?man -P: specify option flag
66+ // ?man -P:num: specify option flag
67 case 'P':
68 maxprocs =
69 estrtonum(EARGF(usage()), 1, MIN((unsigned long long)SIZE_MAX, (unsigned long long)LLONG_MAX));
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-base64: encode or decode base64
5-usage: base64 [-d] [-i] [-w cols] [file]
6
7-encode or decode data in base64 format
8-*/
9
10 #include "util.h"
11 #include "arg.h"
12@@ -135,6 +130,9 @@ decode_stream(FILE *fp, int iflag)
13 eprintf("input is truncated\n");
14 }
15
16+// ?man base64: encode or decode base64
17+// ?man arguments: file
18+// ?man encode or decode data in base64 format
19 int
20 main(int argc, char *argv[])
21 {
22@@ -157,7 +155,7 @@ main(int argc, char *argv[])
23 case 'i':
24 iflag = 1;
25 break;
26- // ?man -w: wait for completion
27+ // ?man -w:num: wait for completion
28 case 'w':
29 wrap = estrtonum(EARGF(usage()), 0, MIN((unsigned long long)LLONG_MAX, (unsigned long long)SSIZE_MAX));
30 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-chroot: run command in new root
5-usage: chroot dir [cmd [arg ...]]
6
7-run a command or shell with a substitute root directory
8-*/
9
10 #include <errno.h>
11 #include <stdlib.h>
12@@ -18,6 +13,9 @@ usage(void)
13 eprintf("usage: %s dir [cmd [arg ...]]\n", argv0);
14 }
15
16+// ?man chroot: run command in new root
17+// ?man arguments: dir [cmd [arg ...
18+// ?man run a command or shell with a substitute root directory
19 int
20 main(int argc, char *argv[])
21 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-clear: clear terminal screen
5-usage: clear
6
7-clear the terminal screen and scrollback buffer
8-*/
9
10 #include <stdio.h>
11
12@@ -16,6 +11,8 @@ usage(void)
13 eprintf("usage: %s\n", argv0);
14 }
15
16+// ?man clear: clear terminal screen
17+// ?man clear the terminal screen and scrollback buffer
18 int
19 main(int argc, char *argv[])
20 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-cols: format columns
5-usage: cols [-c num] [file ...]
6
7-format standard input into vertical columns
8-*/
9
10 #include <sys/ioctl.h>
11
12@@ -24,6 +19,9 @@ usage(void)
13 eprintf("usage: %s [-c num] [file ...]\n", argv0);
14 }
15
16+// ?man cols: format columns
17+// ?man arguments: file ...
18+// ?man format standard input into vertical columns
19 int
20 main(int argc, char *argv[])
21 {
22@@ -35,7 +33,7 @@ main(int argc, char *argv[])
23 char *p;
24
25 ARGBEGIN {
26- // ?man -c: print count or perform stdout action
27+ // ?man -c:num: print count or perform stdout action
28 case 'c':
29 cflag = 1;
30 chars = estrtonum(EARGF(usage()), 1, MIN((unsigned long long)LLONG_MAX, (unsigned long long)SIZE_MAX));
+3,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-cron: cron daemon
5-usage: cron [-f file] [-n]
6
7-daemon to run scheduled background commands
8-*/
9
10 #include <sys/types.h>
11 #include <sys/wait.h>
12@@ -495,6 +490,8 @@ usage(void)
13 eprintf("usage: %s [-f file] [-n]\n", argv0);
14 }
15
16+// ?man cron: cron daemon
17+// ?man daemon to run scheduled background commands
18 int
19 main(int argc, char *argv[])
20 {
21@@ -509,7 +506,7 @@ main(int argc, char *argv[])
22 case 'n':
23 nflag = 1;
24 break;
25- // ?man -f: force the operation
26+ // ?man -f:str: force the operation
27 case 'f':
28 config = EARGF(usage());
29 break;
+3,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-dmesg: print kernel ring buffer
5-usage: dmesg [-Ccr] [-n level]
6
7-display or control the kernel ring buffer messages
8-*/
9
10 #include <stdio.h>
11 #include <stdlib.h>
12@@ -36,6 +31,8 @@ usage(void)
13 eprintf("usage: %s [-Ccr] [-n level]\n", argv0);
14 }
15
16+// ?man dmesg: print kernel ring buffer
17+// ?man display or control the kernel ring buffer messages
18 int
19 main(int argc, char *argv[])
20 {
21@@ -57,7 +54,7 @@ main(int argc, char *argv[])
22 // ?man -r: operate recursively
23 case 'r':
24 break;
25- // ?man -n: print line numbers or counts
26+ // ?man -n:num: print line numbers or counts
27 case 'n':
28 level = estrtol(EARGF(usage()), 10);
29 if (set_console_level(level) < 0)
+5,
-7
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-fallocate: preallocate file space
5-usage: fallocate [-o num] -l num file ...
6
7-preallocate or deallocate space to a file
8-*/
9
10 #include <sys/stat.h>
11
12@@ -23,6 +18,9 @@ usage(void)
13 eprintf("usage: %s [-o num] -l num file ...\n", argv0);
14 }
15
16+// ?man fallocate: preallocate file space
17+// ?man arguments: -l num file ...
18+// ?man preallocate or deallocate space to a file
19 int
20 main(int argc, char *argv[])
21 {
22@@ -30,11 +28,11 @@ main(int argc, char *argv[])
23 off_t size = 0, offset = 0;
24
25 ARGBEGIN {
26- // ?man -l: list in long format
27+ // ?man -l:num: list in long format
28 case 'l':
29 size = estrtonum(EARGF(usage()), 1, MIN((unsigned long long)LLONG_MAX, (unsigned long long)SIZE_MAX));
30 break;
31- // ?man -o: specify output file
32+ // ?man -o:num: specify output file
33 case 'o':
34 offset = estrtonum(EARGF(usage()), 0, MIN((unsigned long long)LLONG_MAX, (unsigned long long)SIZE_MAX));
35 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-flock: manage locks
5-usage: flock [-nosux] file cmd [arg ...]
6
7-acquire or release locks from shell scripts
8-*/
9
10 #include <sys/file.h>
11 #include <sys/wait.h>
12@@ -22,6 +17,9 @@ usage(void)
13 eprintf("usage: %s [-nosux] file cmd [arg ...]\n", argv0);
14 }
15
16+// ?man flock: manage locks
17+// ?man arguments: file cmd [arg ...
18+// ?man acquire or release locks from shell scripts
19 int
20 main(int argc, char *argv[])
21 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-free: display memory usage
5-usage: free [-bkmg]
6
7-display the amount of free and used memory in the system
8-*/
9
10 #include <stdio.h>
11 #include <stdlib.h>
12@@ -28,6 +23,8 @@ usage(void)
13 eprintf("usage: %s [-bkmg]\n", argv0);
14 }
15
16+// ?man free: display memory usage
17+// ?man display the amount of free and used memory in the system
18 int
19 main(int argc, char *argv[])
20 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-getty: set terminal mode
5-usage: getty [tty] [term] [cmd] [args...]
6
7-set terminal line discipline, speed, and mode
8-*/
9
10 #include <sys/ioctl.h>
11 #include <sys/stat.h>
12@@ -31,6 +26,9 @@ usage(void)
13 eprintf("usage: %s [tty] [term] [cmd] [args...]\n", argv0);
14 }
15
16+// ?man getty: set terminal mode
17+// ?man arguments: tty] [term] [cmd] [args...
18+// ?man set terminal line discipline, speed, and mode
19 int
20 main(int argc, char *argv[])
21 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-halt: halt or reboot
5-usage: halt [-pr]
6
7-halt, poweroff, or reboot the machine
8-*/
9
10 #include <sys/syscall.h>
11
12@@ -21,6 +16,8 @@ usage(void)
13 eprintf("usage: %s [-pr]\n", argv0);
14 }
15
16+// ?man halt: halt or reboot
17+// ?man halt, poweroff, or reboot the machine
18 int
19 main(int argc, char *argv[])
20 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-hostname: show or set hostname
5-usage: hostname [name]
6
7-display or configure the system hostname
8-*/
9
10 #include <stdio.h>
11 #include <string.h>
12@@ -18,6 +13,9 @@ usage(void)
13 eprintf("usage: %s [name]\n", argv0);
14 }
15
16+// ?man hostname: show or set hostname
17+// ?man arguments: name
18+// ?man display or configure the system hostname
19 int
20 main(int argc, char *argv[])
21 {
+5,
-7
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-killall5: send signal to all processes
5-usage: killall5 [-o pid1
6
7-send a signal to all processes except kernel threads
8-*/
9
10 #include <dirent.h>
11 #include <limits.h>
12@@ -42,6 +37,9 @@ usage(void)
13 eprintf("usage: %s [-o pid1,pid2,..,pidN] [-s signal]\n", argv0);
14 }
15
16+// ?man killall5: send signal to all processes
17+// ?man arguments: -o pid1
18+// ?man send a signal to all processes except kernel threads
19 int
20 main(int argc, char *argv[])
21 {
22@@ -56,7 +54,7 @@ main(int argc, char *argv[])
23 size_t i;
24
25 ARGBEGIN {
26- // ?man -s: silent mode or print summary
27+ // ?man -s:str: silent mode or print summary
28 case 's':
29 v = EARGF(usage());
30 sig = strtol(v, &end, 0);
31@@ -71,7 +69,7 @@ main(int argc, char *argv[])
32 if (i == LEN(sigs))
33 eprintf("%s: unknown signal\n", v);
34 break;
35- // ?man -o: specify output file
36+ // ?man -o:str: specify output file
37 case 'o':
38 oflag = 1;
39 arg = EARGF(usage());
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-last: show last logged in users
5-usage: last [user]
6
7-display a list of recent user logins
8-*/
9
10 #include <errno.h>
11 #include <libgen.h>
12@@ -26,6 +21,9 @@ usage(void)
13 eprintf("usage: %s [user]\n", argv0);
14 }
15
16+// ?man last: show last logged in users
17+// ?man arguments: user
18+// ?man display a list of recent user logins
19 int
20 main(int argc, char **argv)
21 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-lastlog: report recent logins
5-usage: lastlog
6
7-display the most recent login times of users
8-*/
9
10 #include <errno.h>
11 #include <paths.h>
12@@ -51,6 +46,8 @@ lastlog(char *user)
13 user, ll.ll_line, ll.ll_host, ctime(&lltime));
14 }
15
16+// ?man lastlog: report recent logins
17+// ?man display the most recent login times of users
18 int
19 main(int argc, char **argv)
20 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-login: begin terminal session
5-usage: login [-p] username
6
7-authenticate and start a session on the system
8-*/
9
10 #include <sys/ioctl.h>
11 #include <sys/types.h>
12@@ -74,6 +69,9 @@ usage(void)
13 eprintf("usage: %s [-p] username\n", argv0);
14 }
15
16+// ?man login: begin terminal session
17+// ?man arguments: username
18+// ?man authenticate and start a session on the system
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-md5sum: compute md5 checksums
5-usage: md5sum [-c] [file ...]
6
7-compute and check md5 message digests
8-*/
9
10 #include <stdio.h>
11 #include <stdlib.h>
12@@ -28,6 +23,9 @@ usage(void)
13 eprintf("usage: %s [-c] [file ...]\n", argv0);
14 }
15
16+// ?man md5sum: compute md5 checksums
17+// ?man arguments: file ...
18+// ?man compute and check md5 message digests
19 int
20 main(int argc, char *argv[])
21 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-mktemp: create temporary file
5-usage: mktemp [-dqtu] [-p directory] [template]
6
7-create a temporary file or directory safely
8-*/
9
10 #include <libgen.h>
11 #include <stdio.h>
12@@ -20,6 +15,9 @@ usage(void)
13 eprintf("usage: %s [-dqtu] [-p directory] [template]\n", argv0);
14 }
15
16+// ?man mktemp: create temporary file
17+// ?man arguments: template
18+// ?man create a temporary file or directory safely
19 int
20 main(int argc, char *argv[])
21 {
22@@ -33,7 +31,7 @@ main(int argc, char *argv[])
23 case 'd':
24 dflag = 1;
25 break;
26- // ?man -p: preserve file attributes
27+ // ?man -p:dir: preserve file attributes
28 case 'p':
29 pflag = 1;
30 pdir = EARGF(usage());
+2,
-5
1@@ -1,15 +1,12 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-nologin: politely refuse login
5-usage: nologin
6
7-politely refuse a login attempt by exiting with status 1
8-*/
9
10 #include <fcntl.h>
11 #include <stdio.h>
12 #include <unistd.h>
13
14+// ?man nologin: politely refuse login
15+// ?man politely refuse a login attempt by exiting with status 1
16 int
17 main(void)
18 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-pagesize: print system page size
5-usage: pagesize
6
7-display the size of a page in memory
8-*/
9
10 #include <stdio.h>
11 #include <stdlib.h>
12@@ -18,6 +13,8 @@ usage(void)
13 eprintf("usage: %s\n", argv0);
14 }
15
16+// ?man pagesize: print system page size
17+// ?man display the size of a page in memory
18 int
19 main(int argc, char *argv[])
20 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-pidof: find process ids
5-usage: pidof [-o pid1
6
7-find the process identity numbers of running programs
8-*/
9
10 #include <sys/types.h>
11
12@@ -33,6 +28,9 @@ usage(void)
13 eprintf("usage: %s [-o pid1,pid2,...pidN] [-s] [program...]\n", argv0);
14 }
15
16+// ?man pidof: find process ids
17+// ?man arguments: -o pid1
18+// ?man find the process identity numbers of running programs
19 int
20 main(int argc, char *argv[])
21 {
22@@ -50,7 +48,7 @@ main(int argc, char *argv[])
23 case 's':
24 sflag = 1;
25 break;
26- // ?man -o: specify output file
27+ // ?man -o:str: specify output file
28 case 'o':
29 oflag = 1;
30 arg = EARGF(usage());
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-printenv: print environment variables
5-usage: printenv [var ...]
6
7-display all or part of the current environment
8-*/
9
10 #include <stdio.h>
11 #include <stdlib.h>
12@@ -19,6 +14,9 @@ usage(void)
13 eprintf("usage: %s [var ...]\n", argv0);
14 }
15
16+// ?man printenv: print environment variables
17+// ?man arguments: var ...
18+// ?man display all or part of the current environment
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-pwdx: print working directory of process
5-usage: pwdx pid...
6
7-display the current working directory of a process by pid
8-*/
9
10 #include <errno.h>
11 #include <limits.h>
12@@ -20,6 +15,9 @@ usage(void)
13 eprintf("usage: %s pid...\n", argv0);
14 }
15
16+// ?man pwdx: print working directory of process
17+// ?man arguments: pid...
18+// ?man display the current working directory of a process by pid
19 int
20 main(int argc, char *argv[])
21 {
+5,
-7
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-respawn: restart command on exit
5-usage: respawn [-l fifo] [-d N] cmd [args...]
6
7-run a command and restart it automatically when it exits
8-*/
9
10 #include <sys/stat.h>
11 #include <sys/time.h>
12@@ -36,6 +31,9 @@ usage(void)
13 eprintf("usage: %s [-l fifo] [-d N] cmd [args...]\n", argv0);
14 }
15
16+// ?man respawn: restart command on exit
17+// ?man arguments: cmd [args...
18+// ?man run a command and restart it automatically when it exits
19 int
20 main(int argc, char *argv[])
21 {
22@@ -49,11 +47,11 @@ main(int argc, char *argv[])
23 int polln;
24
25 ARGBEGIN {
26- // ?man -d: specify directory
27+ // ?man -d:num: specify directory
28 case 'd':
29 delay = estrtol(EARGF(usage()), 0);
30 break;
31- // ?man -l: list in long format
32+ // ?man -l:str: list in long format
33 case 'l':
34 fifo = EARGF(usage());
35 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-rev: reverse lines
5-usage: rev [file ...]
6
7-reverse the order of characters in each line of input
8-*/
9
10 #include <stdio.h>
11 #include <string.h>
12@@ -46,6 +41,9 @@ rev(FILE *fp)
13 }
14 }
15
16+// ?man rev: reverse lines
17+// ?man arguments: file ...
18+// ?man reverse the order of characters in each line of input
19 int
20 main(int argc, char *argv[])
21 {
+4,
-7
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-seq: print sequence of numbers
5-usage: seq [-f fmt] [-s sep] [-w]
6
7-print a sequence of numbers from start to end
8-*/
9
10 #include <stdio.h>
11 #include <stdlib.h>
12@@ -84,6 +79,8 @@ usage(void)
13 "[startnum [step]] endnum\n", argv0);
14 }
15
16+// ?man seq: print sequence of numbers
17+// ?man print a sequence of numbers from start to end
18 int
19 main(int argc, char *argv[])
20 {
21@@ -93,13 +90,13 @@ main(int argc, char *argv[])
22 const char *starts = "1", *steps = "1", *ends = "1", *sep = "\n";
23
24 ARGBEGIN {
25- // ?man -f: force the operation
26+ // ?man -f:str: force the operation
27 case 'f':
28 if (!validfmt(tmp=EARGF(usage())))
29 eprintf("%s: invalid format\n", tmp);
30 fmt = tmp;
31 break;
32- // ?man -s: silent mode or print summary
33+ // ?man -s:str: silent mode or print summary
34 case 's':
35 sep = EARGF(usage());
36 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-setsid: run in new session
5-usage: setsid [-f] cmd [arg ...]
6
7-run a program in a new session
8-*/
9
10 #include <errno.h>
11 #include <unistd.h>
12@@ -19,6 +14,9 @@ usage(void)
13 eprintf("usage: %s [-f] cmd [arg ...]\n", argv0);
14 }
15
16+// ?man setsid: run in new session
17+// ?man arguments: cmd [arg ...
18+// ?man run a program in a new session
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-sha1sum: compute sha1 checksums
5-usage: sha1sum [-c] [file ...]
6
7-compute and check sha1 message digests
8-*/
9
10 #include <stdint.h>
11 #include <stdio.h>
12@@ -27,6 +22,9 @@ usage(void)
13 eprintf("usage: %s [-c] [file ...]\n", argv0);
14 }
15
16+// ?man sha1sum: compute sha1 checksums
17+// ?man arguments: file ...
18+// ?man compute and check sha1 message digests
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-sha224sum: compute sha224 checksums
5-usage: sha224sum [-c] [file ...]
6
7-compute and check sha224 message digests
8-*/
9
10 #include <stdint.h>
11 #include <stdio.h>
12@@ -27,6 +22,9 @@ usage(void)
13 eprintf("usage: %s [-c] [file ...]\n", argv0);
14 }
15
16+// ?man sha224sum: compute sha224 checksums
17+// ?man arguments: file ...
18+// ?man compute and check sha224 message digests
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-sha256sum: compute sha256 checksums
5-usage: sha256sum [-c] [file ...]
6
7-compute and check sha256 message digests
8-*/
9
10 #include <stdint.h>
11 #include <stdio.h>
12@@ -27,6 +22,9 @@ usage(void)
13 eprintf("usage: %s [-c] [file ...]\n", argv0);
14 }
15
16+// ?man sha256sum: compute sha256 checksums
17+// ?man arguments: file ...
18+// ?man compute and check sha256 message digests
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-sha384sum: compute sha384 checksums
5-usage: sha384sum [-c] [file ...]
6
7-compute and check sha384 message digests
8-*/
9
10 #include <stdint.h>
11 #include <stdio.h>
12@@ -27,6 +22,9 @@ usage(void)
13 eprintf("usage: %s [-c] [file ...]\n", argv0);
14 }
15
16+// ?man sha384sum: compute sha384 checksums
17+// ?man arguments: file ...
18+// ?man compute and check sha384 message digests
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-sha512-224sum: compute sha512/224 checksums
5-usage: sha512-224sum [-c] [file ...]
6
7-compute and check sha512/224 message digests
8-*/
9
10 #include <stdint.h>
11 #include <stdio.h>
12@@ -27,6 +22,9 @@ usage(void)
13 eprintf("usage: %s [-c] [file ...]\n", argv0);
14 }
15
16+// ?man sha512-224sum: compute sha512/224 checksums
17+// ?man arguments: file ...
18+// ?man compute and check sha512/224 message digests
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-sha512-256sum: compute sha512/256 checksums
5-usage: sha512-256sum [-c] [file ...]
6
7-compute and check sha512/256 message digests
8-*/
9
10 #include <stdint.h>
11 #include <stdio.h>
12@@ -27,6 +22,9 @@ usage(void)
13 eprintf("usage: %s [-c] [file ...]\n", argv0);
14 }
15
16+// ?man sha512-256sum: compute sha512/256 checksums
17+// ?man arguments: file ...
18+// ?man compute and check sha512/256 message digests
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-sha512sum: compute sha512 checksums
5-usage: sha512sum [-c] [file ...]
6
7-compute and check sha512 message digests
8-*/
9
10 #include <stdint.h>
11 #include <stdio.h>
12@@ -27,6 +22,9 @@ usage(void)
13 eprintf("usage: %s [-c] [file ...]\n", argv0);
14 }
15
16+// ?man sha512sum: compute sha512 checksums
17+// ?man arguments: file ...
18+// ?man compute and check sha512 message digests
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-sponge: soak up input
5-usage: sponge file
6
7-soak up standard input and write to a file
8-*/
9
10 #include <fcntl.h>
11 #include <stdlib.h>
12@@ -18,6 +13,9 @@ usage(void)
13 eprintf("usage: %s file\n", argv0);
14 }
15
16+// ?man sponge: soak up input
17+// ?man arguments: file
18+// ?man soak up standard input and write to a file
19 int
20 main(int argc, char *argv[])
21 {
+3,
-6
1@@ -1,9 +1,4 @@
2-/* ?man
3-stat: display file status
4-usage: stat [-L] [-t]
5
6-display file or filesystem status information
7-*/
8
9 #include "config.h"
10 #include "util.h"
11@@ -461,6 +456,8 @@ usage(void)
12 " [file...]\n", argv0);
13 }
14
15+// ?man stat: display file status
16+// ?man display file or filesystem status information
17 int
18 main(int argc, char *argv[])
19 {
20@@ -494,7 +491,7 @@ main(int argc, char *argv[])
21 break;
22 #endif
23 #if FEATURE_STAT_FORMAT
24- // ?man -c: print count or perform stdout action
25+ // ?man -c:str: print count or perform stdout action
26 case 'c':
27 format = EARGF(usage());
28 break;
+10,
-11
1@@ -1,10 +1,4 @@
2-/* ?man
3-tar: tape archiver
4-usage: tar [x | t | -x | -t] [-C dir] [-J | -Z | -a | -j | -z] [-m] [-p] [-O] [-k] [-T file] [-X file] [--strip-components num] [-f file] [file ...]
5- tar [c | -c] [-C dir] [-J | -Z | -a | -j | -z] [-h] [-T file] [-X file] path ... [-f file]
6
7-manipulate tape archive files
8-*/
9
10 #include "config.h"
11 #include "fs.h"
12@@ -806,6 +800,10 @@ usage(void)
13 #endif
14 }
15
16+// ?man tar: tape archiver
17+// ?man arguments: x | t | -x | -t] [file ...
18+// ?man tar [c | -c] [-C dir] [-J | -Z | -a | -j | -z] [-h] [-T file] [-X file] path ... [-f file]
19+// ?man manipulate tape archive files
20 int
21 main(int argc, char *argv[])
22 {
23@@ -836,11 +834,11 @@ main(int argc, char *argv[])
24 case 't':
25 mode = ARGC();
26 break;
27- // ?man -C: specify option flag
28+ // ?man -C:dir: specify option flag
29 case 'C':
30 dir = EARGF(usage());
31 break;
32- // ?man -f: specify archive file
33+ // ?man -f:file: specify archive file
34 case 'f':
35 file = EARGF(usage());
36 break;
37@@ -887,19 +885,19 @@ main(int argc, char *argv[])
38 break;
39 #endif
40 #if FEATURE_TAR_FILES_FROM
41- // ?man -T file: read filenames from file
42+ // ?man -T:file: -T file: read filenames from file
43 case 'T':
44 load_files_from_file(EARGF(usage()));
45 break;
46 #endif
47 #if FEATURE_TAR_EXCLUDE_FROM
48- // ?man -X file: exclude patterns in file
49+ // ?man -X:file: -X file: exclude patterns in file
50 case 'X':
51 load_excludes_from_file(EARGF(usage()));
52 break;
53 #endif
54 #if FEATURE_TAR_STRIP_COMPONENTS
55- // ?man -strip-components num: strip num components
56+ // ?man -s:num: -strip-components num: strip num components
57 case 's':
58 if (strcmp(argv[0], "strip-components") == 0) {
59 argv[0] = "s";
60@@ -913,6 +911,7 @@ main(int argc, char *argv[])
61 }
62 break;
63 #endif
64+ // ?man --:num: specify - option
65 case '-':
66 #if FEATURE_TAR_EXCLUDE
67 if (strncmp(argv[0], "-exclude=", 9) == 0) {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-truncate: set file size
5-usage: truncate [-c] -s size file...
6
7-shrink or extend a file to a specified size
8-*/
9
10 #include <sys/stat.h>
11
12@@ -21,6 +16,9 @@ usage(void)
13 eprintf("usage: %s [-c] -s size file...\n", argv0);
14 }
15
16+// ?man truncate: set file size
17+// ?man arguments: -s size file...
18+// ?man shrink or extend a file to a specified size
19 int
20 main(int argc, char *argv[])
21 {
22@@ -29,7 +27,7 @@ main(int argc, char *argv[])
23 long size = 0;
24
25 ARGBEGIN {
26- // ?man -s: silent mode or print summary
27+ // ?man -s:num: silent mode or print summary
28 case 's':
29 sflag = 1;
30 size = estrtol(EARGF(usage()), 10);
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-uptime: show system uptime
5-usage: uptime
6
7-display how long the system has been running and load averages
8-*/
9
10 #include <stdio.h>
11 #include <stdlib.h>
12@@ -24,6 +19,8 @@ usage(void)
13 eprintf("usage: %s\n", argv0);
14 }
15
16+// ?man uptime: show system uptime
17+// ?man display how long the system has been running and load averages
18 int
19 main(int argc, char *argv[])
20 {
+4,
-6
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-watch: execute periodically
5-usage: watch [-t] [-n interval] command
6
7-run a program periodically, showing output fullscreen
8-*/
9
10 #include <errno.h>
11 #include <stdio.h>
12@@ -19,6 +14,9 @@ usage(void)
13 eprintf("usage: %s [-t] [-n interval] command\n", argv0);
14 }
15
16+// ?man watch: execute periodically
17+// ?man arguments: command
18+// ?man run a program periodically, showing output fullscreen
19 int
20 main(int argc, char *argv[])
21 {
22@@ -32,7 +30,7 @@ main(int argc, char *argv[])
23 // ?man -t: sort or specify timestamp
24 case 't':
25 break;
26- // ?man -n: print line numbers or counts
27+ // ?man -n:str: print line numbers or counts
28 case 'n':
29 period = strtof(EARGF(usage()), &end);
30 if (*end != '\0' || errno != 0)
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-which: locate a command
5-usage: which [-a] name ...
6
7-find the path of executable files in PATH
8-*/
9
10 #include <sys/stat.h>
11 #include <sys/types.h>
12@@ -75,6 +70,9 @@ usage(void)
13 eprintf("usage: %s [-a] name ...\n", argv0);
14 }
15
16+// ?man which: locate a command
17+// ?man arguments: name ...
18+// ?man find the path of executable files in PATH
19 int
20 main(int argc, char *argv[])
21 {
+2,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-whoami: print effective user name
5-usage: whoami
6
7-display the effective user name of the current process
8-*/
9
10 #include <errno.h>
11 #include <stdio.h>
12@@ -19,6 +14,8 @@ usage(void)
13 eprintf("usage: %s\n", argv0);
14 }
15
16+// ?man whoami: print effective user name
17+// ?man display the effective user name of the current process
18 int
19 main(int argc, char *argv[])
20 {
+7,
-9
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-xinstall: copy files and set attributes
5-usage: xinstall [-g group] [-o owner] [-m mode] (-d dir ... | [-D] (-t dest source ... | source ... dest))
6
7-copy files and set their permissions and ownership
8-*/
9
10 #include <grp.h>
11 #include <pwd.h>
12@@ -89,6 +84,9 @@ usage(void)
13 eprintf("usage: %s [-g group] [-o owner] [-m mode] (-d dir ... | [-D] (-t dest source ... | source ... dest))\n", argv0);
14 }
15
16+// ?man xinstall: copy files and set attributes
17+// ?man arguments: (-d dir ... | (-t dest source ... | source ... dest))
18+// ?man copy files and set their permissions and ownership
19 int
20 main(int argc, char *argv[])
21 {
22@@ -119,19 +117,19 @@ main(int argc, char *argv[])
23 case 's':
24 /* no-op for compatibility */
25 break;
26- // ?man -g: specify option flag
27+ // ?man -g:str: specify option flag
28 case 'g':
29 gflag = EARGF(usage());
30 break;
31- // ?man -o: specify output file
32+ // ?man -o:str: specify output file
33 case 'o':
34 oflag = EARGF(usage());
35 break;
36- // ?man -m: specify mode or limit
37+ // ?man -m:str: specify mode or limit
38 case 'm':
39 mflag = EARGF(usage());
40 break;
41- // ?man -t: sort or specify timestamp
42+ // ?man -t:str: sort or specify timestamp
43 case 't':
44 tflag = EARGF(usage());
45 break;
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-yes: output string repeatedly
5-usage: yes [string]
6
7-output a string repeatedly until terminated
8-*/
9
10 #include <stdio.h>
11
12@@ -16,6 +11,9 @@ usage(void)
13 eprintf("usage: %s [string]\n", argv0);
14 }
15
16+// ?man yes: output string repeatedly
17+// ?man arguments: string
18+// ?man output a string repeatedly until terminated
19 int
20 main(int argc, char *argv[])
21 {
+5,
-7
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-mknod: create special files
5-usage: mknod [-m mode] name b|c|u major minor
6
7-create block or character special files
8-*/
9
10 #include <sys/stat.h>
11 #include <sys/types.h>
12@@ -28,6 +23,9 @@ usage(void)
13 argv0, argv0);
14 }
15
16+// ?man mknod: create special files
17+// ?man arguments: name b|c|u major minor
18+// ?man create block or character special files
19 int
20 main(int argc, char *argv[])
21 {
22@@ -35,8 +33,8 @@ main(int argc, char *argv[])
23 dev_t dev;
24
25 ARGBEGIN {
26- // ?man -m: specify mode or limit
27- case 'm':
28+// ?man -m:mode: specify mode or limit
29+case 'm':
30 mode = parsemode(EARGF(usage()), mode, umask(0));
31 break;
32 default:
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-passwd: change user password
5-usage: passwd [username]
6
7-update a user authentication password
8-*/
9
10 #include <sys/ioctl.h>
11 #include <sys/stat.h>
12@@ -163,6 +158,9 @@ usage(void)
13 eprintf("usage: %s [username]\n", argv0);
14 }
15
16+// ?man passwd: change user password
17+// ?man arguments: username
18+// ?man update a user authentication password
19 int
20 main(int argc, char *argv[])
21 {
+3,
-5
1@@ -1,10 +1,5 @@
2 /* See LICENSE file for copyright and license details. */
3-/* ?man
4-su: run command with substitute user id
5-usage: su [-lp] [username]
6
7-run a shell or command with another user id
8-*/
9
10 #include <sys/types.h>
11
12@@ -30,6 +25,9 @@ usage(void)
13 eprintf("usage: %s [-lp] [username]\n", argv0);
14 }
15
16+// ?man su: run command with substitute user id
17+// ?man arguments: username
18+// ?man run a shell or command with another user id
19 int
20 main(int argc, char *argv[])
21 {