Small todo items?

Bernhard Fischer rep.nop at aon.at
Tue Apr 25 21:49:18 UTC 2006


On Thu, Apr 13, 2006 at 10:57:36PM -0400, Rob Landley wrote:
>On Wednesday 12 April 2006 12:06 pm, Bernhard Fischer wrote:
>> On Wed, Apr 12, 2006 at 06:03:20PM +0200, Bernhard Fischer wrote:
>> >On Wed, Apr 12, 2006 at 04:20:42PM +0100, Rob Sullivan wrote:
>> >>Looking at the todo list, it seems most of the items there are pretty
>> >> hefty:
>>
>> ... and start a discussion about a global config option to toggle
>> support for getopt_long with one knob.
>
>I'm all for it. :)

Noted to add a note about this to the todo (resp. check if there isn't
already an entry..)

Another thing which is really easy to do is to

- shring usage.h and fix formatting while at it.
- use USE_ and SKIP_ in usage.h

The attached patch (not finished, i stopped at hdparm) is the result of
looking for the pattern
".*\ \ 
i.e. double-quote <any number of any char> double space
and replaces these with the proper tabs.

The outcome is about 168 bytes:

   text	   data	    bss	    dec	    hex	filename
 866873	   8332	1014168	1889373	 1cd45d	busybox.orig
 866705	   8332	1014168	1889205	 1cd3b5	busybox


I'm pretty aware that the potential shrinking is far greater with vda's
proposed bzip2()ing the whole usage, but this one is a nice thing todo
nevertheless.

Any reason why we shouldn't apply the attached patchlet?

-------------- next part --------------
Index: include/usage.h
===================================================================
--- include/usage.h	(revision 14941)
+++ include/usage.h	(working copy)
@@ -191,7 +191,7 @@
 	"-r--r--r--    1 root     root            0 Apr 12 18:25 /tmp/foo\n"
 
 #define chown_trivial_usage \
-	"[ -Rh ]...  OWNER[<.|:>[GROUP]] FILE..."
+	"[ -Rh ]... OWNER[<.|:>[GROUP]] FILE..."
 #define chown_full_usage \
 	"Change the owner and/or group of each FILE to OWNER and/or GROUP.\n" \
 	"\nOptions:\n" \
@@ -298,13 +298,13 @@
 #define crontab_trivial_usage \
 	"[-c dir] {file|-}|[-u|-l|-e|-d user]"
 #define crontab_full_usage \
-	"\tfile <opts>  replace crontab from file\n" \
-	"\t-    <opts>  replace crontab from stdin\n" \
-	"\t-u user      specify user\n" \
-	"\t-l [user]    list crontab for user\n" \
-	"\t-e [user]    edit crontab for user\n" \
-	"\t-d [user]    delete crontab for user\n" \
-	"\t-c dir       specify crontab directory"
+	"\tfile <opts>\treplace crontab from file\n" \
+	"\t-    <opts>\treplace crontab from stdin\n" \
+	"\t-u user\t\tspecify user\n" \
+	"\t-l [user]\tlist crontab for user\n" \
+	"\t-e [user]\tedit crontab for user\n" \
+	"\t-d [user]\tdelete crontab for user\n" \
+	"\t-c dir\tspecify crontab directory"
 
 
 #define cut_trivial_usage \
@@ -428,7 +428,7 @@
 	"\t-v\tPrint the protocol version numbers for devfsd\n" \
 	"\t\tand the kernel-side protocol version and exits." \
 	USAGE_DEVFSD_FG_NP( "\n\n\t-fg\tRun the daemon in the foreground.\n\n" \
-	"\t-np\tExit  after  parsing  the configuration file\n" \
+	"\t-np\tExit after parsing the configuration file\n" \
 	"\t\tand processing synthetic REGISTER events.\n" \
 	"\t\tDo not poll for events.")
 
@@ -512,7 +512,7 @@
 #define dos2unix_trivial_usage \
 	"[option] [FILE]"
 #define dos2unix_full_usage \
-	"Converts FILE from dos format to unix format.  When no option\n" \
+	"Converts FILE from dos format to unix format. When no option\n" \
 	"is given, the input is converted to the opposite output format.\n" \
 	"When no file is given, uses stdin for input and stdout for output.\n\n" \
 	"Options:\n" \
