From ff1ae94c102cab487444bcdb0c76ee489c11dfe8 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Wed, 29 May 2019 23:36:34 +0100 Subject: pacman: rework the UI of -F Reworks the UI of -F according to FS#47949 In short -F replaces both -Fs and -Fo. Searching for an exact path (target contains "/"), causes the output to switch to the old -Fo output. Otherwise the old -Fs output is used. Also strip the leading "/" from targets like how -Qo does. Signed-off-by: Allan McRae --- src/pacman/pacman.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'src/pacman/pacman.c') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 3bb622e6..93fb98a4 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -177,9 +177,7 @@ static void usage(int op, const char * const myname) printf("%s:\n", str_opt); } else if(op == PM_OP_FILES) { addlist(_(" -l, --list list the files owned by the queried package\n")); - addlist(_(" -o, --owns query the package that owns \n")); addlist(_(" -q, --quiet show less information for query and search\n")); - addlist(_(" -s, --search search package file names for matching strings\n")); addlist(_(" -x, --regex enable searching using regular expressions\n")); addlist(_(" -y, --refresh download fresh package databases from the server\n" " (-yy to force a refresh even if up to date)\n")); @@ -753,18 +751,10 @@ static int parsearg_files(int opt) return 0; } switch(opt) { - case OP_OWNS: - case 'o': - config->op_q_owns = 1; - break; case OP_LIST: case 'l': config->op_q_list = 1; break; - case OP_SEARCH: - case 's': - config->op_s_search = 1; - break; case OP_REFRESH: case 'y': (config->op_s_sync)++; @@ -788,13 +778,8 @@ static int parsearg_files(int opt) static void checkargs_files(void) { - if(config->op_q_owns) { - invalid_opt(config->op_q_list, "--owns", "--list"); - invalid_opt(config->op_q_search, "--owns", "--search"); - invalid_opt(config->op_f_regex, "--owns", "--regex"); - } else if(config->op_q_list) { - invalid_opt(config->op_q_search, "--list", "--search"); - invalid_opt(config->op_f_regex, "--list", "--regex"); + if(config->op_q_search) { + invalid_opt(config->op_q_list, "--regex", "--list"); } } -- cgit v1.2.3-54-g00ecf