/* See Makefile for compilation details. */
-#include "config.h"
+#include <config.h>
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif
#include <stdio.h>
+
#include "builtins.h"
#include "shell.h"
+#include "bashgetopt.h"
/* A builtin `xxx' is normally implemented with an `xxx_builtin' function.
If you're converting a command that uses the normal Unix argc/argv
- calling convention, use argv = word_list_to_argv (list, &argc) and call
+ calling convention, use argv = make_builtin_argv (list, &argc) and call
the original `main' something like `xxx_main'. Look at cat.c for an
example.
A builtin command returns EXECUTION_SUCCESS for success and
EXECUTION_FAILURE to indicate failure. */
+int
hello_builtin (list)
WORD_LIST *list;
{
}
/* An array of strings forming the `long' documentation for a builtin xxx,
- which is printed by `help xxx'. It must end with a NULL. */
+ which is printed by `help xxx'. It must end with a NULL. By convention,
+ the first line is a short description. */
char *hello_doc[] = {
+ "Sample builtin.",
+ "",
"this is the long doc for the sample hello builtin",
- "which is a bare-bones echo",
(char *)NULL
};
hello_builtin, /* function implementing the builtin */
BUILTIN_ENABLED, /* initial flags for builtin */
hello_doc, /* array of long documentation strings. */
- "hello [args]", /* usage synopsis; becomes short_doc */
+ "hello", /* usage synopsis; becomes short_doc */
0 /* reserved for internal use */
};