GithubHelp home page GithubHelp logo

blush's Introduction

Blush

License: MIT GoDoc Build Status Coverage Status Go Report Card Codacy Badge

With Blush, you can grep with colours, many colours!

Colored

Usage

Match Method

This method shows matches with the given input:

$ blush -b "first search" -g "second one" -g "and another one" files/paths

Any occurrence of first search will be in blue, second one and and another one are in green.

Colored

Colouring Method

With this method all texts are shown, but the matching words are coloured. You can activate this mode by providing --colour or -C argument.

Piping

Blush can also read from a pipe:

$ cat FILENAME | blush -b "print in blue" -g "in green" -g "another green"
$ cat FILENAME | blush "some text"

Colored

Arguments

+---------------+----------+------------------------------------------------+
|    Argument   | Shortcut |                     Notes                      |
+---------------+----------+------------------------------------------------+
| --colour      | -C       | Colour, don't drop anything.                   |
| N/A           | -i       | Case insensitive matching                      |
| N/A           | -R       | Recursive                                      |
| --no-colour   | N/A      | Doesn't colourize matches.                     |
| --no-color    | N/A      | Same as --no-colour                            |
| --no-filename | -h       | Suppress the prefixing of file names on output |
+---------------+----------+------------------------------------------------+

File names or paths are matched from the end. Any argument that doesn't match any files or paths are considered as regular expression. If regular expressions are not followed by colouring arguments are coloured based on previously provided colour:

$ blush -b match1 match3 FILENAME

Colored

Notes

  • If no colour is provided, blush will choose blue.
  • If you only provide file/path, it will print them out without colouring.
  • If the matcher contains only alphabets and numbers, a non-regular expression is applied to search.

Colour Groups

You can provide a number for a colour argument to create a colour group:

$ blush -b1 match1 -b2 match2 -b1 match3 FILENAME

Colored

All matches will be shown as blue. But match1 and match3 will have a different background colour than match2. This means the numbers will create colour groups.

You also can provide a colour with a series of match requests:

$ blush -r match1 match3 -g match2 FILENAME

Colored

Colours

You can choose a pre-defined colour, or pass it your own colour with a hash:

+-----------+----------+
|  Argument | Shortcut |
+-----------+----------+
| --red     | -r       |
| --green   | -g       |
| --blue    | -b       |
| --white   | -w       |
| --black   | -bl      |
| --yellow  | -yl      |
| --magenta | -mg      |
| --cyan    | -cy      |
| --#11bb22 | --#1b2   |
+-----------+----------+

Colored

Complex Grep

You must put your complex grep into quotations:

$ blush -b "^age: [0-9]+" FILENAME

Colored

Roadmap

Please see changelog document.

  • user defined colours.
  • invert match (-v).
  • config files.
  • implement all grep arguments.
  • internal pager and fuzzy search.

blush's People

Contributors

arsham avatar

Watchers

观星者 avatar

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.