Skip to content

[bugs] zstdgrep/grep inconsistencies - #2095

Merged
bimbashrestha merged 3 commits into
meta:devfrom
bimbashrestha:grep
May 6, 2020
Merged

bimbashrestha merged 3 commits into
meta:devfrom
bimbashrestha:grep

Conversation

@bimbashrestha

@bimbashrestha bimbashrestha commented Apr 28, 2020 •

Copy link
Copy Markdown
Contributor

Fixing zstdgrep inconsistencies listed on #2064

See each commit message for details

  • Fix multiple -e
  • Fix pipe in with -f
  • Fix "incorrect parameters" output on regexp
  • Don't show filename on single file (ie: no to /tmp/file:start and yes to start <- grep does this)
  • Fixing --regexp giving lots of irelevant complaints

@Cyan4973

Copy link
Copy Markdown
Contributor

Could we add some test case for this new capability ?

@bimbashrestha

Copy link
Copy Markdown
Contributor Author

FreeBSD failed saying it can't find zstdcat? I'm going to re-run it just to make sure it's not just being strange

@bimbashrestha

Copy link
Copy Markdown
Contributor Author

Nope, that's a real error:(

Comment thread tests/playTests.sh Resolved
@Cyan4973

Copy link
Copy Markdown
Contributor

One may need to setup a local FreeBSD VM to reproduce the issue and better diagnose it.

@bimbashrestha

Copy link
Copy Markdown
Contributor Author

One may need to setup a local FreeBSD VM to reproduce the issue and better diagnose it.

I'll try that quick guess fix first. If that doesn't work, I'll setup of a local VM:/

@bimbashrestha
bimbashrestha force-pushed the grep branch 2 times, most recently from ed1645b to 7b0d267 Compare April 29, 2020 19:57
@bimbashrestha

Copy link
Copy Markdown
Contributor Author

Okay that seemed to fix it. It was just a matter of adding ZCAT= in front. I'm going to include some other fixes from that issue in this PR too

@bimbashrestha bimbashrestha changed the title [bug] zstdgrep allow for multiple -e like in real grep [bugs] zstdgrep/grep inconsistencies Apr 29, 2020
@bimbashrestha

Copy link
Copy Markdown
Contributor Author

I tested zstdgrep on the list from the issue and these changes take care of everything but the bash stuff at the end. These:

# Process substitutions with bash not working as with grep on its own

$ cp  /tmp/file /tmp/file2
$ grep --file=<( echo start ) /tmp/file /tmp/file2
/tmp/file:start
/tmp/file2:start
$ grep -f <( echo start ) /tmp/file /tmp/file2
/tmp/file:start
/tmp/file2:start
$ zstdgrep --file=<( echo start ) /tmp/file /tmp/file2
/tmp/file:start
/tmp/file2:start
$ zstdgrep -f <( echo start ) /tmp/file /tmp/file2
/tmp/file:start

@bimbashrestha
bimbashrestha requested a review from Cyan4973 April 29, 2020 21:08
@bimbashrestha
bimbashrestha force-pushed the grep branch 2 times, most recently from 14f86b2 to 1b6d39b Compare May 1, 2020 14:26
@bimbashrestha

Copy link
Copy Markdown
Contributor Author

Okay, I think this is ready to merge. The only unsupported functionality are the the bash commands listed at the end of that issue but it looks like zgrep produces strange results for those too (so I don't think its worth trying to fix them for zstdgrep).

@Cyan4973

Cyan4973 commented May 5, 2020

Copy link
Copy Markdown
Contributor

Could we add a few tests showing off the new capabilities ?

@bimbashrestha

Copy link
Copy Markdown
Contributor Author

Ah it looks like I deleted the changes to playTests when I force pushed. Yes. I"ll add those back

@Cyan4973

Cyan4973 commented May 6, 2020

Copy link
Copy Markdown
Contributor

Looks good to me !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants