示例#1
0
               argv[0], argv[1]);
    }
}




#define LOG_GROUP_DESCRIPTION                                               \
    "Log commands provide means to configure the active logging settings\n" \
    "of Murphy. Commands are provided for changing the logging level,\n"    \
    "listing log targets, and settting the active target.\n"

#define LEVEL_SYNTAX      "[[info[,warning[,error]]]]"
#define LEVEL_SUMMARY     "change or show the active logging level"
#define LEVEL_DESCRIPTION \
    "Changes the logging level to the given one. Without arguments it\n" \
    "prints out the current logging level.\n"

#define TARGET_SYNTAX      "[stdout|stderr|syslog|<other targets>]"
#define TARGET_SUMMARY     "change or show the active logging target"
#define TARGET_DESCRIPTION \
    "Changes the active logging target to the given one. Without arguments\n" \
    "it lists the available targets and the currently active one."

MRP_CORE_CONSOLE_GROUP(log_group, "log", LOG_GROUP_DESCRIPTION, NULL, {
        MRP_TOKENIZED_CMD("level" , log_level , FALSE,
                          LEVEL_SYNTAX , LEVEL_SUMMARY , LEVEL_DESCRIPTION),
        MRP_TOKENIZED_CMD("target", log_target, FALSE,
                          TARGET_SYNTAX, TARGET_SUMMARY, TARGET_DESCRIPTION)
});
} client_t;


static void print_zones_cb(mrp_console_t *, void *, int, char **argv);
static void print_classes_cb(mrp_console_t *, void *, int, char **argv);
static void print_sets_cb(mrp_console_t *, void *, int, char **argv);
static void print_owners_cb(mrp_console_t *, void *, int, char **argv);
static void print_resources_cb(mrp_console_t *, void *, int, char **argv);

static void resource_event_handler(uint32_t, mrp_resource_set_t *, void *);


