1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | $ ./busybox wc --help BusyBox v1.1.1 (2006.04.09-15:27+0000) multi-call binary Usage: wc [OPTION]... [FILE]... Print line, word, and byte counts for each FILE, and a total line if more than one FILE is specified. With no FILE, read standard input. Options: -c print the byte counts -l print the newline counts -L print the length of the longest line -w print the word counts $ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #include "busybox.h" int newcmd_main( int argc, char *argv[] ) { int i; printf("newcmd called:\n"); for (i = 0 ; i < argc ; i++) { printf("arg[%d] = %s\n", i, argv); } return 0; } |
1 2 3 | MISCUTILS-$(CONFIG_MT) += mt.o MISCUTILS-$(CONFIG_NEWCMD) += newcmd.o MISCUTILS-$(CONFIG_RUNLEVEL) += runlevel.o |
1 2 3 4 5 | config CONFIG_NEWCMD bool "newcmd" default n help newcmd is a new test command. |
1 | USE_NEWCMD(APPLET(newcmd, newcmd_main, _BB_DIR_USER_BIN, _BB_SUID_NEVER)) |
1 2 | #define newcmd_trivial_usage "None" #define newcmd_full_usage "None" |
1 2 3 4 5 6 7 8 9 10 | $ ./busybox newcmd arg1 newcmd called: arg[0] = newcmd arg[1] = arg1 $ ./busybox newcmd --help BusyBox v1.1.1 (2006.04.12-13:47+0000) multi-call binary Usage: newcmd None None |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |