~james-page/ubuntu/saucy/openvswitch/1.12-snapshot

« back to all changes in this revision

Viewing changes to ovsdb/ovsdb-tool.c

  • Committer: James Page
  • Date: 2013-08-21 10:16:57 UTC
  • mfrom: (1.1.20)
  • Revision ID: james.page@canonical.com-20130821101657-3o0z0qeiv5zkwlzi
New upstream snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
/* -m, --more: Verbosity level for "show-log" command output. */
46
46
static int show_log_verbosity;
47
47
 
48
 
static const struct command all_commands[];
 
48
static const struct command *get_all_commands(void);
49
49
 
50
50
static void usage(void) NO_RETURN;
51
51
static void parse_options(int argc, char *argv[]);
59
59
    set_program_name(argv[0]);
60
60
    parse_options(argc, argv);
61
61
    signal(SIGPIPE, SIG_IGN);
62
 
    run_command(argc - optind, argv + optind, all_commands);
 
62
    run_command(argc - optind, argv + optind, get_all_commands());
63
63
    return 0;
64
64
}
65
65
 
66
66
static void
67
67
parse_options(int argc, char *argv[])
68
68
{
69
 
    static struct option long_options[] = {
 
69
    static const struct option long_options[] = {
70
70
        {"more", no_argument, NULL, 'm'},
71
71
        {"verbose", optional_argument, NULL, 'v'},
72
72
        {"help", no_argument, NULL, 'h'},
519
519
            date = shash_find_data(json_object(json), "_date");
520
520
            if (date && date->type == JSON_INTEGER) {
521
521
                time_t t = json_integer(date);
522
 
                char s[128];
523
 
 
524
 
                strftime(s, sizeof s, "%Y-%m-%d %H:%M:%S", gmtime(&t));
525
 
                printf(" %s", s);
 
522
                char *s = xastrftime(" %Y-%m-%d %H:%M:%S", t, true);
 
523
                fputs(s, stdout);
 
524
                free(s);
526
525
            }
527
526
 
528
527
            comment = shash_find_data(json_object(json), "_comment");
565
564
    { "help", 0, INT_MAX, do_help },
566
565
    { NULL, 0, 0, NULL },
567
566
};
 
567
 
 
568
static const struct command *get_all_commands(void)
 
569
{
 
570
    return all_commands;
 
571
}