3 ** A "micro-shell" to test editline library.
4 ** If given any arguments, commands aren't executed.
6 #if defined(HAVE_CONFIG_H)
18 static int n_flag = 0;
19 static int version_flag = 0;
20 static int help_flag = 0;
22 static struct getargs args[] = {
23 {"dry-run", 'n', arg_flag, &n_flag,
24 "do not run commands", NULL },
25 {"version", 0, arg_flag, &version_flag,
26 "print version", NULL },
27 {"help", 0, arg_flag, &help_flag,
35 sizeof(args)/sizeof(*args),
42 main(int argc, char **argv)
47 setprogname (argv[0]);
49 if(getarg(args, sizeof(args) / sizeof(args[0]), argc, argv, &optind))
63 while ((p = readline("testit> ")) != NULL) {
64 (void)printf("\t\t\t|%s|\n", p);
66 if (strncmp(p, "cd ", 3) == 0) {
69 } else if (system(p) != 0) {