xbps-query: fail on trailing parameters.

This commit is contained in:
Enno Boland 2015-09-23 13:22:18 +02:00
parent d8fc08eb50
commit f1617441db
2 changed files with 8 additions and 1 deletions

2
NEWS
View File

@ -1,5 +1,7 @@
xbps-0.48 (???): xbps-0.48 (???):
* xbps-query(1): fail if unused arguments are supplied.
* libxbps: relative cachedir set via xbps.d(5) now work correctly. * libxbps: relative cachedir set via xbps.d(5) now work correctly.
Fixes #117 (https://github.com/voidlinux/xbps/issues/117) Fixes #117 (https://github.com/voidlinux/xbps/issues/117)

View File

@ -221,7 +221,12 @@ main(int argc, char **argv)
} else if (!opmode) { } else if (!opmode) {
/* show mode by default */ /* show mode by default */
show = opmode = true; show = opmode = true;
pkg = *argv; pkg = *(argv++);
argc--;
}
if (argc) {
/* trailing parameters */
usage(true);
} }
/* /*
* Initialize libxbps. * Initialize libxbps.