]>
git.proxmox.com Git - mirror_iproute2.git/blob - tipc/tipc.c
2 * tipc. TIPC utility frontend.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
9 * Authors: Richard Alpe <richard.alpe@ericsson.com>
19 #include "nametable.h"
30 static void about(struct cmdl
*cmdl
)
33 "Transparent Inter-Process Communication Protocol\n"
34 "Usage: %s [OPTIONS] COMMAND [ARGS] ...\n"
37 " -h, --help \t\tPrint help for last given command\n"
38 " -j, --json \t\tJson format printouts\n"
39 " -p, --pretty \t\tpretty print\n"
42 " bearer - Show or modify bearers\n"
43 " link - Show or modify links\n"
44 " media - Show or modify media\n"
45 " nametable - Show nametable\n"
46 " node - Show or modify node related parameters\n"
47 " peer - Peer related operations\n"
48 " socket - Show sockets\n",
52 int main(int argc
, char *argv
[])
57 const struct cmd cmd
= {"tipc", NULL
, about
};
58 struct option long_options
[] = {
59 {"help", no_argument
, 0, 'h'},
60 {"json", no_argument
, 0, 'j'},
61 {"pretty", no_argument
, 0, 'p'},
64 const struct cmd cmds
[] = {
65 { "bearer", cmd_bearer
, cmd_bearer_help
},
66 { "link", cmd_link
, cmd_link_help
},
67 { "media", cmd_media
, cmd_media_help
},
68 { "nametable", cmd_nametable
, cmd_nametable_help
},
69 { "node", cmd_node
, cmd_node_help
},
70 { "peer", cmd_peer
, cmd_peer_help
},
71 { "socket", cmd_socket
, cmd_socket_help
},
78 i
= getopt_long(argc
, argv
, "hjp", long_options
, &option_index
);
83 * We want the help for the last command, so we flag
84 * here in order to print later.
90 * Enable json format printouts
96 * Enable json pretty output
104 /* Invalid option, error msg is printed by getopts */
109 cmdl
.optind
= optind
;
113 if ((res
= run_cmd(NULL
, &cmd
, cmds
, &cmdl
, NULL
)) != 0)