[pacman-dev] [PATCH] Give error message when --files will do nothing

Andrew Gregory andrew.gregory.8 at gmail.com
Mon Dec 14 16:21:51 UTC 2015


On 12/14/15 at 11:20pm, Allan McRae wrote:
> Point people towards the help when using "pacman -F" or "pacman -F foo".
> 
> Signed-off-by: Allan McRae <allan at archlinux.org>
> ---

 $ sudo ./pacman -Fy
 :: Synchronizing package databases...
  core is up to date
  extra is up to date
  community is up to date
  multilib is up to date
 error: no targets specified (use -h for help)

>  src/pacman/files.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/pacman/files.c b/src/pacman/files.c
> index fb2f997..5741e45 100644
> --- a/src/pacman/files.c
> +++ b/src/pacman/files.c
> @@ -294,7 +294,7 @@ int pacman_files(alpm_list_t *targets)
>  		}
>  	}
>  
> -	if(targets == NULL && (config->op_s_search || config->op_q_owns)) {
> +	if(targets == NULL && !config->op_q_list) {
>  		pm_printf(ALPM_LOG_ERROR, _("no targets specified (use -h for help)\n"));
>  		return 1;
>  	}
> @@ -314,6 +314,11 @@ int pacman_files(alpm_list_t *targets)
>  		return files_list(files_dbs, targets);
>  	}
>  
> +	if(targets != NULL) {
> +		pm_printf(ALPM_LOG_ERROR, _("no options specified (use -h for help)\n"));
> +		return 1;
> +	}
> +
>  	return 0;
>  }
>  
> -- 
> 2.6.4


More information about the pacman-dev mailing list