[BusyBox] Added -i (interactive flag) to rm applet

Mark Whitley markw at lineo.com
Tue Mar 13 00:43:19 UTC 2001


On Mon, Mar 12, 2001 at 05:31:25PM +0100, Christophe Boyanique wrote:
> 
> Hello,
> 
> here is a patch (diffed from cvs current version) to add -i flag to the rm
> applet:

Applied, compiled, tested, and worked. This is a fairly innocuous change so I
will commit it to CVS; this feature will be in the 0.50 release.

> - adds new feature BB_FEATURE_RM_INTERACTIVE in Config.h*
> - adds askConfirmation() function in utility.c and busybox.h

I changed this to ask_confirmation() per the style guide.

> - adds proper define in usage.h
> - prevents removing in fileAction and dirAction (in rm.c) if required (-i
> and user doesn't answer y|Y)
> 
> Size increasing of BusyBox: (Debian 2.2, i386)
> 
> - with trivial help:    320 bytes
> - without trivial help: 384 bytes

Good. This feature will be off by default, so anyone that doesn't use it won't
see any size increase.

> I'll try later to add the same flag to cp_mv but that should be (way) more
> complicated.

Since you bring it up, Christophe, I have wanted for a long time to break up
cp_mv.c into two seperate applets: cp.c and mv.c (ditto, chmod_chown_chgrp.c).
If _you_ would like to split them up before attempting to add -i support to
them, I would be overjoyed to accept such a patch.

BTW, if / when -i support is added to cp & mv, the name of the feature should
probably change to just BB_FEATURE_INTERACTIVE or BB_FEATURE_CONFIRM or some
such.


Thanks for the patch, Christophe.


Mark Whitley
markw at lineo.com





More information about the busybox mailing list