@@ -30,8 +30,7 @@ static void print_usage(const char *argv0) {
3030 printf ("\n" );
3131 printf ("--socket-group=GROUP socket group name (default: "
3232 "\"" CLI_DEFAULT_SOCKET_GROUP "\")\n" );
33- printf (
34- "--vmnet-mode=(host|shared|bridged) vmnet mode (default: \"shared\")\n" );
33+ printf ("--vmnet-mode=(host|shared|bridged) vmnet mode (default: \"shared\")\n" );
3534 printf ("--vmnet-interface=INTERFACE interface used for "
3635 "--vmnet=bridged, e.g., \"en0\"\n" );
3736 printf ("--vmnet-gateway=IP gateway used for "
@@ -83,18 +82,18 @@ struct cli_options *cli_options_parse(int argc, char *argv[]) {
8382 }
8483
8584 const struct option longopts [] = {
86- {"socket-group" , required_argument , NULL , CLI_OPT_SOCKET_GROUP },
87- {"vmnet-mode" , required_argument , NULL , CLI_OPT_VMNET_MODE },
88- {"vmnet-interface" , required_argument , NULL , CLI_OPT_VMNET_INTERFACE },
89- {"vmnet-gateway" , required_argument , NULL , CLI_OPT_VMNET_GATEWAY },
90- {"vmnet-dhcp-end" , required_argument , NULL , CLI_OPT_VMNET_DHCP_END },
91- {"vmnet-mask" , required_argument , NULL , CLI_OPT_VMNET_MASK },
92- {"vmnet-interface-id" , required_argument , NULL , CLI_OPT_VMNET_INTERFACE_ID },
93- {"vmnet-nat66-prefix" , required_argument , NULL , CLI_OPT_VMNET_NAT66_PREFIX },
94- {"pidfile" , required_argument , NULL , 'p' },
95- {"help" , no_argument , NULL , 'h' },
96- {"version" , no_argument , NULL , 'v' },
97- {0 , 0 , 0 , 0 },
85+ {"socket-group" , required_argument , NULL , CLI_OPT_SOCKET_GROUP },
86+ {"vmnet-mode" , required_argument , NULL , CLI_OPT_VMNET_MODE },
87+ {"vmnet-interface" , required_argument , NULL , CLI_OPT_VMNET_INTERFACE },
88+ {"vmnet-gateway" , required_argument , NULL , CLI_OPT_VMNET_GATEWAY },
89+ {"vmnet-dhcp-end" , required_argument , NULL , CLI_OPT_VMNET_DHCP_END },
90+ {"vmnet-mask" , required_argument , NULL , CLI_OPT_VMNET_MASK },
91+ {"vmnet-interface-id" , required_argument , NULL , CLI_OPT_VMNET_INTERFACE_ID },
92+ {"vmnet-nat66-prefix" , required_argument , NULL , CLI_OPT_VMNET_NAT66_PREFIX },
93+ {"pidfile" , required_argument , NULL , 'p' },
94+ {"help" , no_argument , NULL , 'h' },
95+ {"version" , no_argument , NULL , 'v' },
96+ {0 , 0 , 0 , 0 },
9897 };
9998 int opt = 0 ;
10099 while ((opt = getopt_long (argc , argv , "hvp:" , longopts , NULL )) != -1 ) {
@@ -158,8 +157,7 @@ struct cli_options *cli_options_parse(int argc, char *argv[]) {
158157
159158 /* fill default */
160159 if (res -> socket_group == NULL )
161- res -> socket_group =
162- strdup (CLI_DEFAULT_SOCKET_GROUP ); /* use strdup to make it freeable */
160+ res -> socket_group = strdup (CLI_DEFAULT_SOCKET_GROUP ); /* use strdup to make it freeable */
163161 if (res -> vmnet_mode == 0 )
164162 res -> vmnet_mode = VMNET_SHARED_MODE ;
165163 if (res -> vmnet_gateway != NULL && res -> vmnet_dhcp_end == NULL ) {
@@ -182,8 +180,7 @@ struct cli_options *cli_options_parse(int argc, char *argv[]) {
182180 res -> vmnet_dhcp_end = strdup (end_static );
183181 }
184182 if (res -> vmnet_gateway != NULL && res -> vmnet_mask == NULL )
185- res -> vmnet_mask =
186- strdup ("255.255.255.0" ); /* use strdup to make it freeable */
183+ res -> vmnet_mask = strdup ("255.255.255.0" ); /* use strdup to make it freeable */
187184 if (uuid_is_null (res -> vmnet_interface_id )) {
188185 uuid_generate_random (res -> vmnet_interface_id );
189186 }
@@ -196,7 +193,7 @@ struct cli_options *cli_options_parse(int argc, char *argv[]) {
196193 if (res -> vmnet_gateway == NULL ) {
197194 if (res -> vmnet_mode != VMNET_BRIDGED_MODE ) {
198195 WARN ("--vmnet-gateway=IP should be explicitly specified to "
199- "avoid conflicting with other applications" );
196+ "avoid conflicting with other applications" );
200197 }
201198 if (res -> vmnet_dhcp_end != NULL ) {
202199 ERROR ("--vmnet-dhcp-end=IP requires --vmnet-gateway=IP" );
@@ -213,8 +210,7 @@ struct cli_options *cli_options_parse(int argc, char *argv[]) {
213210 }
214211 struct in_addr dummy ;
215212 if (!inet_aton (res -> vmnet_gateway , & dummy )) {
216- ERRORF ("invalid address \"%s\" was specified for --vmnet-gateway" ,
217- res -> vmnet_gateway );
213+ ERRORF ("invalid address \"%s\" was specified for --vmnet-gateway" , res -> vmnet_gateway );
218214 goto error ;
219215 }
220216 }
0 commit comments