diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2014-03-17 15:06:29 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2014-03-17 15:06:29 +0100 |
commit | f332617fbd9248f34cff183a2a4caa961730625d (patch) | |
tree | 654da089139b5b6a9249f6cc3bb13452332bf74d /docs | |
parent | c50493854a78b28b3642a402d1a0bbd57c1b3c1b (diff) | |
download | busybox-f332617fbd9248f34cff183a2a4caa961730625d.tar.gz |
docs/new-applet-HOWTO.txt: tweak a bit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/new-applet-HOWTO.txt | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/docs/new-applet-HOWTO.txt b/docs/new-applet-HOWTO.txt index 28970a50a..078e77bce 100644 --- a/docs/new-applet-HOWTO.txt +++ b/docs/new-applet-HOWTO.txt @@ -6,7 +6,7 @@ This document details the steps you must take to add a new applet to BusyBox. Credits: Matt Kraai - initial writeup Mark Whitley - the remix -Thomas Lundquist - Trying to keep it updated. +Thomas Lundquist - trying to keep it updated 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. @@ -23,7 +23,7 @@ as the first include file in your applet. For a new applet mu, here is the code that would go in mu.c: -(busybox.h already includes most usual header files. You do not need +(libbb.h already includes most usual header files. You do not need #include <stdio.h> etc...) @@ -43,7 +43,7 @@ For a new applet mu, here is the code that would go in mu.c: //config:config MU //config: bool "MU" -//config: default n +//config: default y //config: help //config: Returns an indeterminate value. @@ -51,12 +51,11 @@ For a new applet mu, here is the code that would go in mu.c: //applet:IF_MU(APPLET(mu, BB_DIR_USR_BIN, BB_SUID_DROP)) //usage:#define mu_trivial_usage -//usage: "-[abcde] FILES" +//usage: "[-abcde] FILE..." //usage:#define mu_full_usage -//usage: "Returns an indeterminate value.\n\n" -//usage: "Options:\n" -//usage: "\t-a\t\tfirst function\n" -//usage: "\t-b\t\tsecond function\n" +//usage: "Returns an indeterminate value\n" +//usage: "\n -a First function" +//usage: "\n -b Second function" int mu_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int mu_main(int argc, char **argv) @@ -150,13 +149,13 @@ Find the appropriate directory for your new applet. Add the kbuild snippet to the .c file: -//kbuild:lib-$(CONFIG_MU) += mu.o +//kbuild:lib-$(CONFIG_MU) += mu.o Add the config snippet to the .c file: //config:config MU //config: bool "MU" -//config: default n +//config: default y //config: help //config: Returns an indeterminate value. @@ -168,18 +167,16 @@ Next, add usage information for your applet to the .c file. This should look like the following: //usage:#define mu_trivial_usage -//usage: "-[abcde] FILES" +//usage: "[-abcde] FILE..." //usage:#define mu_full_usage -//usage: "Returns an indeterminate value.\n\n" -//usage: "Options:\n" -//usage: "\t-a\t\tfirst function\n" -//usage: "\t-b\t\tsecond function\n" +//usage: "Returns an indeterminate value\n" +//usage: "\n -a First function" +//usage: "\n -b Second function" //usage: ... If your program supports flags, the flags should be mentioned on the first -line (-[abcde]) and a detailed description of each flag should go in the -mu_full_usage section, one flag per line. (Numerous examples of this -currently exist in usage.src.h.) +line ([-abcde]) and a detailed description of each flag should go in the +mu_full_usage section, one flag per line. Header Files |