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 {"device_list", snap_dev_list, 0,
39 "device_list list snap available device\n"},
40 {"device", snap_dev_open, 0,
41 "dev <device> open available snap device\n"},
42 {"add", snap_snap_add, 0,
43 "add [table_no] <snap_name> add snapshot to the device\n"},
44 {"del", snap_snap_del, 0,
45 "del [table_no] <snap_name> del snapshot to the device\n"},
46 {"snap_list", snap_snap_list, 0,
47 "snap_list [table_no] list all the snapshots on the device\n"},
49 /* User interface commands */
50 {"======= control ========", jt_noop, 0, "control commands"},
51 {"help", Parser_help, 0, "help"},
52 {"exit", jt_quit, 0, "quit"},
53 {"quit", jt_quit, 0, "quit"},
57 int main(int argc, char **argv)
63 Parser_init("snapconf > ", cmdlist);
67 rc = Parser_execarg(argc - 1, argv + 1, cmdlist);
69 rc = Parser_commands();