[BusyBox] Re: [BusyBox-cvs] cvs commit to busybox by kraai

Matt Kraai kraai at alumni.carnegiemellon.edu
Wed Jul 19 21:26:37 UTC 2000


On Wed, Jul 19, 2000 at 04:36:14PM -0400, Pavel Roskin wrote:
> Hello!
> 
> > > Log Message:
> > > Centralize handling of --help.
> > 
> > Very cool.
> 
> Time to do the same with --version?
> 
> Pavel

The attached patch handles --version.

Matt
-------------- next part --------------
Index: busybox.c
===================================================================
RCS file: /var/cvs/busybox/busybox.c,v
retrieving revision 1.89
diff -u -r1.89 busybox.c
--- busybox.c	2000/07/19 19:24:01	1.89
+++ busybox.c	2000/07/19 21:25:35
@@ -492,6 +492,12 @@
 		if (strcmp(applet_name, a->name) == 0) {
 			if (a->usage && argv[1] && strcmp(argv[1], "--help") == 0)
 				usage(a->usage);
+			if (argv[1] && strcmp(argv[1], "--version") == 0) {
+				printf("BusyBox %s v" BB_VER
+						" (" BB_BT ") multi-call binary -- GPL2\n",
+						applet_name);
+				exit(TRUE);
+			}
 			exit(((*(a->main)) (argc, argv)));
 		}
 		a++;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20000719/9efc9e43/attachment.pgp 


More information about the busybox mailing list