Skip to content

colorizing is worse than non-colored #17

@do11

Description

@do11

Thanks for coccigrep! But, first time I see program which have colored output worse than non-colored. For example

linux/fs/ext4$ coccigrep  -t 'struct posix_acl' -a a_entries -c .
./acl.c: l.45 -0, l.45 +0, struct posix_acl *acl
                acl->a_entries[n].e_tag  = le16_to_cpu(entry->e_tag);
./acl.c: l.46 -0, l.46 +0, struct posix_acl *acl
                acl->a_entries[n].e_perm = le16_to_cpu(entry->e_perm);
...

Text struct is highlighted with bright green which distracts attention on every line from grep match to context column. Same search w/o colors is much easier to see:

./acl.c:45 (struct posix_acl *acl):             acl->a_entries[n].e_tag  = le16_to_cpu(entry->e_tag);
./acl.c:46 (struct posix_acl *acl):             acl->a_entries[n].e_perm = le16_to_cpu(entry->e_perm);
./acl.c:48 (struct posix_acl *acl):             switch (acl->a_entries[n].e_tag) {
./acl.c:61 (struct posix_acl *acl):                     acl->a_entries[n].e_uid =
./acl.c:69 (struct posix_acl *acl):                     acl->a_entries[n].e_gid =
./acl.c:105 (struct posix_acl *acl):            const struct posix_acl_entry *acl_e = &acl->a_entries[n];

But, it would benefit from colors. Can you make it by default to color just match text, like gnu grep do, and do not split lines into two? Also, why suddenly l.45 -0, l.45 +0 instead of just :45.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions