Skip to content

Conversation

mknos
Copy link
Contributor

@mknos mknos commented May 17, 2024

  • The following correct usage was not accepted: "perl grep 0 file"
  • Within parse_args(), $opt{e} was initialised to 0 but that is confusing because 0 could be a pattern; instead set it to empty string
  • First check if $opt{e} and use it if not empty
  • Expect pattern to be the next ARGV element
  • Raise error via usage() only if there were no remaining ARGV elements (previously usage() was called if it was 0, i.e. false)

* The following correct usage was not accepted: "perl grep 0 file"
* Within parse_args(), $opt{e} was initialised to 0 but that is confusing because 0 could be a pattern; instead set it to empty string
* First check if $opt{e} and use it if not empty
* Expect pattern to be the next ARGV element
* Raise error via usage() only if there were no remaining ARGV elements (previously usage() was called if it was 0, i.e. false)
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: grep The grep program labels May 17, 2024
@briandfoy
Copy link
Owner

changes: the default for -e is now the empty string, and the value 0 is taken to be a valid pattern

@briandfoy briandfoy merged commit f00a886 into briandfoy:master May 22, 2024
@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever labels May 22, 2024
@briandfoy briandfoy self-assigned this May 22, 2024
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: grep The grep program Status: released there is a new release with this fix Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants