| |
int newargvl;
|
| |
int j;
|
| |
|
| + |
struct option longopts[] = {
|
| + |
{ "debug", no_argument, NULL, 'd' },
|
| + |
#ifdef HAVE_LIBJAIL
|
| + |
{ "jail", required_argument, NULL, 'j' },
|
| + |
#endif
|
| + |
{ "chroot", required_argument, NULL, 'c' },
|
| + |
{ "config", required_argument, NULL, 'C' },
|
| + |
{ "repo-conf-dir", required_argument, NULL, 'R' },
|
| + |
{ "list", no_argument, NULL, 'l' },
|
| + |
{ "check-activation", no_argument, NULL, 'N' },
|
| + |
{ "version", no_argument, NULL, 'v' },
|
| + |
{ "option", required_argument, NULL, 'o' },
|
| + |
};
|
| + |
|
| |
/* Set stdout unbuffered */
|
| |
setvbuf(stdout, NULL, _IONBF, 0);
|
| |
|
| |
usage(NULL, NULL, stderr, PKG_USAGE_INVALID_ARGUMENTS, "not enough arguments");
|
| |
|
| |
#ifdef HAVE_LIBJAIL
|
| - |
while ((ch = getopt(argc, argv, "dj:c:C:R:lNvqo:")) != -1) {
|
| + |
while ((ch = getopt_long(argc, argv, "dj:c:C:R:lNvo:", longopts, NULL)) != -1) {
|
| |
#else
|
| - |
while ((ch = getopt(argc, argv, "dc:C:R:lNvqo:")) != -1) {
|
| + |
while ((ch = getopt_long(argc, argv, "dc:C:R:lNvo:", longopts, NULL)) != -1) {
|
| |
#endif
|
| |
switch (ch) {
|
| |
case 'd':
|