static char *prompt;
static struct option const long_options[] = {
+ {"batch", no_argument, NULL, 'b'},
{"config", required_argument, NULL, 'c'},
{"net", required_argument, NULL, 'n'},
{"help", no_argument, NULL, 1},
} else {
printf("Usage: %s [options] command\n\n", program_name);
printf("Valid options are:\n"
+ " -b, --batch Don't ask for anything (non-interactive mode).\n"
" -c, --config=DIR Read configuration options from DIR.\n"
" -n, --net=NETNAME Connect to net NETNAME.\n"
" --pidfile=FILENAME Read control cookie from FILENAME.\n"
case 0: /* long option */
break;
+ case 'b':
+ tty = false;
+ break;
+
case 'c': /* config file */
confbase = xstrdup(optarg);
confbasegiven = true;
program_name = argv[0];
orig_argv = argv;
orig_argc = argc;
+ tty = isatty(0) && isatty(1);
if(!parse_options(argc, argv))
return 1;
srand(time(NULL));
crypto_init();
- tty = isatty(0) && isatty(1);
-
if(optind >= argc)
return cmd_shell(argc, argv);