Skip to content

Strange behaviour when search string begins with + character #378

@epa

Description

@epa

I want to search for the literal string +1 but the obvious command line does something strange:

% ack -Q '+1'
ack: No regular expression found.

I can reproduce this also with current dev branch.

I believe it's caused by Getopt::Long, which by default accepts the obsolete + prefix for long options as an alternative to --. (Some GNU utilities used to accept the + form but moved to -- in the early 1990s.)

It should be possible to say

use Getopt::Long qw(:config prefix_pattern=--? );

or alternatively

Getopt::Long::Configure('prefix_pattern=--?')

but because of the way the code calls that module I wasn't successful in creating a patch. Could you have a look please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions