nc: show help text on bad parameters
[oweals/busybox.git] / docs / new-applet-HOWTO.txt
index 05ff92f2614a030bf0a80ba92d5476f46e62abb7..2f237564d5680c846cb70ff8ff3caa5cdf864a8a 100644 (file)
@@ -8,8 +8,8 @@ Matt Kraai - initial writeup
 Mark Whitley - the remix
 Thomas Lundquist - Trying to keep it updated.
 
-When doing this you should consider using the latest svn trunk.
-This is a good thing if you plan to getting it commited into mainline.
+When doing this you should consider using the latest git HEAD.
+This is a good thing if you plan to getting it committed into mainline.
 
 Initial Write
 -------------
@@ -36,16 +36,17 @@ For a new applet mu, here is the code that would go in mu.c:
  *
  * Copyright (C) [YEAR] by [YOUR NAME] <YOUR EMAIL>
  *
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2, see file LICENSE in this source tree.
  */
 
 #include "libbb.h"
 #include "other.h"
 
-int mu_main(int argc, char **argv);
+int mu_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int mu_main(int argc, char **argv)
 {
        int fd;
+       ssize_t n;
        char mu;
 
        fd = xopen("/dev/random", O_RDONLY);
@@ -106,7 +107,7 @@ the function declaration. If not, add it somewhere anyway, with or without
 ifdefs to include or not.
 
 You can look at libbb/Config.in and try to find out if the function is
-tuneable and add it there if it is.
+tunable and add it there if it is.
 
 
 Placement / Directory
@@ -123,7 +124,7 @@ lib-$(CONFIG_MU)               += mu.o
 
 Add the applet to Config.in in the chosen directory:
 
-config CONFIG_MU
+config MU
        bool "MU"
        default n
        help
@@ -161,19 +162,20 @@ algorithm in busybox.c and the Gods of BusyBox smite you. Yea, verily:
 Be sure to read the top of applets.h before adding your applet.
 
        /* all programs above here are alphabetically "less than" 'mu' */
-       USE_MU(APPLET(mu, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
+       IF_MU(APPLET(mu, _BB_DIR_USR_BIN, _BB_SUID_DROP))
        /* all programs below here are alphabetically "greater than" 'mu' */
 
 
 The Grand Announcement
 ----------------------
 
-Then create a diff by adding the new files with svn (remember your libbb files)
-       svn add <where you put it>/mu.c
+Then create a diff by adding the new files to git (remember your libbb files)
+       git add <where you put it>/mu.c
 eventually also:
-       svn add libbb/function.c
+       git add libbb/function.c
 then
-       svn diff
+       git commit
+       git format-patch HEAD^
 and send it to the mailing list:
        busybox@busybox.net
        http://busybox.net/mailman/listinfo/busybox