MRP_CONSOLE_GROUP(resource_group, "resource", NULL, NULL, {
        MRP_TOKENIZED_CMD("zones"  , print_zones_cb, FALSE,
                          "zones", "prints zones",
                          "prints the available zones. The data sources "
                          "for the printout are the internal data structures "
                          "of the resource library."),
        MRP_TOKENIZED_CMD("classes"  , print_classes_cb, FALSE,
                          "classes", "prints application classes",
                          "prints the available application classes. The "
                          "data sources for the printout are the internal "
                          "data structures of the resource library."),
        MRP_TOKENIZED_CMD("sets", print_sets_cb, FALSE,
                          "sets", "prints resource sets",
                          "prints the current resource sets for each "
                          "application class. The data sources for the "
                          "printout are the internal data structures of the "
                          "resource library"),
        MRP_TOKENIZED_CMD("owners" , print_owners_cb , FALSE,
                          "owners", "prints resource owners",
示例#3
0
    ARG_FAILINIT,
    ARG_FAILEXIT,
    ARG_OBJECT,
    ARG_REST,
};


void one_cb(mrp_console_t *c, void *user_data, int argc, char **argv);
void two_cb(mrp_console_t *c, void *user_data, int argc, char **argv);
void three_cb(mrp_console_t *c, void *user_data, int argc, char **argv);
void four_cb(mrp_console_t *c, void *user_data, int argc, char **argv);
void resolve_cb(mrp_console_t *c, void *user_data, int argc, char **argv);
void auth_cb(mrp_console_t *c, void *user_data, int argc, char **argv);

MRP_CONSOLE_GROUP(test_group, "test", NULL, NULL, {
        MRP_TOKENIZED_CMD("one"  , one_cb  , TRUE,
                          "one [args]", "command 1", "description 1"),
        MRP_TOKENIZED_CMD("two"  , two_cb  , FALSE,
                          "two [args]", "command 2", "description 2"),
        MRP_TOKENIZED_CMD("three", three_cb, FALSE,
                          "three [args]", "command 3", "description 3"),
        MRP_TOKENIZED_CMD("four" , four_cb , TRUE,
                          "four [args]", "command 4", "description 4"),
        MRP_TOKENIZED_CMD("update" , resolve_cb , TRUE,
                          "update <target>", "update target", "update target"),
        MRP_TOKENIZED_CMD("auth-test", auth_cb, TRUE,
                          "auth-test [@backend] target mode id [token]",
                          "test authentication", "test authentication")
});


void one_cb(mrp_console_t *c, void *user_data, int argc, char **argv)
示例#4
0
    "    @file[=on|off]:      all messages in <file>\n"                   \
    "    @file:line[=on|off]: messages at <file>:<line>\n"                \
    "    *[=on|off]:          all messages\n"                             \

#define RESET_SYNTAX        "reset"
#define RESET_SUMMARY       "reset debugging configuration"
#define RESET_DESCRIPTION                                                 \
    "Reset the debugging configuration to the defaults. This will turn"   \
    "disable debugging globally and flush all debugging rules.\n"

#define LIST_SYNTAX         "list"
#define LIST_SUMMARY        "list known debug sites"
#define LIST_DESCRIPTION                                                  \
    "List all known debug sites of the murphy daemon itself as\n"         \
    "as well as from any loaded murphy plugins.\n"

MRP_CORE_CONSOLE_GROUP(debug_group, "debug", DEBUG_GROUP_DESCRIPTION, NULL, {
        MRP_TOKENIZED_CMD("enable", debug_enable, FALSE,
                          ENABLE_SYNTAX, ENABLE_SUMMARY, ENABLE_DESCRIPTION),
        MRP_TOKENIZED_CMD("disable", debug_disable, FALSE,
                          DISABLE_SYNTAX, DISABLE_SUMMARY, DISABLE_DESCRIPTION),
        MRP_TOKENIZED_CMD("show", debug_show, FALSE,
                          SHOW_SYNTAX, SHOW_SUMMARY, SHOW_DESCRIPTION),
        MRP_TOKENIZED_CMD("set", debug_set, FALSE,
                          SET_SYNTAX, SET_SUMMARY, SET_DESCRIPTION),
        MRP_TOKENIZED_CMD("reset", debug_reset, FALSE,
                          RESET_SYNTAX, RESET_SUMMARY, RESET_DESCRIPTION),
        MRP_TOKENIZED_CMD("list", debug_list, FALSE,
                          LIST_SYNTAX, LIST_SUMMARY, LIST_DESCRIPTION)
});
示例#5
0
    ARG_OBJECT,
    ARG_REST,
};


void one_cb(mrp_console_t *c, void *user_data, int argc, char **argv);
void two_cb(mrp_console_t *c, void *user_data, int argc, char **argv);
void three_cb(mrp_console_t *c, void *user_data, int argc, char **argv);
void four_cb(mrp_console_t *c, void *user_data, int argc, char **argv);
void resolve_cb(mrp_console_t *c, void *user_data, int argc, char **argv);
void auth_cb(mrp_console_t *c, void *user_data, int argc, char **argv);
void ping_cb(mrp_console_t *c, void *user_data, int argc, char **argv);
void invoke_cb(mrp_console_t *c, void *user_data, int argc, char **argv);

MRP_CONSOLE_GROUP(test_group, "test", NULL, NULL, {
        MRP_TOKENIZED_CMD("one"  , one_cb  , TRUE,
                          "one [args]", "command 1", "description 1"),
        MRP_TOKENIZED_CMD("two"  , two_cb  , FALSE,
                          "two [args]", "command 2", "description 2"),
        MRP_TOKENIZED_CMD("three", three_cb, FALSE,
                          "three [args]", "command 3", "description 3"),
        MRP_TOKENIZED_CMD("four" , four_cb , TRUE,
                          "four [args]", "command 4", "description 4"),
        MRP_TOKENIZED_CMD("update" , resolve_cb , TRUE,
                          "update <target>", "update target", "update target"),
        MRP_TOKENIZED_CMD("auth-test", auth_cb, TRUE,
                          "auth-test [@backend] target mode id [token]",
                          "test authentication", "test authentication"),
        MRP_TOKENIZED_CMD("ping", ping_cb, FALSE,
                          "ping domain",
                          "ping the given domain", "ping a domain"),
        MRP_TOKENIZED_CMD("invoke", invoke_cb, TRUE,