Git Product home page Git Product logo

Comments (6)

regit avatar regit commented on August 22, 2024

Just pushed a branch adding the -g option like --grep: https://github.com/regit/coccigrep/tree/grep

It gives the following result:

screenshot from 2018-03-21 17-36-20

Can you give it a try ? (sudo python setup.py install from the branch should do the trick)

from coccigrep.

do11 avatar do11 commented on August 22, 2024

Thanks! This is much better. I think additional option is not needed, just show output in this mode if context is 0 lines. Also, pls, highlight -a argument (which is a_entries in our example) in red, while remain highlighting acl in green (this is useful).

from coccigrep.

do11 avatar do11 commented on August 22, 2024

Additional thought: if you choose rule to highlight both -t and -a (better in different colors but not necessarily), in that case text (struct posix_acl *acl) is not needed, as we always would see acl (as different from -a string) and understand it's type match. Thus a lot of screen output could be saved from clobbering with similar text. This would warrant -g option if you don't want to change default formatting.

ps. (Not too important feature requests.) If you want to make it more similar to gnu grep - line numbers not needed by default, in grep they are enabled with -n option. And in addition to -C n grep allows shortcut -n.

from coccigrep.

regit avatar regit commented on August 22, 2024

Just pushed that to master:

screenshot from 2018-03-21 22-24-52

@do11 Could you test it ?

from coccigrep.

do11 avatar do11 commented on August 22, 2024

It works nice. Thanks much!

ps. Ah. Except, in just -t mode, when symbol is already highlighted its second entry on the line is not highlighted.
coccigrep-22-03-2018 0-42-59

from coccigrep.

regit avatar regit commented on August 22, 2024

Good catch.

from coccigrep.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.