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

Removed Syntactic Feature (-i flag for in-place file editing) #36

Open
rehsack opened this issue Jun 1, 2019 · 6 comments
Open

Removed Syntactic Feature (-i flag for in-place file editing) #36

rehsack opened this issue Jun 1, 2019 · 6 comments
Labels
rakudo Big changes to Rakudo

Comments

@rehsack
Copy link

rehsack commented Jun 1, 2019

While digging into Perl6, I try to focus on users - those who use Perl 5 for some reason meanwhile, and how to catch them.

I found Perl Is Still The Goddess For Text Manipulation nowadays and walk over it. Unfortunately, -i has been removed (see https://github.com/perl6/specs/blob/master/S19-commandline.pod), because:

  -i *extension*
   Modify files in-place. Haven't thought about it enough to add yet, but I'm certain it has a strong following. {{TODO review decision here}}

When Perl 6 is still a Perl, this is a mandatory feature.

@AlexDaniel AlexDaniel added the rakudo Big changes to Rakudo label Jun 1, 2019
@AlexDaniel
Copy link
Member

It is a frequently requested feature. I don't think there's any reason not to have, so somebody just needs to implement it.

@AlexDaniel AlexDaniel changed the title Removed Syntactic Feature Removed Syntactic Feature (-i flag for in-place file editing) Jun 1, 2019
@rehsack
Copy link
Author

rehsack commented Jun 1, 2019

@lizmat suggested some kind of Hackathon - but we might need topics ;)
This could be one of it...

@AlexDaniel
Copy link
Member

Squashathon is currently in progress (21 hours left), any contributions to rakudo count, one winner gets a plush camelia :)

Just submit a PR with the thing. However, last time I looked at it, in-place editing turned out to be a bit harder to implement than it seems.

@lizmat
Copy link
Collaborator

lizmat commented Jun 1, 2019

If we want this, I guess we need to implement this in Perl 6 logic, possibly in module space. If that works, we can hook it into the default parameter parsing if we think that is still a good idea.

@jnthn
Copy link
Contributor

jnthn commented Jun 4, 2019

I'm fine with -i being implemented and added to Rakudo; it should probably be spec'd (that is, spectests) also, as I believe other options like -n are.

@lizmat
Copy link
Collaborator

lizmat commented Jun 5, 2019

Then I suspect this is best implemented as a Perl 6 class taking the necessary parameters and producing the right output, and then hooking that into the parameter parsing logic?

@lizmat lizmat unassigned jnthn Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rakudo Big changes to Rakudo
Projects
None yet
Development

No branches or pull requests

4 participants