curl / trurl

trurl is a command line tool for URL parsing and manipulation.
https://curl.se/trurl/
Other
3.1k stars 99 forks source link

bug where --iterate causes --append to be duplicated for each iteration #299

Closed jacobmealey closed 3 months ago

jacobmealey commented 3 months ago

The appended items are re-appended every iteration of a --iterate. I found this bug when I was working on #263, but i did more testing on 0.12.

two examples:

$ trurl example.com --append "path=folder" --iterate "scheme=http ssh ftp"
http://example.com/folder
ssh://example.com/folder/folder
ftp://example.com/folder/folder/folder
$ trurl example.com --append "query=foo=bar" --iterate "scheme=http ssh ftp"
http://example.com/?foo=bar
ssh://example.com/?foo=bar&foo=bar
ftp://example.com/?foo=bar&foo=bar&foo=bar
bagder commented 3 months ago

@jacobmealey do you want to work on fixing this or do you want me to have a look?

jacobmealey commented 3 months ago

I'm working on getting the JSON input ready for a PR within the next couple of days, I can take a look once the PR is up and waiting for feedback.

however, if you (or someone else) wants to get this fixed up ASAP then by all means go ahead.

bagder commented 3 months ago

I'll grab it