30 if (nargs == 2 &&
strncmp(args[1],
"--help", 7) == 0) {
33 printf(
"\t%s [command]\n", args[0]);
35 printf(
"\tProvides a list of shell commands or\n");
36 printf(
"\thelp information for a specific command\n");
38 printf(
"\tcommand\tspecific command for which to\n");
39 printf(
"\t\tdisplay help information\n");
40 printf(
"\t--help\tdisplay this help and exit\n");
56 for (i = 0; i <
ncmd; i++) {
77 printf(
"%s: no such command as '%s'\n", args[0], args[1]);
83 printf(
"\nshell commands are:\n\n");
88 for (i = 0; i <
ncmd; i++) {
108 lines = (ncmd+(cols-1))/cols;
112 for (i=0; i<lines; i++) {
113 for (j=i; j<
ncmd; j+=lines) {
int32 strncmp(const char *, const char *, int32)
uint32 ncmd
XINUシェルが提供するコマンドの数
int32 printf(const char *,...)
shellcmd xsh_help(int nargs, char *args[])
int int32
符号あり32ビット整数(int)
const struct cmdent cmdtab[]
XINUシェルが提供するコマンドを管理する配列
int32 shellcmd
シェルコール関数 返り値の型
int32 fprintf(int, char *,...)
int32(* cfunc)(int32, char *[])
コマンドの機能を提供する関数(正確には関数ポインタ)
int32 strnlen(const char *, uint32)
NULL終端された文字列の長さを返す。NULL終端は長さに含まない。
#define NULLCH
NULL文字(NULL終端)