haarg/wgdev

Suggestion: Added command -- Batchedit

Opened this issue · 5 comments

I've written and tested an additional command -- Batchedit.

Batchedit is like Edit, only it is suitable for use in a shell script / batch file for when you need to change a lot of content at once.

Usage is like:
wgd batchedit
'--pattern=.META.http.equiv..Pragma..content..no.cache..'
'--string='
home

--pattern is the pattern you want to match. Please note that the pattern match will use the modifiers 'xms'.

--string is the replacement string.

Like Edit, it will take either a URL or an assetId.

wgd with Batchedit passes the 'dzil test' tests and builds with 'dzil build'.

Given this, what should be my next step?

The current edit command allows you to specify --command, and that could be used to run a perl oneliner to do something similar to this. However, having this as dedicated option does make sense to me. Having either a separate command like you've implemented it, or possibly just additional parameters to the edit command would work.

Aside from that though, the best thing to do is create a fork of this repo and commit and push your change to it. Then either create a push request or just post about it on this issue and I can pick up the changes and push out a new version.

(Assuming that I did everything correctly..) I've pushed my fork out to https://github.com/pbmarklf/wgdev.

Your git author configuration isn't set up correctly, so the attribution is listed as '--global'. You should fix that:
$ git config --global user.name "Mark Leighton Fisher"
$ git config --global user.email "mark@plainblack.com"

I'm going to pull this in and fix the attribution myself, since that's probably easier.

Thanks.

Sorry for the broken author configuration -- I tried about 3 different times, and thought I had fixed it correctly the 3rd time. Oh well, I guess the 4th times' the charm...

FYI -- wgdev/.git/config was wrong from my earlier tries, and finally getting user.name & user.email right in ~/.gitconfig did not update wgdev/.git/config. Now both are OK after manually editing wgdev/.git/config.