[pacman-dev] [PATCH 1/2] Make folders appear in bold when listing files owned by a package.
Allan McRae
allan at archlinux.org
Wed Nov 6 23:38:50 EST 2013
On 07/11/13 11:07, Bill Kolokithas wrote:
> It's a trivial patch to make folders stand out more when -l is passed on Query without the -q(uiet) flag.
> Right now is using the same color as the pkgname (config->colstr.title), which is bold.
>
> Signed-off-by: Bill Kolokithas <kolokithas.b at gmail.com>
Why would you want the directories highlighted? This seems one of the
least important pieces of information about what is in a package.
> ---
> src/pacman/package.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/src/pacman/package.c b/src/pacman/package.c
> index 78bfb50..1485889 100644
> --- a/src/pacman/package.c
> +++ b/src/pacman/package.c
> @@ -322,6 +322,11 @@ void dump_pkg_files(alpm_pkg_t *pkg, int quiet)
> */
> if(!quiet) {
> printf("%s%s%s ", config->colstr.title, pkgname, config->colstr.nocolor);
> + /* Make folders appear in bold */
> + if (file->name[strlen(file->name) - 1] == '/') {
> + printf("%s%s%s%s\n", config->colstr.title, root, file->name, config->colstr.nocolor);
> + continue;
> + }
> }
> printf("%s%s\n", root, file->name);
> }
>
More information about the pacman-dev
mailing list