aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorPere Orga <gotrunks@gmail.com>2011-04-11 03:29:49 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-04-11 03:29:49 +0200
commit5bc8c005a8e15c43285bc595a8d404de67a482ac (patch)
tree98f2d35d1db26f4d8cba5f095ff63bf8e2e8d980 /util-linux
parent73ef15cf3894716c1393ed21dee6e6bb2cdbc90f (diff)
downloadbusybox-5bc8c005a8e15c43285bc595a8d404de67a482ac.tar.gz
move remaining help text from include/usage.src.h
Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/acpid.c24
-rw-r--r--util-linux/blkid.c5
-rw-r--r--util-linux/dmesg.c10
-rw-r--r--util-linux/fbset.c15
-rw-r--r--util-linux/fdformat.c7
-rw-r--r--util-linux/fdisk.c22
-rw-r--r--util-linux/findfs.c8
-rw-r--r--util-linux/flock.c11
-rw-r--r--util-linux/freeramdisk.c14
-rw-r--r--util-linux/fsck_minix.c13
-rw-r--r--util-linux/getopt.c48
-rw-r--r--util-linux/hexdump.c24
-rw-r--r--util-linux/ipcrm.c10
-rw-r--r--util-linux/ipcs.c16
-rw-r--r--util-linux/losetup.c18
-rw-r--r--util-linux/lspci.c9
-rw-r--r--util-linux/lsusb.c4
-rw-r--r--util-linux/mdev.c35
-rw-r--r--util-linux/mkfs_ext2.c39
-rw-r--r--util-linux/mkfs_minix.c11
-rw-r--r--util-linux/mkfs_reiser.c9
-rw-r--r--util-linux/mkfs_vfat.c17
-rw-r--r--util-linux/mkswap.c8
-rw-r--r--util-linux/more.c8
-rw-r--r--util-linux/mount.c60
-rw-r--r--util-linux/pivot_root.c7
-rw-r--r--util-linux/rdate.c8
-rw-r--r--util-linux/rdev.c9
-rw-r--r--util-linux/readprofile.c15
-rw-r--r--util-linux/rtcwake.c23
-rw-r--r--util-linux/script.c13
-rw-r--r--util-linux/scriptreplay.c6
-rw-r--r--util-linux/setarch.c15
-rw-r--r--util-linux/swaponoff.c17
-rw-r--r--util-linux/switch_root.c10
-rw-r--r--util-linux/umount.c22
36 files changed, 589 insertions, 1 deletions
diff --git a/util-linux/acpid.c b/util-linux/acpid.c
index ce4c98ebe..c9eed2a7f 100644
--- a/util-linux/acpid.c
+++ b/util-linux/acpid.c
@@ -6,6 +6,30 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define acpid_trivial_usage
+//usage: "[-d] [-c CONFDIR] [-l LOGFILE] [-a ACTIONFILE] [-M MAPFILE] [-e PROC_EVENT_FILE] [-p PIDFILE]"
+//usage:#define acpid_full_usage "\n\n"
+//usage: "Listen to ACPI events and spawn specific helpers on event arrival\n"
+//usage: "\nOptions:"
+//usage: "\n -c DIR Config directory [/etc/acpi]"
+//usage: "\n -d Don't daemonize, (implies -f)"
+//usage: "\n -e FILE /proc event file [/proc/acpi/event]"
+//usage: "\n -f Run in foreground"
+//usage: "\n -l FILE Log file [/var/log/acpid.log]"
+//usage: "\n -p FILE Pid file [/var/run/acpid.pid]"
+//usage: "\n -a FILE Action file [/etc/acpid.conf]"
+//usage: "\n -M FILE Map file [/etc/acpi.map]"
+//usage: IF_FEATURE_ACPID_COMPAT(
+//usage: "\n\nAccept and ignore compatibility options -g -m -s -S -v"
+//usage: )
+//usage:
+//usage:#define acpid_example_usage
+//usage: "Without -e option, acpid uses all /dev/input/event* files\n"
+//usage: "# acpid\n"
+//usage: "# acpid -l /var/log/my-acpi-log\n"
+//usage: "# acpid -e /proc/acpi/event\n"
+
#include "libbb.h"
#include <syslog.h>
#include <linux/input.h>
diff --git a/util-linux/blkid.c b/util-linux/blkid.c
index fe88fb31d..c30360c65 100644
--- a/util-linux/blkid.c
+++ b/util-linux/blkid.c
@@ -7,6 +7,11 @@
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+//usage:#define blkid_trivial_usage
+//usage: ""
+//usage:#define blkid_full_usage "\n\n"
+//usage: "Print UUIDs of all filesystems"
+
#include "libbb.h"
#include "volume_id.h"
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index 6e43a22f5..412bf024b 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -8,6 +8,16 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define dmesg_trivial_usage
+//usage: "[-c] [-n LEVEL] [-s SIZE]"
+//usage:#define dmesg_full_usage "\n\n"
+//usage: "Print or control the kernel ring buffer\n"
+//usage: "\nOptions:"
+//usage: "\n -c Clear ring buffer after printing"
+//usage: "\n -n LEVEL Set console logging level"
+//usage: "\n -s SIZE Buffer size"
+
#include <sys/klog.h>
#include "libbb.h"
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 77cc1fc12..75d41b882 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -12,6 +12,21 @@
* Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
*/
+//usage:#define fbset_trivial_usage
+//usage: "[OPTIONS] [MODE]"
+//usage:#define fbset_full_usage "\n\n"
+//usage: "Show and modify frame buffer settings"
+//usage:
+//usage:#define fbset_example_usage
+//usage: "$ fbset\n"
+//usage: "mode \"1024x768-76\"\n"
+//usage: " # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz\n"
+//usage: " geometry 1024 768 1024 768 16\n"
+//usage: " timings 12714 128 32 16 4 128 4\n"
+//usage: " accel false\n"
+//usage: " rgba 5/11,6/5,5/0,0/0\n"
+//usage: "endmode\n"
+
#include "libbb.h"
#define DEFAULTFBDEV FB_0
diff --git a/util-linux/fdformat.c b/util-linux/fdformat.c
index 57e9c26f8..bf7098e71 100644
--- a/util-linux/fdformat.c
+++ b/util-linux/fdformat.c
@@ -5,6 +5,13 @@
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+//usage:#define fdformat_trivial_usage
+//usage: "[-n] DEVICE"
+//usage:#define fdformat_full_usage "\n\n"
+//usage: "Format floppy disk\n"
+//usage: "\nOptions:"
+//usage: "\n -n Don't verify after format"
+
#include "libbb.h"
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index 0b93c22cc..da03e683e 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -7,6 +7,28 @@
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+/* Looks like someone forgot to add this to config system */
+//usage:#ifndef ENABLE_FEATURE_FDISK_BLKSIZE
+//usage:# define ENABLE_FEATURE_FDISK_BLKSIZE 0
+//usage:# define IF_FEATURE_FDISK_BLKSIZE(a)
+//usage:#endif
+//usage:
+//usage:#define fdisk_trivial_usage
+//usage: "[-ul" IF_FEATURE_FDISK_BLKSIZE("s") "] "
+//usage: "[-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK"
+//usage:#define fdisk_full_usage "\n\n"
+//usage: "Change partition table\n"
+//usage: "\nOptions:"
+//usage: "\n -u Start and End are in sectors (instead of cylinders)"
+//usage: "\n -l Show partition table for each DISK, then exit"
+//usage: IF_FEATURE_FDISK_BLKSIZE(
+//usage: "\n -s Show partition sizes in kb for each DISK, then exit"
+//usage: )
+//usage: "\n -b 2048 (for certain MO disks) use 2048-byte sectors"
+//usage: "\n -C CYLINDERS Set number of cylinders/heads/sectors"
+//usage: "\n -H HEADS"
+//usage: "\n -S SECTORS"
+
#ifndef _LARGEFILE64_SOURCE
/* For lseek64 */
# define _LARGEFILE64_SOURCE
diff --git a/util-linux/findfs.c b/util-linux/findfs.c
index e1ec41f1b..49e8979ac 100644
--- a/util-linux/findfs.c
+++ b/util-linux/findfs.c
@@ -8,6 +8,14 @@
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//usage:#define findfs_trivial_usage
+//usage: "LABEL=label or UUID=uuid"
+//usage:#define findfs_full_usage "\n\n"
+//usage: "Find a filesystem device based on a label or UUID"
+//usage:
+//usage:#define findfs_example_usage
+//usage: "$ findfs LABEL=MyDevice"
+
#include "libbb.h"
#include "volume_id.h"
diff --git a/util-linux/flock.c b/util-linux/flock.c
index 77fe1f809..8fecb54d4 100644
--- a/util-linux/flock.c
+++ b/util-linux/flock.c
@@ -3,6 +3,17 @@
*
* This is free software, licensed under the GNU General Public License v2.
*/
+
+//usage:#define flock_trivial_usage
+//usage: "[-sxun] FD|{FILE [-c] PROG ARGS}"
+//usage:#define flock_full_usage "\n\n"
+//usage: "[Un]lock file descriptor, or lock FILE, run PROG\n"
+//usage: "\nOptions:"
+//usage: "\n -s Shared lock"
+//usage: "\n -x Exclusive lock (default)"
+//usage: "\n -u Unlock FD"
+//usage: "\n -n Fail rather than wait"
+
#include <sys/file.h>
#include "libbb.h"
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c
index 7ad443086..a89ae1a39 100644
--- a/util-linux/freeramdisk.c
+++ b/util-linux/freeramdisk.c
@@ -8,6 +8,20 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define freeramdisk_trivial_usage
+//usage: "DEVICE"
+//usage:#define freeramdisk_full_usage "\n\n"
+//usage: "Free all memory used by the specified ramdisk"
+//usage:
+//usage:#define freeramdisk_example_usage
+//usage: "$ freeramdisk /dev/ram2\n"
+//usage:
+//usage:#define fdflush_trivial_usage
+//usage: "DEVICE"
+//usage:#define fdflush_full_usage "\n\n"
+//usage: "Force floppy disk drive to detect disk change"
+
#include <sys/mount.h>
#include "libbb.h"
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index e02e05fa4..b53c97248 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -87,6 +87,19 @@
* enforced (but it's not much fun on a character device :-).
*/
+//usage:#define fsck_minix_trivial_usage
+//usage: "[-larvsmf] BLOCKDEV"
+//usage:#define fsck_minix_full_usage "\n\n"
+//usage: "Check MINIX filesystem\n"
+//usage: "\nOptions:"
+//usage: "\n -l List all filenames"
+//usage: "\n -r Perform interactive repairs"
+//usage: "\n -a Perform automatic repairs"
+//usage: "\n -v Verbose"
+//usage: "\n -s Output superblock information"
+//usage: "\n -m Show \"mode not cleared\" warnings"
+//usage: "\n -f Force file system check"
+
#include <mntent.h>
#include "libbb.h"
#include "minix.h"
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index 7c498538f..10e1dc49b 100644
--- a/util-linux/getopt.c
+++ b/util-linux/getopt.c
@@ -31,6 +31,54 @@
*
*/
+//usage:#define getopt_trivial_usage
+//usage: "[OPTIONS]"
+//usage:#define getopt_full_usage "\n\n"
+//usage: "Options:"
+//usage: IF_LONG_OPTS(
+//usage: "\n -a,--alternative Allow long options starting with single -"
+//usage: "\n -l,--longoptions=longopts Long options to be recognized"
+//usage: "\n -n,--name=progname The name under which errors are reported"
+//usage: "\n -o,--options=optstring Short options to be recognized"
+//usage: "\n -q,--quiet Disable error reporting by getopt(3)"
+//usage: "\n -Q,--quiet-output No normal output"
+//usage: "\n -s,--shell=shell Set shell quoting conventions"
+//usage: "\n -T,--test Test for getopt(1) version"
+//usage: "\n -u,--unquoted Don't quote the output"
+//usage: )
+//usage: IF_NOT_LONG_OPTS(
+//usage: "\n -a Allow long options starting with single -"
+//usage: "\n -l longopts Long options to be recognized"
+//usage: "\n -n progname The name under which errors are reported"
+//usage: "\n -o optstring Short options to be recognized"
+//usage: "\n -q Disable error reporting by getopt(3)"
+//usage: "\n -Q No normal output"
+//usage: "\n -s shell Set shell quoting conventions"
+//usage: "\n -T Test for getopt(1) version"
+//usage: "\n -u Don't quote the output"
+//usage: )
+//usage:
+//usage:#define getopt_example_usage
+//usage: "$ cat getopt.test\n"
+//usage: "#!/bin/sh\n"
+//usage: "GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \\\n"
+//usage: " -n 'example.busybox' -- \"$@\"`\n"
+//usage: "if [ $? != 0 ]; then exit 1; fi\n"
+//usage: "eval set -- \"$GETOPT\"\n"
+//usage: "while true; do\n"
+//usage: " case $1 in\n"
+//usage: " -a|--a-long) echo \"Option a\"; shift;;\n"
+//usage: " -b|--b-long) echo \"Option b, argument '$2'\"; shift 2;;\n"
+//usage: " -c|--c-long)\n"
+//usage: " case \"$2\" in\n"
+//usage: " \"\") echo \"Option c, no argument\"; shift 2;;\n"
+//usage: " *) echo \"Option c, argument '$2'\"; shift 2;;\n"
+//usage: " esac;;\n"
+//usage: " --) shift; break;;\n"
+//usage: " *) echo \"Internal error!\"; exit 1;;\n"
+//usage: " esac\n"
+//usage: "done\n"
+
#include <getopt.h>
#include "libbb.h"
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c
index a38fe05e7..1f5d57d74 100644
--- a/util-linux/hexdump.c
+++ b/util-linux/hexdump.c
@@ -9,6 +9,30 @@
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//usage:#define hexdump_trivial_usage
+//usage: "[-bcCdefnosvx" IF_FEATURE_HEXDUMP_REVERSE("R") "] [FILE]..."
+//usage:#define hexdump_full_usage "\n\n"
+//usage: "Display FILEs (or stdin) in a user specified format\n"
+//usage: "\nOptions:"
+//usage: "\n -b One-byte octal display"
+//usage: "\n -c One-byte character display"
+//usage: "\n -C Canonical hex+ASCII, 16 bytes per line"
+//usage: "\n -d Two-byte decimal display"
+//usage: "\n -e FORMAT_STRING"
+//usage: "\n -f FORMAT_FILE"
+//usage: "\n -n LENGTH Interpret only LENGTH bytes of input"
+//usage: "\n -o Two-byte octal display"
+//usage: "\n -s OFFSET Skip OFFSET bytes"
+//usage: "\n -v Display all input data"
+//usage: "\n -x Two-byte hexadecimal display"
+//usage: IF_FEATURE_HEXDUMP_REVERSE(
+//usage: "\n -R Reverse of 'hexdump -Cv'")
+//usage:
+//usage:#define hd_trivial_usage
+//usage: "FILE..."
+//usage:#define hd_full_usage "\n\n"
+//usage: "hd is an alias for hexdump -C"
+
#include "libbb.h"
#include "dump.h"
diff --git a/util-linux/ipcrm.c b/util-linux/ipcrm.c
index e597ed637..bdd019f6f 100644
--- a/util-linux/ipcrm.c
+++ b/util-linux/ipcrm.c
@@ -8,6 +8,16 @@
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//usage:#define ipcrm_trivial_usage
+//usage: "[-MQS key] [-mqs id]"
+//usage:#define ipcrm_full_usage "\n\n"
+//usage: "Upper-case options MQS remove an object by shmkey value.\n"
+//usage: "Lower-case options remove an object by shmid value.\n"
+//usage: "\nOptions:"
+//usage: "\n -mM Remove memory segment after last detach"
+//usage: "\n -qQ Remove message queue"
+//usage: "\n -sS Remove semaphore"
+
#include "libbb.h"
/* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */
diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c
index 14df65280..33035c62e 100644
--- a/util-linux/ipcs.c
+++ b/util-linux/ipcs.c
@@ -8,6 +8,22 @@
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//usage:#define ipcs_trivial_usage
+//usage: "[[-smq] -i shmid] | [[-asmq] [-tcplu]]"
+//usage:#define ipcs_full_usage "\n\n"
+//usage: " -i Show specific resource"
+//usage: "\nResource specification:"
+//usage: "\n -m Shared memory segments"
+//usage: "\n -q Message queues"
+//usage: "\n -s Semaphore arrays"
+//usage: "\n -a All (default)"
+//usage: "\nOutput format:"
+//usage: "\n -t Time"
+//usage: "\n -c Creator"
+//usage: "\n -p Pid"
+//usage: "\n -l Limits"
+//usage: "\n -u Summary"
+
/* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */
/* X/OPEN tells us to use <sys/{types,ipc,msg}.h> for msgctl() */
/* X/OPEN tells us to use <sys/{types,ipc,shm}.h> for shmctl() */
diff --git a/util-linux/losetup.c b/util-linux/losetup.c
index 776f784f5..7e11e292d 100644
--- a/util-linux/losetup.c
+++ b/util-linux/losetup.c
@@ -7,6 +7,24 @@
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//usage:#define losetup_trivial_usage
+//usage: "[-o OFS] LOOPDEV FILE - associate loop devices\n"
+//usage: " losetup -d LOOPDEV - disassociate\n"
+//usage: " losetup [-f] - show"
+//usage:#define losetup_full_usage "\n\n"
+//usage: "Options:"
+//usage: "\n -o OFS Start OFS bytes into FILE"
+//usage: "\n -f Show first free loop device"
+//usage:
+//usage:#define losetup_notes_usage
+//usage: "No arguments will display all current associations.\n"
+//usage: "One argument (losetup /dev/loop1) will display the current association\n"
+//usage: "(if any), or disassociate it (with -d). The display shows the offset\n"
+//usage: "and filename of the file the loop device is currently bound to.\n\n"
+//usage: "Two arguments (losetup /dev/loop1 file.img) create a new association,\n"
+//usage: "with an optional offset (-o 12345). Encryption is not yet supported.\n"
+//usage: "losetup -f will show the first loop free loop device\n\n"
+
#include "libbb.h"
int losetup_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/util-linux/lspci.c b/util-linux/lspci.c
index 46e93b04d..f59aec8a5 100644
--- a/util-linux/lspci.c
+++ b/util-linux/lspci.c
@@ -6,6 +6,15 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+
+//usage:#define lspci_trivial_usage
+//usage: "[-mk]"
+//usage:#define lspci_full_usage "\n\n"
+//usage: "List all PCI devices"
+//usage: "\n"
+//usage: "\n -m Parseable output"
+//usage: "\n -k Show driver"
+
#include "libbb.h"
enum {
diff --git a/util-linux/lsusb.c b/util-linux/lsusb.c
index 6f9b54daa..540f21ec6 100644
--- a/util-linux/lsusb.c
+++ b/util-linux/lsusb.c
@@ -6,6 +6,10 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+
+//usage:#define lsusb_trivial_usage NOUSAGE_STR
+//usage:#define lsusb_full_usage ""
+
#include "libbb.h"
static int FAST_FUNC fileAction(
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index a970f91f2..2f225ac0b 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -7,6 +7,41 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define mdev_trivial_usage
+//usage: "[-s]"
+//usage:#define mdev_full_usage "\n\n"
+//usage: " -s Scan /sys and populate /dev during system boot\n"
+//usage: "\n"
+//usage: "It can be run by kernel as a hotplug helper. To activate it:\n"
+//usage: " echo /sbin/mdev > /proc/sys/kernel/hotplug\n"
+//usage: IF_FEATURE_MDEV_CONF(
+//usage: "It uses /etc/mdev.conf with lines\n"
+//usage: "[-]DEVNAME UID:GID PERM"
+//usage: IF_FEATURE_MDEV_RENAME(" [>|=PATH]")
+//usage: IF_FEATURE_MDEV_EXEC(" [@|$|*PROG]")
+//usage: )
+//usage:
+//usage:#define mdev_notes_usage ""
+//usage: IF_FEATURE_MDEV_CONFIG(
+//usage: "The mdev config file contains lines that look like:\n"
+//usage: " hd[a-z][0-9]* 0:3 660\n\n"
+//usage: "That's device name (with regex match), uid:gid, and permissions.\n\n"
+//usage: IF_FEATURE_MDEV_EXEC(
+//usage: "Optionally, that can be followed (on the same line) by a special character\n"
+//usage: "and a command line to run after creating/before deleting the corresponding\n"
+//usage: "device(s). The environment variable $MDEV indicates the active device node\n"
+//usage: "(which is useful if it's a regex match). For example:\n\n"
+//usage: " hdc root:cdrom 660 *ln -s $MDEV cdrom\n\n"
+//usage: "The special characters are @ (run after creating), $ (run before deleting),\n"
+//usage: "and * (run both after creating and before deleting). The commands run in\n"
+//usage: "the /dev directory, and use system() which calls /bin/sh.\n\n"
+//usage: )
+//usage: "Config file parsing stops on the first matching line. If no config\n"
+//usage: "entry is matched, devices are created with default 0:0 660. (Make\n"
+//usage: "the last line match .* to override this.)\n\n"
+//usage: )
+
#include "libbb.h"
#include "xregex.h"
diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c
index 871ec835e..f6ccc9c9e 100644
--- a/util-linux/mkfs_ext2.c
+++ b/util-linux/mkfs_ext2.c
@@ -7,6 +7,45 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define mkfs_ext2_trivial_usage
+//usage: "[-Fn] "
+/* //usage: "[-c|-l filename] " */
+//usage: "[-b BLK_SIZE] "
+/* //usage: "[-f fragment-size] [-g blocks-per-group] " */
+//usage: "[-i INODE_RATIO] [-I INODE_SIZE] "
+/* //usage: "[-j] [-J journal-options] [-N number-of-inodes] " */
+//usage: "[-m RESERVED_PERCENT] "
+/* //usage: "[-o creator-os] [-O feature[,...]] [-q] " */
+/* //usage: "[r fs-revision-level] [-E extended-options] [-v] [-F] " */
+//usage: "[-L LABEL] "
+/* //usage: "[-M last-mounted-directory] [-S] [-T filesystem-type] " */
+//usage: "BLOCKDEV [KBYTES]"
+//usage:#define mkfs_ext2_full_usage "\n\n"
+//usage: " -b BLK_SIZE Block size, bytes"
+/* //usage: "\n -c Check device for bad blocks" */
+/* //usage: "\n -E opts Set extended options" */
+/* //usage: "\n -f size Fragment size in bytes" */
+//usage: "\n -F Force"
+/* //usage: "\n -g N Number of blocks in a block group" */
+//usage: "\n -i RATIO Max number of files is filesystem_size / RATIO"
+//usage: "\n -I BYTES Inode size (min 128)"
+/* //usage: "\n -j Create a journal (ext3)" */
+/* //usage: "\n -J opts Set journal options (size/device)" */
+/* //usage: "\n -l file Read bad blocks list from file" */
+//usage: "\n -L LBL Volume label"
+//usage: "\n -m PERCENT Percent of blocks to reserve for admin"
+/* //usage: "\n -M dir Set last mounted directory" */
+//usage: "\n -n Dry run"
+/* //usage: "\n -N N Number of inodes to create" */
+/* //usage: "\n -o os Set the 'creator os' field" */
+/* //usage: "\n -O features Dir_index/filetype/has_journal/journal_dev/sparse_super" */
+/* //usage: "\n -q Quiet" */
+/* //usage: "\n -r rev Set filesystem revision" */
+/* //usage: "\n -S Write superblock and group descriptors only" */
+/* //usage: "\n -T fs-type Set usage type (news/largefile/largefile4)" */
+/* //usage: "\n -v Verbose" */
+
#include "libbb.h"
#include <linux/fs.h>
#include <linux/ext2_fs.h>
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index 95499ba17..a8bc4b80d 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -63,6 +63,17 @@
* removed getopt based parser and added a hand rolled one.
*/
+//usage:#define mkfs_minix_trivial_usage
+//usage: "[-c | -l FILE] [-nXX] [-iXX] BLOCKDEV [KBYTES]"
+//usage:#define mkfs_minix_full_usage "\n\n"
+//usage: "Make a MINIX filesystem\n"
+//usage: "\nOptions:"
+//usage: "\n -c Check device for bad blocks"
+//usage: "\n -n [14|30] Maximum length of filenames"
+//usage: "\n -i INODES Number of inodes for the filesystem"
+//usage: "\n -l FILE Read bad blocks list from FILE"
+//usage: "\n -v Make version 2 filesystem"
+
#include "libbb.h"
#include <mntent.h>
diff --git a/util-linux/mkfs_reiser.c b/util-linux/mkfs_reiser.c
index 00ce8f1d1..463ae1e2a 100644
--- a/util-linux/mkfs_reiser.c
+++ b/util-linux/mkfs_reiser.c
@@ -6,6 +6,15 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define mkfs_reiser_trivial_usage
+//usage: "[-f] [-l LABEL] BLOCKDEV [4K-BLOCKS]"
+//usage:#define mkfs_reiser_full_usage "\n\n"
+//usage: "Make a ReiserFS V3 filesystem\n"
+//usage: "\nOptions:"
+//usage: "\n -f Force"
+//usage: "\n -l LBL Volume label"
+
#include "libbb.h"
#include <linux/fs.h>
diff --git a/util-linux/mkfs_vfat.c b/util-linux/mkfs_vfat.c
index bb5b59c66..e83ae7510 100644
--- a/util-linux/mkfs_vfat.c
+++ b/util-linux/mkfs_vfat.c
@@ -7,6 +7,23 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define mkfs_vfat_trivial_usage
+//usage: "[-v] [-n LABEL] BLOCKDEV [KBYTES]"
+/* Accepted but ignored:
+ "[-c] [-C] [-I] [-l bad-block-file] [-b backup-boot-sector] "
+ "[-m boot-msg-file] [-i volume-id] "
+ "[-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs] "
+ "[-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors] "
+*/
+//usage:#define mkfs_vfat_full_usage "\n\n"
+//usage: "Make a FAT32 filesystem\n"
+//usage: "\nOptions:"
+/* //usage: "\n -c Check device for bad blocks" */
+//usage: "\n -v Verbose"
+/* //usage: "\n -I Allow to use entire disk device (e.g. /dev/hda)" */
+//usage: "\n -n LBL Volume label"
+
#include "libbb.h"
#include <linux/hdreg.h> /* HDIO_GETGEO */
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c
index 2e9662b2b..ef6932c6c 100644
--- a/util-linux/mkswap.c
+++ b/util-linux/mkswap.c
@@ -5,6 +5,14 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define mkswap_trivial_usage
+//usage: "[-L LBL] BLOCKDEV [KBYTES]"
+//usage:#define mkswap_full_usage "\n\n"
+//usage: "Prepare BLOCKDEV to be used as swap partition\n"
+//usage: "\nOptions:"
+//usage: "\n -L LBL Label"
+
#include "libbb.h"
#if ENABLE_SELINUX
diff --git a/util-linux/more.c b/util-linux/more.c
index 7160b8b00..efceb71ec 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -14,6 +14,14 @@
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//usage:#define more_trivial_usage
+//usage: "[FILE]..."
+//usage:#define more_full_usage "\n\n"
+//usage: "View FILE (or stdin) one screenful at a time"
+//usage:
+//usage:#define more_example_usage
+//usage: "$ dmesg | more\n"
+
#include "libbb.h"
/* Support for FEATURE_USE_TERMIOS */
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 722d0be92..3e2ba1fab 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -16,6 +16,66 @@
// singlemount() can loop through /etc/filesystems for fstype detection.
// mount_it_now() does the actual mount.
//
+
+//usage:#define mount_trivial_usage
+//usage: "[OPTIONS] [-o OPTS] DEVICE NODE"
+//usage:#define mount_full_usage "\n\n"
+//usage: "Mount a filesystem. Filesystem autodetection requires /proc.\n"
+//usage: "\nOptions:"
+//usage: "\n -a Mount all filesystems in fstab"
+//usage: IF_FEATURE_MOUNT_FAKE(
+//usage: IF_FEATURE_MTAB_SUPPORT(
+//usage: "\n -f Update /etc/mtab, but don't mount"
+//usage: )
+//usage: IF_NOT_FEATURE_MTAB_SUPPORT(
+//usage: "\n -f Dry run"
+//usage: )
+//usage: )
+//usage: IF_FEATURE_MOUNT_HELPERS(
+//usage: "\n -i Don't run mount helper"
+//usage: )
+//usage: IF_FEATURE_MTAB_SUPPORT(
+//usage: "\n -n Don't update /etc/mtab"
+//usage: )
+//usage: "\n -r Read-only mount"
+//usage: "\n -w Read-write mount (default)"
+//usage: "\n -t FSTYPE Filesystem type"
+//usage: "\n -O OPT Mount only filesystems with option OPT (-a only)"
+//usage: "\n-o OPT:"
+//usage: IF_FEATURE_MOUNT_LOOP(
+//usage: "\n loop Ignored (loop devices are autodetected)"
+//usage: )
+//usage: IF_FEATURE_MOUNT_FLAGS(
+//usage: "\n [a]sync Writes are [a]synchronous"
+//usage: "\n [no]atime Disable/enable updates to inode access times"
+//usage: "\n [no]diratime Disable/enable atime updates to directories"
+//usage: "\n [no]relatime Disable/enable atime updates relative to modification time"
+//usage: "\n [no]dev (Dis)allow use of special device files"
+//usage: "\n [no]exec (Dis)allow use of executable files"
+//usage: "\n [no]suid (Dis)allow set-user-id-root programs"
+//usage: "\n [r]shared Convert [recursively] to a shared subtree"
+//usage: "\n [r]slave Convert [recursively] to a slave subtree"
+//usage: "\n [r]private Convert [recursively] to a private subtree"
+//usage: "\n [un]bindable Make mount point [un]able to be bind mounted"
+//usage: "\n [r]bind Bind a file or directory [recursively] to another location"
+//usage: "\n move Relocate an existing mount point"
+//usage: )
+//usage: "\n remount Remount a mounted filesystem, changing flags"
+//usage: "\n ro/rw Same as -r/-w"
+//usage: "\n"
+//usage: "\nThere are filesystem-specific -o flags."
+//usage:
+//usage:#define mount_example_usage
+//usage: "$ mount\n"
+//usage: "/dev/hda3 on / type minix (rw)\n"
+//usage: "proc on /proc type proc (rw)\n"
+//usage: "devpts on /dev/pts type devpts (rw)\n"
+//usage: "$ mount /dev/fd0 /mnt -t msdos -o ro\n"
+//usage: "$ mount /tmp/diskimage /opt -t ext2 -o loop\n"
+//usage: "$ mount cd_image.iso mydir\n"
+//usage:#define mount_notes_usage
+//usage: "Returns 0 for success, number of failed mounts for -a, or errno for one mount."
+
#include <mntent.h>
#include <syslog.h>
#include <sys/mount.h>
diff --git a/util-linux/pivot_root.c b/util-linux/pivot_root.c
index ac52a7aed..83f01fabd 100644
--- a/util-linux/pivot_root.c
+++ b/util-linux/pivot_root.c
@@ -8,6 +8,13 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define pivot_root_trivial_usage
+//usage: "NEW_ROOT PUT_OLD"
+//usage:#define pivot_root_full_usage "\n\n"
+//usage: "Move the current root file system to PUT_OLD and make NEW_ROOT\n"
+//usage: "the new root file system"
+
#include "libbb.h"
extern int pivot_root(const char * new_root,const char * put_old);
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index 2c3de74bc..628df0da7 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -8,6 +8,14 @@
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//usage:#define rdate_trivial_usage
+//usage: "[-sp] HOST"
+//usage:#define rdate_full_usage "\n\n"
+//usage: "Get and possibly set the system date and time from a remote HOST\n"
+//usage: "\nOptions:"
+//usage: "\n -s Set the system date and time (default)"
+//usage: "\n -p Print the date and time"
+
#include "libbb.h"
enum { RFC_868_BIAS = 2208988800UL };
diff --git a/util-linux/rdev.c b/util-linux/rdev.c
index 2fbb4d377..1212f841e 100644
--- a/util-linux/rdev.c
+++ b/util-linux/rdev.c
@@ -9,6 +9,15 @@
*
*/
+//usage:#define rdev_trivial_usage
+//usage: ""
+//usage:#define rdev_full_usage "\n\n"
+//usage: "Print the device node associated with the filesystem mounted at '/'"
+//usage:
+//usage:#define rdev_example_usage
+//usage: "$ rdev\n"
+//usage: "/dev/mtdblock9 /\n"
+
#include "libbb.h"
int rdev_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c
index f8a6e0cd0..7b7aa7c9f 100644
--- a/util-linux/readprofile.c
+++ b/util-linux/readprofile.c
@@ -32,6 +32,21 @@
* Paul Mundt <lethal@linux-sh.org>.
*/
+//usage:#define readprofile_trivial_usage
+//usage: "[OPTIONS]"
+//usage:#define readprofile_full_usage "\n\n"
+//usage: "Options:"
+//usage: "\n -m mapfile (Default: /boot/System.map)"
+//usage: "\n -p profile (Default: /proc/profile)"
+//usage: "\n -M NUM Set the profiling multiplier to NUM"
+//usage: "\n -i Print only info about the sampling step"
+//usage: "\n -v Verbose"
+//usage: "\n -a Print all symbols, even if count is 0"
+//usage: "\n -b Print individual histogram-bin counts"
+//usage: "\n -s Print individual counters within functions"
+//usage: "\n -r Reset all the counters (root only)"
+//usage: "\n -n Disable byte order auto-detection"
+
#include "libbb.h"
#include <sys/utsname.h>
diff --git a/util-linux/rtcwake.c b/util-linux/rtcwake.c
index 06ed7eafc..735a29822 100644
--- a/util-linux/rtcwake.c
+++ b/util-linux/rtcwake.c
@@ -23,6 +23,29 @@
* That flag should not be needed on systems with adjtime support.
*/
+//usage:#define rtcwake_trivial_usage
+//usage: "[-a | -l | -u] [-d DEV] [-m MODE] [-s SEC | -t TIME]"
+//usage:#define rtcwake_full_usage "\n\n"
+//usage: "Enter a system sleep state until specified wakeup time\n"
+//usage: IF_LONG_OPTS(
+//usage: "\n -a,--auto Read clock mode from adjtime"
+//usage: "\n -l,--local Clock is set to local time"
+//usage: "\n -u,--utc Clock is set to UTC time"
+//usage: "\n -d,--device=DEV Specify the RTC device"
+//usage: "\n -m,--mode=MODE Set the sleep state (default: standby)"
+//usage: "\n -s,--seconds=SEC Set the timeout in SEC seconds from now"
+//usage: "\n -t,--time=TIME Set the timeout to TIME seconds from epoch"
+//usage: )
+//usage: IF_NOT_LONG_OPTS(
+//usage: "\n -a Read clock mode from adjtime"
+//usage: "\n -l Clock is set to local time"
+//usage: "\n -u Clock is set to UTC time"
+//usage: "\n -d DEV Specify the RTC device"
+//usage: "\n -m MODE Set the sleep state (default: standby)"
+//usage: "\n -s SEC Set the timeout in SEC seconds from now"
+//usage: "\n -t TIME Set the timeout to TIME seconds from epoch"
+//usage: )
+
#include "libbb.h"
#include "rtc_.h"
diff --git a/util-linux/script.c b/util-linux/script.c
index 47efc4526..26f16ebf5 100644
--- a/util-linux/script.c
+++ b/util-linux/script.c
@@ -10,6 +10,19 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+
+//usage:#define script_trivial_usage
+//usage: "[-afq" IF_SCRIPTREPLAY("t") "] [-c PROG] [OUTFILE]"
+//usage:#define script_full_usage "\n\n"
+//usage: "Options:"
+//usage: "\n -a Append output"
+//usage: "\n -c PROG Run PROG, not shell"
+//usage: "\n -f Flush output after each write"
+//usage: "\n -q Quiet"
+//usage: IF_SCRIPTREPLAY(
+//usage: "\n -t Send timing to stderr"
+//usage: )
+
#include "libbb.h"
int script_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/util-linux/scriptreplay.c b/util-linux/scriptreplay.c
index 6eaba43fa..382f56d9a 100644
--- a/util-linux/scriptreplay.c
+++ b/util-linux/scriptreplay.c
@@ -7,6 +7,12 @@
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
*/
+
+//usage:#define scriptreplay_trivial_usage
+//usage: "timingfile [typescript [divisor]]"
+//usage:#define scriptreplay_full_usage "\n\n"
+//usage: "Play back typescripts, using timing information"
+
#include "libbb.h"
int scriptreplay_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/util-linux/setarch.c b/util-linux/setarch.c
index 7d5dc247c..7b9421af1 100644
--- a/util-linux/setarch.c
+++ b/util-linux/setarch.c
@@ -5,7 +5,20 @@
* Copyright 2002 Andi Kleen, SuSE Labs.
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
-*/
+ */
+
+//usage:#define setarch_trivial_usage
+//usage: "personality PROG ARGS"
+//usage:#define setarch_full_usage "\n\n"
+//usage: "Personality may be:\n"
+//usage: " linux32 Set 32bit uname emulation\n"
+//usage: " linux64 Set 64bit uname emulation"
+//usage:
+//usage:#define linux32_trivial_usage NOUSAGE_STR
+//usage:#define linux32_full_usage ""
+//usage:
+//usage:#define linux64_trivial_usage NOUSAGE_STR
+//usage:#define linux64_full_usage ""
#include <sys/personality.h>
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index e2c060f30..b7cf69833 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -7,6 +7,23 @@
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+//usage:#define swapon_trivial_usage
+//usage: "[-a]" IF_FEATURE_SWAPON_PRI(" [-p PRI]") " [DEVICE]"
+//usage:#define swapon_full_usage "\n\n"
+//usage: "Start swapping on DEVICE\n"
+//usage: "\nOptions:"
+//usage: "\n -a Start swapping on all swap devices"
+//usage: IF_FEATURE_SWAPON_PRI(
+//usage: "\n -p PRI Set swap device priority"
+//usage: )
+//usage:
+//usage:#define swapoff_trivial_usage
+//usage: "[-a] [DEVICE]"
+//usage:#define swapoff_full_usage "\n\n"
+//usage: "Stop swapping on DEVICE\n"
+//usage: "\nOptions:"
+//usage: "\n -a Stop swapping on all swap devices"
+
#include "libbb.h"
#include <mntent.h>
#include <sys/swap.h>
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c
index d471437fd..7794de18d 100644
--- a/util-linux/switch_root.c
+++ b/util-linux/switch_root.c
@@ -5,6 +5,16 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define switch_root_trivial_usage
+//usage: "[-c /dev/console] NEW_ROOT NEW_INIT [ARGS]"
+//usage:#define switch_root_full_usage "\n\n"
+//usage: "Free initramfs and switch to another root fs:\n"
+//usage: "chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /,\n"
+//usage: "execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint.\n"
+//usage: "\nOptions:"
+//usage: "\n -c DEV Reopen stdio to DEV after switch"
+
#include <sys/vfs.h>
#include <sys/mount.h>
#include "libbb.h"
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 5597d9eba..1e576ca4e 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -7,6 +7,28 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define umount_trivial_usage
+//usage: "[OPTIONS] FILESYSTEM|DIRECTORY"
+//usage:#define umount_full_usage "\n\n"
+//usage: "Unmount file systems\n"
+//usage: "\nOptions:"
+//usage: IF_FEATURE_UMOUNT_ALL(
+//usage: "\n -a Unmount all file systems" IF_FEATURE_MTAB_SUPPORT(" in /etc/mtab")
+//usage: )
+//usage: IF_FEATURE_MTAB_SUPPORT(
+//usage: "\n -n Don't erase /etc/mtab entries"
+//usage: )
+//usage: "\n -r Try to remount devices as read-only if mount is busy"
+//usage: "\n -l Lazy umount (detach filesystem)"
+//usage: "\n -f Force umount (i.e., unreachable NFS server)"
+//usage: IF_FEATURE_MOUNT_LOOP(
+//usage: "\n -d Free loop device if it has been used"
+//usage: )
+//usage:
+//usage:#define umount_example_usage
+//usage: "$ umount /dev/hdc1\n"
+
#include <mntent.h>
#include <sys/mount.h>
#include "libbb.h"