@@ -667,7 +667,7 @@
 #define ether_wake_full_usage \
 	"Send a magic packet to wake up sleeping machines.\n" \
 	"MAC must be a station address (00:11:22:33:44:55) or\n" \
-	"    a hostname with a known 'ethers' entry.\n\n" \
+	"a hostname with a known 'ethers' entry.\n\n" \
 	"Options:\n" \
 	"\t-b\t\tSend wake-up packet to the broadcast address\n" \
 	"\t-i iface\tUse interface ifname instead of the default \"eth0\"\n" \
@@ -703,7 +703,7 @@
 	"\t( EXPRESSION )              value of EXPRESSION\n\n" \
 	"Beware that many operators need to be escaped or quoted for shells.\n" \
 	"Comparisons are arithmetic if both ARGs are numbers, else\n" \
-	"lexicographical.  Pattern matches return the string matched between \n" \
+	"lexicographical. Pattern matches return the string matched between \n" \
 	"\\( and \\) or null; if \\( and \\) are not used, they return the number \n" \
 	"of characters matched or 0."
 
@@ -754,14 +754,14 @@
 #define fdisk_full_usage \
 	"Change partition table\n" \
 	"Options:\n" \
-	"\t-l  List partition table(s)\n" \
-	"\t-u  Give Start and End in sector (instead of cylinder) units\n" \
+	"\t-l List partition table(s)\n" \
+	"\t-u Give Start and End in sector (instead of cylinder) units\n" \
 	"\t-s PARTITION  Give partition size(s) in blocks\n" \
 	"\t-b 2048: (for certain MO disks) use 2048-byte sectors\n" \
 	"\t-C CYLINDERS  Set the number of cylinders\n" \
 	"\t-H HEADS  Set the number of heads\n" \
 	"\t-S SECTORS  Set the number of sectors\n" \
-	"\t-v  Give fdisk version"
+	"\t-v Give fdisk version"
 
 #ifdef CONFIG_FEATURE_FIND_TYPE
 #  define USAGE_FIND_TYPE(a) a
@@ -802,7 +802,7 @@
 #define find_trivial_usage \
 	"[PATH...] [EXPRESSION]"
 #define find_full_usage \
-	"Search for files in a directory hierarchy.  The default PATH is\n" \
+	"Search for files in a directory hierarchy. The default PATH is\n" \
 	"the current directory; default EXPRESSION is '-print'\n" \
 	"\nEXPRESSION may consist of:\n" \
 	"\t-follow\t\tDereference symbolic links\n" \
@@ -888,46 +888,47 @@
 #define ftpget_full_usage \
 	"Retrieve a remote file via FTP.\n\n" \
 	"Options:\n" \
-	"\t-c, --continue         Continue a previous transfer\n" \
-	"\t-v, --verbose          Verbose\n" \
-	"\t-u, --username         Username to be used\n" \
-	"\t-p, --password         Password to be used\n" \
-	"\t-P, --port             Port number to be used"
+	"\t-c, --continue\tContinue a previous transfer\n" \
+	"\t-v, --verbose\tVerbose\n" \
+	"\t-u, --username\tUsername to be used\n" \
+	"\t-p, --password\tPassword to be used\n" \
+	"\t-P, --port\tPort number to be used"
 
 #define ftpput_trivial_usage \
 	"[options] remote-host remote-file local-file"
 #define ftpput_full_usage \
 	"Store a local file on a remote machine via FTP.\n\n" \
 	"Options:\n" \
-	"\t-v, --verbose          Verbose\n" \
-	"\t-u, --username         Username to be used\n" \
-	"\t-p, --password         Password to be used\n" \
-	"\t-P, --port             Port number to be used"
+	"\t-v, --verbose\tVerbose\n" \
+	"\t-u, --username\tUsername to be used\n" \
+	"\t-p, --password\tPassword to be used\n" \
+	"\t-P, --port\tPort number to be used"
 
 #define fuser_trivial_usage \
 	"[options] file OR port/proto"
 #define fuser_full_usage \
 	"Options:\n" \
