Comments (6)
Just pushed a branch adding the -g
option like --grep
: https://github.com/regit/coccigrep/tree/grep
It gives the following result:
Can you give it a try ? (sudo python setup.py install
from the branch should do the trick)
from coccigrep.
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.
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.
Just pushed that to master:
@do11 Could you test it ?
from coccigrep.
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.
from coccigrep.
Good catch.
from coccigrep.
Related Issues (10)
- coccigrep does not output results HOT 3
- Macro expansion
- No results for big projects? HOT 5
- Only outputs if -p >= 2 HOT 1
- No output for nested types usage? HOT 7
- Macros can cause coccigrep to not find some items
- Missing matches for struct initalizations
- Strange mismatch HOT 5
- get_spatch_version issue HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coccigrep.