[ 
https://issues.apache.org/jira/browse/KARAF-4273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15202363#comment-15202363
 ] 

ASF GitHub Bot commented on KARAF-4273:
---------------------------------------

GitHub user avdyk opened a pull request:

    https://github.com/apache/karaf/pull/165

    KARAF-4273 Add only matching option to grep

    o GrepAction:
      - add only matching option to grep
      - refactor GrepAction
      - change with-line-numbers behaviour (more like the unix grep)
    o GrepTest:
      - add grep tests
      - test class does not implement TestCase anymore
      - add tests for GrepAction onlyMatching
      - ignore testGrepWordRegExpWithColour: 'word' (\b) does not work like
        unix grep... don't know if it's a bug or not...
      - remove last linefeed in test result

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/avdyk/karaf KARAF-4273_grep-o

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/karaf/pull/165.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #165
    
----
commit f71b8f5bedd3baca8aaa3390f00fcd1f8b21e6ed
Author: avandyck <[email protected]>
Date:   2016-02-15T10:24:28Z

    KARAF-4273 Add only matching option to grep
    
    o GrepAction:
      - add only matching option to grep
      - refactor GrepAction
      - change with-line-numbers behaviour (more like the unix grep)
    o GrepTest:
      - add grep tests
      - test class does not implement TestCase anymore
      - add tests for GrepAction onlyMatching
      - ignore testGrepWordRegExpWithColour: 'word' (\b) does not work like
        unix grep... don't know if it's a bug or not...
      - remove last linefeed in test result

----


> Add -o (--only-matching) option to grep command
> -----------------------------------------------
>
>                 Key: KARAF-4273
>                 URL: https://issues.apache.org/jira/browse/KARAF-4273
>             Project: Karaf
>          Issue Type: Improvement
>          Components: karaf-shell
>    Affects Versions: 4.0.4
>            Reporter: Roland Hauser
>            Assignee: Andrea Cosentino
>
> It would be helpful for scripting if the built-in grep command had an -o 
> option like the Unix counterpart. The -o option should cause grep to print 
> only the matching section of a line, not the whole line itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to