* Parse the application arguments to the node app. */
| 89 | * Parse the application arguments to the node app. |
| 90 | */ |
| 91 | static int |
| 92 | parse_app_args(int argc, char *argv[]) |
| 93 | { |
| 94 | int option_index, opt; |
| 95 | char **argvopt = argv; |
| 96 | const char *progname = NULL; |
| 97 | static struct option lgopts[] = { /* no long options */ |
| 98 | {NULL, 0, 0, 0 } |
| 99 | }; |
| 100 | progname = argv[0]; |
| 101 | |
| 102 | while ((opt = getopt_long(argc, argvopt, "n:", lgopts, |
| 103 | &option_index)) != EOF) { |
| 104 | switch (opt) { |
| 105 | case 'n': |
| 106 | if (parse_node_num(optarg) != 0) { |
| 107 | usage(progname); |
| 108 | return -1; |
| 109 | } |
| 110 | break; |
| 111 | default: |
| 112 | usage(progname); |
| 113 | return -1; |
| 114 | } |
| 115 | } |
| 116 | return 0; |
| 117 | } |
| 118 | |
| 119 | /* |
| 120 | * Tx buffer error callback |
no test coverage detected