-	"\t-m         Show all processes on the same mounted fs\n" \
-	"\t-k         Kill all processes that match.\n" \
-	"\t-s         Don't print or kill anything.\n" \
-	"\t-4         When using port/proto only search IPv4 space\n" \
-	"\t-6         When using port/proto only search IPv6 space\n" \
-	"\t-SIGNAL    When used with -k, this signal will be used to kill"
+	"\t-m\tShow all processes on the same mounted fs\n" \
+	"\t-k\tKill all processes that match.\n" \
+	"\t-s\tDon't print or kill anything.\n" \
+	"\t-4\tWhen using port/proto only search IPv4 space\n" \
+	"\t-6\tWhen using port/proto only search IPv6 space\n" \
+	"\t-SIGNAL\tWhen used with -k, this signal will be used to kill"
 
 #define getopt_trivial_usage \
 	"[OPTIONS]..."
 #define getopt_full_usage \
 	"Parse command options\n" \
-	"\t-a, --alternative		Allow long options starting with single -\n" \
-	"\t-l, --longoptions=longopts	Long options to be recognized\n" \
-	"\t-n, --name=progname		The name under which errors are reported\n" \
-	"\t-o, --options=optstring	Short options to be recognized\n" \
-	"\t-q, --quiet			Disable error reporting by getopt(3)\n" \
-	"\t-Q, --quiet-output		No normal output\n" \
-	"\t-s, --shell=shell		Set shell quoting conventions\n" \
-	"\t-T, --test			Test for getopt(1) version\n" \
-	"\t-u, --unquoted		Do not quote the output"
+	"\t-a, --alternative\t\tAllow long options starting with \n" \
+	"\t\t\t\t\ta single -\n" \
+	"\t-l, --longoptions=longopts\tLong options to be recognized\n" \
+	"\t-n, --name=progname\t\tThe name under which errors are reported\n" \
+	"\t-o, --options=optstring\t\tShort options to be recognized\n" \
+	"\t-q, --quiet\t\t\tDisable error reporting by getopt(3)\n" \
+	"\t-Q, --quiet-output\t\tNo normal output\n" \
+	"\t-s, --shell=shell\t\tSet shell quoting conventions\n" \
+	"\t-T, --test\t\t\tTest for getopt(1) version\n" \
+	"\t-u, --unquoted\t\t\tDo not quote the output"
 #define getopt_example_usage \
 	"$ cat getopt.test\n" \
 	"#!/bin/sh\n" \
@@ -1027,7 +1028,7 @@
 	"[OPTION]... [FILE]..."
 #define gzip_full_usage \
 	"Compress FILE(s) with maximum compression.\n" \
-	"When FILE is '-' or unspecified, reads standard input.  Implies -c.\n\n" \
+	"When FILE is '-' or unspecified, reads standard input. Implies -c.\n\n" \
 	"Options:\n" \
 	"\t-c\tWrite output to standard output instead of FILE.gz\n" \
 	"\t-d\tDecompress\n" \
@@ -1087,7 +1088,7 @@
 #define hdparm_trivial_usage \
 	"[options] [device] .."
 #define hdparm_full_usage \
-	"Options:" \
+	"Options:\n" \
 	"\t-a   get/set fs readahead\n" \
 	"\t-A   set drive read-lookahead flag (0/1)\n" \
 	"\t-b   get/set bus state (0 == off, 1 == on, 2 == tristate)\n" \
@@ -3285,7 +3286,7 @@
 	"\t-C,\t--clientid-none\tSuppress default client identifier\n" \
 	"\t-V,\t--vendorclass=CLASSID\tSet vendor class identifier\n" \
 	"\t-H,\t--hostname=HOSTNAME\tClient hostname\n" \
-	"\t-h,\t                   \tAlias for -H\n" \
+	"\t-h,\t\t\t\tAlias for -H\n" \
 	"\t-f,\t--foreground\tDo not fork after getting lease\n" \
 	"\t-b,\t--background\tFork to background if lease cannot be immediately negotiated\n" \
 	"\t-i,\t--interface=INTERFACE\tInterface to use (default: eth0)\n" \


More information about the busybox mailing list