New grep impl

Project:JNode Shell
Component:Code
Category:feature request
Priority:normal
Assigned:cluster
Status:closed
Description

This is an initial rewrite of the grep command. It still has a couple of things missing, but for the most part it should be close to the posix grep specs. I've tested most of the options and nothing seems totally broken.

Things that are still missing.

- grep-style regex isnt supported yet. Need to rewrite grep-style regex to java/perl regex.
- outputting context lines isnt supported. Need to implement line buffering for this.
commit a7dfab627e573776c95fbcbb748a3a1a15155144
Author: Chris <chris.boertien@gmail.com&gtl
Date:   Sun Apr 12 06:27:54 2009 -0600

    Rewrote grep to a mostly posix-compatible version.
    
    Includes all the major features of gnu grep. Missing a couple
    of features that will be implemented soon.
    
    Signed-off-by: Chris <chris.boertien@gmail.com>

 shell/descriptors/org.jnode.shell.command.xml      |   63 ++-
 .../shell/org/jnode/shell/command/GrepCommand.java |  874 +++++++++++++++++++-
 2 files changed, 895 insertions(+), 42 deletions(-)
AttachmentSize
grep-1.patch44.88 KB

#1

Can I make a suggestion.

When you create create or significantly extend commands, please consider creating "black box" regression tests for them. For example test specifications, look for "*.xml" file in the Shell test source tree.

#2

Noted, i'll look into it when i get a chance.

#3

I had a quick look through the patch. Impressive. If it passes 'checkstyle' and doesn't have any javadoc errors or warnings, I'd say it is good to commit.

#4

You've committed this, so can we close the issue?

#5

Status:patch (comments requested)» closed