1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2002 Cluster File Systems, Inc.
12 #include <portals/api-support.h>
13 #include <portals/ptlctl.h>
14 #include <portals/list.h>
18 static int jt_quit(int argc, char **argv) {
19 Parser_quit(argc, argv);
23 static int jt_noop(int argc, char **argv) {
27 static int jt_opt_ignore_errors(int argc, char **argv) {
28 Parser_ignore_errors(1);
32 command_t cmdlist[] = {
34 {"--ignore_errors", jt_opt_ignore_errors, 0,
35 "ignore errors that occur during script processing\n"
37 /* snapshot commands*/
38 {"add", snapshot_add, 0,
39 "add [table_no] <snap_name> add snapshot to the device\n"},
40 {"list", snapshot_list, 0, "snap_list list snap available device\n"},
41 {"dev", snapshot_dev, 0, "open <device> open available snap device\n"},
43 /* User interface commands */
44 {"======= control ========", jt_noop, 0, "control commands"},
45 {"help", Parser_help, 0, "help"},
46 {"exit", jt_quit, 0, "quit"},
47 {"quit", jt_quit, 0, "quit"},
51 int main(int argc, char **argv)
57 Parser_init("snapconf > ", cmdlist);
61 rc = Parser_execarg(argc - 1, argv + 1, cmdlist);
63 rc = Parser_commands();