diff options
author | 2019-11-17 12:51:58 +0100 | |
---|---|---|
committer | 2019-11-17 12:51:58 +0100 | |
commit | 64dbab476d3a9d287b4d114f66923f0872a08774 (patch) | |
tree | 0a9ee48355954bbe839d2b586dcd43186aa1b3e9 /qlist.c | |
parent | libq/xpak: rework to reuse more code (diff) | |
download | portage-utils-64dbab476d3a9d287b4d114f66923f0872a08774.tar.gz portage-utils-64dbab476d3a9d287b4d114f66923f0872a08774.tar.bz2 portage-utils-64dbab476d3a9d287b4d114f66923f0872a08774.zip |
qlist: fix -a option
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qlist.c')
-rw-r--r-- | qlist.c | 27 |
1 files changed, 13 insertions, 14 deletions
@@ -336,23 +336,22 @@ qlist_cb(tree_pkg_ctx *pkg_ctx, void *priv) depend_atom *atom; /* see if this cat/pkg is requested */ - for (i = optind; i < state->argc; ++i) - if (qlist_match(pkg_ctx, state->argv[i], - &state->atoms[i - optind], state->exact)) - break; - if ((i == state->argc) && (state->argc != optind)) - return 0; + if (!state->all) { + for (i = optind; i < state->argc; ++i) + if (qlist_match(pkg_ctx, state->argv[i], + &state->atoms[i - optind], state->exact)) + break; + if (i == state->argc) + return 0; + } atom = tree_get_atom(pkg_ctx, state->need_full_atom); if (state->just_pkgname) { - if ((state->all + state->just_pkgname) < 2) { - printf("%s%s\n", - atom_format(state->fmt, atom), - umapstr(state->show_umap, pkg_ctx)); - } + printf("%s%s\n", + atom_format(state->fmt, atom), + umapstr(state->show_umap, pkg_ctx)); - if (!state->all) - return 1; + return 1; } if (verbose) @@ -449,7 +448,7 @@ int qlist_main(int argc, char **argv) /* default to showing syms and objs */ if (!state.show_dir && !state.show_obj && !state.show_sym) state.show_obj = state.show_sym = true; - if (argc == optind && !state.just_pkgname) + if (argc == optind && !state.all) qlist_usage(EXIT_FAILURE); if (state.fmt == NULL) { |