From 1f4447b2d439e6f11d95746bb5f611c353305859 Mon Sep 17 00:00:00 2001 From: Pere Orga Date: Sun, 27 Mar 2011 22:40:30 +0200 Subject: [PATCH] move help text from include/usage.src.h to archival/*.c Signed-off-by: Pere Orga Signed-off-by: Denys Vlasenko --- archival/ar.c | 11 +++ archival/bbunzip.c | 76 ++++++++++++++++ archival/bzip2.c | 10 +++ archival/dpkg.c | 28 ++++++ archival/dpkg_deb.c | 15 ++++ archival/gzip.c | 16 ++++ archival/lzop.c | 27 ++++++ archival/rpm.c | 13 +++ archival/rpm2cpio.c | 6 ++ archival/unzip.c | 13 +++ include/usage.src.h | 210 -------------------------------------------- 11 files changed, 215 insertions(+), 210 deletions(-) diff --git a/archival/ar.c b/archival/ar.c index a2e3306ac..f5a379fb8 100644 --- a/archival/ar.c +++ b/archival/ar.c @@ -17,6 +17,17 @@ * http://www.unix-systems.org/single_unix_specification_v2/xcu/ar.html */ +//usage:#define ar_trivial_usage +//usage: "[-o] [-v] [-p] [-t] [-x] ARCHIVE FILES" +//usage:#define ar_full_usage "\n\n" +//usage: "Extract or list FILES from an ar archive\n" +//usage: "\nOptions:" +//usage: "\n -o Preserve original dates" +//usage: "\n -p Extract to stdout" +//usage: "\n -t List" +//usage: "\n -x Extract" +//usage: "\n -v Verbose" + #include "libbb.h" #include "archive.h" #include "ar.h" diff --git a/archival/bbunzip.c b/archival/bbunzip.c index c4cc5d821..734c9b269 100644 --- a/archival/bbunzip.c +++ b/archival/bbunzip.c @@ -167,6 +167,15 @@ char* FAST_FUNC make_new_name_generic(char *filename, const char *expected_ext) * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ + +//usage:#define uncompress_trivial_usage +//usage: "[-cf] [FILE]..." +//usage:#define uncompress_full_usage "\n\n" +//usage: "Decompress .Z file[s]\n" +//usage: "\nOptions:" +//usage: "\n -c Write to stdout" +//usage: "\n -f Overwrite" + #if ENABLE_UNCOMPRESS static IF_DESKTOP(long long) int FAST_FUNC unpack_uncompress(unpack_info_t *info UNUSED_PARAM) @@ -218,6 +227,28 @@ int uncompress_main(int argc UNUSED_PARAM, char **argv) * See the license_msg below and the file COPYING for the software license. * See the file algorithm.doc for the compression algorithms and file formats. */ + +//usage:#define gunzip_trivial_usage +//usage: "[-cft] [FILE]..." +//usage:#define gunzip_full_usage "\n\n" +//usage: "Decompress FILEs (or stdin)\n" +//usage: "\nOptions:" +//usage: "\n -c Write to stdout" +//usage: "\n -f Force" +//usage: "\n -t Test file integrity" +//usage: +//usage:#define gunzip_example_usage +//usage: "$ ls -la /tmp/BusyBox*\n" +//usage: "-rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz\n" +//usage: "$ gunzip /tmp/BusyBox-0.43.tar.gz\n" +//usage: "$ ls -la /tmp/BusyBox*\n" +//usage: "-rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar\n" +//usage: +//usage:#define zcat_trivial_usage +//usage: "FILE" +//usage:#define zcat_full_usage "\n\n" +//usage: "Decompress to stdout" + #if ENABLE_GUNZIP static char* FAST_FUNC make_new_name_gunzip(char *filename, const char *expected_ext UNUSED_PARAM) @@ -344,6 +375,51 @@ int bunzip2_main(int argc UNUSED_PARAM, char **argv) * * Licensed under GPLv2, see file LICENSE in this source tree. */ + +//usage:#define unlzma_trivial_usage +//usage: "[-cf] [FILE]..." +//usage:#define unlzma_full_usage "\n\n" +//usage: "Decompress FILE (or stdin)\n" +//usage: "\nOptions:" +//usage: "\n -c Write to stdout" +//usage: "\n -f Force" +//usage: +//usage:#define lzma_trivial_usage +//usage: "-d [-cf] [FILE]..." +//usage:#define lzma_full_usage "\n\n" +//usage: "Decompress FILE (or stdin)\n" +//usage: "\nOptions:" +//usage: "\n -d Decompress" +//usage: "\n -c Write to stdout" +//usage: "\n -f Force" +//usage: +//usage:#define lzcat_trivial_usage +//usage: "FILE" +//usage:#define lzcat_full_usage "\n\n" +//usage: "Decompress to stdout" +//usage: +//usage:#define unxz_trivial_usage +//usage: "[-cf] [FILE]..." +//usage:#define unxz_full_usage "\n\n" +//usage: "Decompress FILE (or stdin)\n" +//usage: "\nOptions:" +//usage: "\n -c Write to stdout" +//usage: "\n -f Force" +//usage: +//usage:#define xz_trivial_usage +//usage: "-d [-cf] [FILE]..." +//usage:#define xz_full_usage "\n\n" +//usage: "Decompress FILE (or stdin)\n" +//usage: "\nOptions:" +//usage: "\n -d Decompress" +//usage: "\n -c Write to stdout" +//usage: "\n -f Force" +//usage: +//usage:#define xzcat_trivial_usage +//usage: "FILE" +//usage:#define xzcat_full_usage "\n\n" +//usage: "Decompress to stdout" + #if ENABLE_UNLZMA static IF_DESKTOP(long long) int FAST_FUNC unpack_unlzma(unpack_info_t *info UNUSED_PARAM) diff --git a/archival/bzip2.c b/archival/bzip2.c index ab08ffc1a..cfaf5fe20 100644 --- a/archival/bzip2.c +++ b/archival/bzip2.c @@ -7,6 +7,16 @@ * about bzip2 library code. */ +//usage:#define bzip2_trivial_usage +//usage: "[OPTIONS] [FILE]..." +//usage:#define bzip2_full_usage "\n\n" +//usage: "Compress FILEs (or stdin) with bzip2 algorithm\n" +//usage: "\nOptions:" +//usage: "\n -1..9 Compression level" +//usage: "\n -d Decompress" +//usage: "\n -c Write to stdout" +//usage: "\n -f Force" + #include "libbb.h" #include "archive.h" diff --git a/archival/dpkg.c b/archival/dpkg.c index c37ae3349..f8e349d09 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c @@ -28,6 +28,34 @@ * */ +//usage:#define dpkg_trivial_usage +//usage: "[-ilCPru] [-F OPT] PACKAGE" +//usage:#define dpkg_full_usage "\n\n" +//usage: "Install, remove and manage Debian packages\n" +//usage: "\nOptions:" +//usage: IF_LONG_OPTS( +//usage: "\n -i,--install Install the package" +//usage: "\n -l,--list List of installed packages" +//usage: "\n --configure Configure an unpackaged package" +//usage: "\n -P,--purge Purge all files of a package" +//usage: "\n -r,--remove Remove all but the configuration files for a package" +//usage: "\n --unpack Unpack a package, but don't configure it" +//usage: "\n --force-depends Ignore dependency problems" +//usage: "\n --force-confnew Overwrite existing config files when installing" +//usage: "\n --force-confold Keep old config files when installing" +//usage: ) +//usage: IF_NOT_LONG_OPTS( +//usage: "\n -i Install the package" +//usage: "\n -l List of installed packages" +//usage: "\n -C Configure an unpackaged package" +//usage: "\n -P Purge all files of a package" +//usage: "\n -r Remove all but the configuration files for a package" +//usage: "\n -u Unpack a package, but don't configure it" +//usage: "\n -F depends Ignore dependency problems" +//usage: "\n -F confnew Overwrite existing config files when installing" +//usage: "\n -F confold Keep old config files when installing" +//usage: ) + #include "libbb.h" #include #include "archive.h" diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c index aee7b4cf5..9e1e811ee 100644 --- a/archival/dpkg_deb.c +++ b/archival/dpkg_deb.c @@ -4,6 +4,21 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ + +//usage:#define dpkg_deb_trivial_usage +//usage: "[-cefxX] FILE [argument" +//usage:#define dpkg_deb_full_usage "\n\n" +//usage: "Perform actions on Debian packages (.debs)\n" +//usage: "\nOptions:" +//usage: "\n -c List contents of filesystem tree" +//usage: "\n -e Extract control files to [argument] directory" +//usage: "\n -f Display control field name starting with [argument]" +//usage: "\n -x Extract packages filesystem tree to directory" +//usage: "\n -X Verbose extract" +//usage: +//usage:#define dpkg_deb_example_usage +//usage: "$ dpkg-deb -X ./busybox_0.48-1_i386.deb /tmp\n" + #include "libbb.h" #include "archive.h" diff --git a/archival/gzip.c b/archival/gzip.c index 38c5ae7fd..7686e1adb 100644 --- a/archival/gzip.c +++ b/archival/gzip.c @@ -39,6 +39,22 @@ gzip: bogus: No such file or directory aa: 85.1% -- replaced with aa.gz */ +//usage:#define gzip_trivial_usage +//usage: "[-cfd] [FILE]..." +//usage:#define gzip_full_usage "\n\n" +//usage: "Compress FILEs (or stdin)\n" +//usage: "\nOptions:" +//usage: "\n -d Decompress" +//usage: "\n -c Write to stdout" +//usage: "\n -f Force" +//usage: +//usage:#define gzip_example_usage +//usage: "$ ls -la /tmp/busybox*\n" +//usage: "-rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/busybox.tar\n" +//usage: "$ gzip /tmp/busybox.tar\n" +//usage: "$ ls -la /tmp/busybox*\n" +//usage: "-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n" + #include "libbb.h" #include "archive.h" diff --git a/archival/lzop.c b/archival/lzop.c index 62455c313..f4419910f 100644 --- a/archival/lzop.c +++ b/archival/lzop.c @@ -25,6 +25,33 @@ "Minimalized" for busybox by Alain Knaff */ +//usage:#define lzop_trivial_usage +//usage: "[-cfvd123456789CF] [FILE]..." +//usage:#define lzop_full_usage "\n\n" +//usage: "Options:" +//usage: "\n -1..9 Compression level" +//usage: "\n -d Decompress" +//usage: "\n -c Write to stdout" +//usage: "\n -f Force" +//usage: "\n -v Verbose" +//usage: "\n -F Don't store or verify checksum" +//usage: "\n -C Also write checksum of compressed block" +//usage: +//usage:#define lzopcat_trivial_usage +//usage: "[-vCF] [FILE]..." +//usage:#define lzopcat_full_usage "\n\n" +//usage: " -v Verbose" +//usage: "\n -F Don't store or verify checksum" +//usage: +//usage:#define unlzop_trivial_usage +//usage: "[-cfvCF] [FILE]..." +//usage:#define unlzop_full_usage "\n\n" +//usage: "Options:" +//usage: "\n -c Write to stdout" +//usage: "\n -f Force" +//usage: "\n -v Verbose" +//usage: "\n -F Don't store or verify checksum" + #include "libbb.h" #include "archive.h" #include "liblzo_interface.h" diff --git a/archival/rpm.c b/archival/rpm.c index 380226f9b..98a45d9cc 100644 --- a/archival/rpm.c +++ b/archival/rpm.c @@ -7,6 +7,19 @@ * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//usage:#define rpm_trivial_usage +//usage: "-i PACKAGE.rpm; rpm -qp[ildc] PACKAGE.rpm" +//usage:#define rpm_full_usage "\n\n" +//usage: "Manipulate RPM packages\n" +//usage: "\nCommands:" +//usage: "\n -i Install package" +//usage: "\n -qp Query package" +//usage: "\nOptions:" +//usage: "\n -i Show information" +//usage: "\n -l List contents" +//usage: "\n -d List documents" +//usage: "\n -c List config files" + #include "libbb.h" #include "archive.h" #include "rpm.h" diff --git a/archival/rpm2cpio.c b/archival/rpm2cpio.c index ce8cd2c2c..ff4a0d1b0 100644 --- a/archival/rpm2cpio.c +++ b/archival/rpm2cpio.c @@ -6,6 +6,12 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ + +//usage:#define rpm2cpio_trivial_usage +//usage: "package.rpm" +//usage:#define rpm2cpio_full_usage "\n\n" +//usage: "Output a cpio archive of the rpm file" + #include "libbb.h" #include "archive.h" #include "rpm.h" diff --git a/archival/unzip.c b/archival/unzip.c index 5d62c08cb..52b0a6414 100644 --- a/archival/unzip.c +++ b/archival/unzip.c @@ -19,6 +19,19 @@ * Zip64 + other methods */ +//usage:#define unzip_trivial_usage +//usage: "[-opts[modifiers]] FILE[.zip] [LIST] [-x XLIST] [-d DIR]" +//usage:#define unzip_full_usage "\n\n" +//usage: "Extract files from ZIP archives\n" +//usage: "\nOptions:" +//usage: "\n -l List archive contents (with -q for short form)" +//usage: "\n -n Never overwrite files (default)" +//usage: "\n -o Overwrite" +//usage: "\n -p Send output to stdout" +//usage: "\n -q Quiet" +//usage: "\n -x XLST Exclude these files" +//usage: "\n -d DIR Extract files into DIR" + #include "libbb.h" #include "archive.h" diff --git a/include/usage.src.h b/include/usage.src.h index d07b408a6..69b8da272 100644 --- a/include/usage.src.h +++ b/include/usage.src.h @@ -74,17 +74,6 @@ INSERT "\n -t TICK Microseconds per tick, usually 10000" \ "\n -p TCONST" \ -#define ar_trivial_usage \ - "[-o] [-v] [-p] [-t] [-x] ARCHIVE FILES" -#define ar_full_usage "\n\n" \ - "Extract or list FILES from an ar archive\n" \ - "\nOptions:" \ - "\n -o Preserve original dates" \ - "\n -p Extract to stdout" \ - "\n -t List" \ - "\n -x Extract" \ - "\n -v Verbose" \ - #define arp_trivial_usage \ "\n[-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME]" \ "\n[-v] [-i IF] -d HOSTNAME [pub]" \ @@ -179,90 +168,9 @@ INSERT "\n stp BRIDGE [1/yes/on|0/no/off] STP on/off" \ ) \ -#define bzip2_trivial_usage \ - "[OPTIONS] [FILE]..." -#define bzip2_full_usage "\n\n" \ - "Compress FILEs (or stdin) with bzip2 algorithm\n" \ - "\nOptions:" \ - "\n -1..9 Compression level" \ - "\n -d Decompress" \ - "\n -c Write to stdout" \ - "\n -f Force" \ - #define busybox_notes_usage \ "Hello world!\n" -#define lzop_trivial_usage \ - "[-cfvd123456789CF] [FILE]..." -#define lzop_full_usage "\n\n" \ - "Options:" \ - "\n -1..9 Compression level" \ - "\n -d Decompress" \ - "\n -c Write to stdout" \ - "\n -f Force" \ - "\n -v Verbose" \ - "\n -F Don't store or verify checksum" \ - "\n -C Also write checksum of compressed block" \ - -#define lzopcat_trivial_usage \ - "[-vCF] [FILE]..." -#define lzopcat_full_usage "\n\n" \ - " -v Verbose" \ - "\n -F Don't store or verify checksum" \ - -#define unlzop_trivial_usage \ - "[-cfvCF] [FILE]..." -#define unlzop_full_usage "\n\n" \ - "Options:" \ - "\n -c Write to stdout" \ - "\n -f Force" \ - "\n -v Verbose" \ - "\n -F Don't store or verify checksum" \ - -#define unlzma_trivial_usage \ - "[-cf] [FILE]..." -#define unlzma_full_usage "\n\n" \ - "Decompress FILE (or stdin)\n" \ - "\nOptions:" \ - "\n -c Write to stdout" \ - "\n -f Force" \ - -#define lzma_trivial_usage \ - "-d [-cf] [FILE]..." -#define lzma_full_usage "\n\n" \ - "Decompress FILE (or stdin)\n" \ - "\nOptions:" \ - "\n -d Decompress" \ - "\n -c Write to stdout" \ - "\n -f Force" \ - -#define lzcat_trivial_usage \ - "FILE" -#define lzcat_full_usage "\n\n" \ - "Decompress to stdout" - -#define unxz_trivial_usage \ - "[-cf] [FILE]..." -#define unxz_full_usage "\n\n" \ - "Decompress FILE (or stdin)\n" \ - "\nOptions:" \ - "\n -c Write to stdout" \ - "\n -f Force" \ - -#define xz_trivial_usage \ - "-d [-cf] [FILE]..." -#define xz_full_usage "\n\n" \ - "Decompress FILE (or stdin)\n" \ - "\nOptions:" \ - "\n -d Decompress" \ - "\n -c Write to stdout" \ - "\n -f Force" \ - -#define xzcat_trivial_usage \ - "FILE" -#define xzcat_full_usage "\n\n" \ - "Decompress to stdout" - #define cal_trivial_usage \ "[-jy] [[MONTH] YEAR]" #define cal_full_usage "\n\n" \ @@ -861,48 +769,6 @@ INSERT "\n -u dos2unix" \ "\n -d unix2dos" \ -#define dpkg_trivial_usage \ - "[-ilCPru] [-F OPT] PACKAGE" -#define dpkg_full_usage "\n\n" \ - "Install, remove and manage Debian packages\n" \ - "\nOptions:" \ - IF_LONG_OPTS( \ - "\n -i,--install Install the package" \ - "\n -l,--list List of installed packages" \ - "\n --configure Configure an unpackaged package" \ - "\n -P,--purge Purge all files of a package" \ - "\n -r,--remove Remove all but the configuration files for a package" \ - "\n --unpack Unpack a package, but don't configure it" \ - "\n --force-depends Ignore dependency problems" \ - "\n --force-confnew Overwrite existing config files when installing" \ - "\n --force-confold Keep old config files when installing" \ - ) \ - IF_NOT_LONG_OPTS( \ - "\n -i Install the package" \ - "\n -l List of installed packages" \ - "\n -C Configure an unpackaged package" \ - "\n -P Purge all files of a package" \ - "\n -r Remove all but the configuration files for a package" \ - "\n -u Unpack a package, but don't configure it" \ - "\n -F depends Ignore dependency problems" \ - "\n -F confnew Overwrite existing config files when installing" \ - "\n -F confold Keep old config files when installing" \ - ) - -#define dpkg_deb_trivial_usage \ - "[-cefxX] FILE [argument]" -#define dpkg_deb_full_usage "\n\n" \ - "Perform actions on Debian packages (.debs)\n" \ - "\nOptions:" \ - "\n -c List contents of filesystem tree" \ - "\n -e Extract control files to [argument] directory" \ - "\n -f Display control field name starting with [argument]" \ - "\n -x Extract packages filesystem tree to directory" \ - "\n -X Verbose extract" \ - -#define dpkg_deb_example_usage \ - "$ dpkg-deb -X ./busybox_0.48-1_i386.deb /tmp\n" - #define du_trivial_usage \ "[-aHLdclsx" IF_FEATURE_HUMAN_READABLE("hm") "k] [FILE]..." #define du_full_usage "\n\n" \ @@ -1377,38 +1243,6 @@ INSERT #define getsebool_full_usage "\n\n" \ " -a Show all selinux booleans" -#define gunzip_trivial_usage \ - "[-cft] [FILE]..." -#define gunzip_full_usage "\n\n" \ - "Decompress FILEs (or stdin)\n" \ - "\nOptions:" \ - "\n -c Write to stdout" \ - "\n -f Force" \ - "\n -t Test file integrity" \ - -#define gunzip_example_usage \ - "$ ls -la /tmp/BusyBox*\n" \ - "-rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz\n" \ - "$ gunzip /tmp/BusyBox-0.43.tar.gz\n" \ - "$ ls -la /tmp/BusyBox*\n" \ - "-rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar\n" - -#define gzip_trivial_usage \ - "[-cfd] [FILE]..." -#define gzip_full_usage "\n\n" \ - "Compress FILEs (or stdin)\n" \ - "\nOptions:" \ - "\n -d Decompress" \ - "\n -c Write to stdout" \ - "\n -f Force" \ - -#define gzip_example_usage \ - "$ ls -la /tmp/busybox*\n" \ - "-rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/busybox.tar\n" \ - "$ gzip /tmp/busybox.tar\n" \ - "$ ls -la /tmp/busybox*\n" \ - "-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n" - #define hdparm_trivial_usage \ "[OPTIONS] [DEVICE]" #define hdparm_full_usage "\n\n" \ @@ -2945,24 +2779,6 @@ INSERT "\n -e Display other/more information" \ "\n -A inet" IF_FEATURE_IPV6("{6}") " Select address family" \ -#define rpm_trivial_usage \ - "-i PACKAGE.rpm; rpm -qp[ildc] PACKAGE.rpm" -#define rpm_full_usage "\n\n" \ - "Manipulate RPM packages\n" \ - "\nCommands:" \ - "\n -i Install package" \ - "\n -qp Query package" \ - "\nOptions:" \ - "\n -i Show information" \ - "\n -l List contents" \ - "\n -d List documents" \ - "\n -c List config files" \ - -#define rpm2cpio_trivial_usage \ - "package.rpm" -#define rpm2cpio_full_usage "\n\n" \ - "Output a cpio archive of the rpm file" - #define rtcwake_trivial_usage \ "[-a | -l | -u] [-d DEV] [-m MODE] [-s SEC | -t TIME]" #define rtcwake_full_usage "\n\n" \ @@ -3899,14 +3715,6 @@ INSERT "$ uname -a\n" \ "Linux debian 2.4.23 #2 Tue Dec 23 17:09:10 MST 2003 i686 GNU/Linux\n" -#define uncompress_trivial_usage \ - "[-cf] [FILE]..." -#define uncompress_full_usage "\n\n" \ - "Decompress .Z file[s]\n" \ - "\nOptions:" \ - "\n -c Write to stdout" \ - "\n -f Overwrite" \ - #define unexpand_trivial_usage \ "[-fa][-t N] [FILE]..." #define unexpand_full_usage "\n\n" \ @@ -3941,19 +3749,6 @@ INSERT "b\n" \ "c\n" -#define unzip_trivial_usage \ - "[-opts[modifiers]] FILE[.zip] [LIST] [-x XLIST] [-d DIR]" -#define unzip_full_usage "\n\n" \ - "Extract files from ZIP archives\n" \ - "\nOptions:" \ - "\n -l List archive contents (with -q for short form)" \ - "\n -n Never overwrite files (default)" \ - "\n -o Overwrite" \ - "\n -p Send output to stdout" \ - "\n -q Quiet" \ - "\n -x XLST Exclude these files" \ - "\n -d DIR Extract files into DIR" \ - #define uptime_trivial_usage \ "" #define uptime_full_usage "\n\n" \ @@ -4087,11 +3882,6 @@ INSERT #define whoami_full_usage "\n\n" \ "Print the user name associated with the current effective user id" -#define zcat_trivial_usage \ - "FILE" -#define zcat_full_usage "\n\n" \ - "Decompress to stdout" - #define zcip_trivial_usage \ "[OPTIONS] IFACE SCRIPT" #define zcip_full_usage "\n\n" \ -- 2.25.1