xbps-query: process modes and arguments correctly.

This commit is contained in:
Juan RP 2012-11-18 12:57:38 +01:00
parent 6094bbc6ea
commit 55982c7a3c

View File

@ -123,23 +123,23 @@ main(int argc, char **argv)
usage(false); usage(false);
/* NOTREACHED */ /* NOTREACHED */
case 'L': case 'L':
list_repos = opmode = true; list_repos = true;
break; break;
case 'l': case 'l':
list_pkgs = opmode = true; list_pkgs = true;
break; break;
case 'm': case 'm':
list_manual = opmode = true; list_manual = true;
break; break;
case 'M': case 'M':
orphans = opmode = true; orphans = true;
break; break;
case 'o': case 'o':
own = opmode = true; own = opmode = true;
break; break;
case 'p': case 'p':
props = optarg; props = optarg;
show_prop = opmode = true; show_prop = true;
break; break;
case 'R': case 'R':
repo_mode = true; repo_mode = true;
@ -169,7 +169,7 @@ main(int argc, char **argv)
} }
if (!opmode && argc > optind) if (!opmode && argc > optind)
show = true; show = true;
else if (!opmode && argc == optind) else if (opmode && (argc == optind))
usage(true); usage(true);
else if ((search || own) && (argc == optind)) else if ((search || own) && (argc == optind))
usage(true); usage(true);