argc -= optind;
argv += optind;
if (argc != 1) {
- fatal(0, "exactly one non-option argument required; "
- "use --help for help");
+ ofp_fatal(0, "exactly one non-option argument required; "
+ "use --help for help");
}
error = dhclient_create(argv[0], modify_dhcp_request, NULL, NULL, &cli);
if (error) {
- fatal(error, "dhclient_create failed");
+ ofp_fatal(error, "dhclient_create failed");
}
dhclient_init(cli, request_ip.s_addr);
fatal_signal_add_hook(release, cli, true);
switch (c) {
case OPT_REQUEST_IP:
if (!inet_aton(optarg, &request_ip)) {
- fatal(0, "--request-ip argument is not a valid IP address");
+ ofp_fatal(0,
+ "--request-ip argument is not a valid IP address");
}
break;
usage();
case 'V':
- printf("%s "VERSION" compiled "__DATE__" "__TIME__"\n", argv[0]);
+ printf("%s %s compiled "__DATE__" "__TIME__"\n",
+ program_name, VERSION BUILDNR);
exit(EXIT_SUCCESS);
case 'v':
" do not request a specific IP)\n"
" --vendor-class=STRING use STRING as vendor class (default:\n"
" none); use OpenFlow to imitate secchan\n"
- " --no-resolv-conf do not update /etc/resolv.conf\n"
- "\nOther options:\n"
- " -v, --verbose=MODULE[:FACILITY[:LEVEL]] set logging levels\n"
- " -v, --verbose set maximum verbosity level\n"
- " -h, --help display this help message\n"
- " -V, --version display version information\n",
+ " --no-resolv-conf do not update /etc/resolv.conf\n",
program_name, program_name);
+ vlog_usage();
+ printf("\nOther options:\n"
+ " -h, --help display this help message\n"
+ " -V, --version display version information\n");
exit(EXIT_SUCCESS);
}