#include "config.h"
#include <getopt.h>
#include <errno.h>
+#include <libgen.h>
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
" [ --help ]\n"
" [ --noflush ]\n"
" [ --table=<TABLE> ]\n"
- " [ --modprobe=<command> ]\n"
+ " [ --modprobe=<command> ]\n"
" [ --ipv4 ]\n"
" [ --ipv6 ]\n", name);
}
p.testing = 1;
break;
case 'h':
- print_usage("xtables-restore",
- PACKAGE_VERSION);
+ print_usage(prog_name, PACKAGE_VERSION);
exit(0);
case 'n':
h.noflush = 1;
break;
default:
fprintf(stderr,
- "Try `xtables-restore -h' for more information.\n");
+ "Try `%s -h' for more information.\n",
+ prog_name);
exit(1);
}
}
int xtables_ip4_restore_main(int argc, char *argv[])
{
- return xtables_restore_main(NFPROTO_IPV4, "iptables-restore",
+ return xtables_restore_main(NFPROTO_IPV4, basename(*argv),
argc, argv);
}
int xtables_ip6_restore_main(int argc, char *argv[])
{
- return xtables_restore_main(NFPROTO_IPV6, "ip6tables-restore",
+ return xtables_restore_main(NFPROTO_IPV6, basename(*argv),
argc, argv);
}