Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support -M and -m options equivalent to perl's for all ops with snippets #23

Merged
merged 5 commits into from
Dec 25, 2013

Conversation

tsibley
Copy link
Collaborator

@tsibley tsibley commented Dec 18, 2013

No description provided.

OUTPUT
App::RecordStream::Test::OperationHelper->do_match(
'xform',
['-MList::Util=reduce', '{{reduced}} = reduce { $a * $b } map { (my $tmp = $_) =~ s/\D//g; $tmp } values %$r'],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely cool with having this test here, but we should definitely add this test to Executor.t itself, or an equivalent test... I'm totally cool with this exact test over there...

@benbernard
Copy link
Owner

thanks so much for doing this, I think this is definitely a cool feature!

Just a few documentation / style comments... recs has a pretty extensive help system that we like to keep in tip top shape :)

I'm impressed you were able to find you're way all the way through the codebase, thanks for contributing!

@tsibley
Copy link
Collaborator Author

tsibley commented Dec 18, 2013

Thanks for the suggestions, I'll implement them tonight or tomorrow. I actually found a bug when I expanded the tests for -M/-m just now, so I have a fix for that too!

@benbernard
Copy link
Owner

awesome! looking forward to it!

A very useful convenience, for example:

    recs-grep -MList::MoreUtils=any -e 'any { {{Name}} eq $_ } qw(foo bar bat)'

The symantics of -M/-m match the documented behaviour in perlrun and the
produced Perl syntax.

Getopt bundling is required for -MFoo=bar to work, otherwise an error is
thrown regarding unknown option "-MFoo".

Note that, for the time being, use of -M requires explicit use of -e/-E.
List::Util is core since 5.7.3.
Executor's help is only used by xform, for now.
@tsibley
Copy link
Collaborator Author

tsibley commented Dec 18, 2013

Force pushed the branch with new and improved commits. They address your suggestions and also fix a bug with -m that I caught thanks to new tests.

benbernard added a commit that referenced this pull request Dec 25, 2013
Support -M and -m options equivalent to perl's for all ops with snippets
@benbernard benbernard merged commit 8195949 into benbernard:master Dec 25, 2013
@benbernard
Copy link
Owner

merged!

@tsibley
Copy link
Collaborator Author

tsibley commented Dec 25, 2013

Woo! Thanks!

On 12/24/2013 04:23 PM, Ben Bernard wrote:

merged!


Reply to this email directly or view it on GitHub
#23 (comment).

@tsibley tsibley deleted the dash-M branch January 16, 2014 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants