tomnomnom/qsreplace

qsreplace does not replace each parameter only once

mikedesu opened this issue · 2 comments

Perhaps I am misunderstanding how qsreplace is intended to work, but considering the description of the tool, I am receiving unexpected output. qsreplace is replacing every parameter value, not individually.

~ % cat urls.txt 
https://www.evildojo.com/index.php?q=search&name=darkmage
https://www.evildojo.com/index.php?q=search
https://www.evildojo.com/index.php
https://www.evildojo.com

~ % cat urls.txt | qsreplace d3v
https://www.evildojo.com/index.php?name=d3v&q=d3v
https://www.evildojo.com/index.php?q=d3v
https://www.evildojo.com/index.php
https://www.evildojo.com

The output I am expecting, however, is below:

https://www.evildojo.com/index.php?q=d3v
https://www.evildojo.com/index.php?q=d3v&name=darkmage
https://www.evildojo.com/index.php?q=search&name=d3v

I am releasing a tool to achieve this functionality, but I think it would be nice if this tool did it instead.

share your tool bro. Did you mean

?a=b&c=d should be results:
?a=b'&c=d
?a=b&c=d'?

Sorry I'm just now seeing this!

The tool was released in pypi as queryswap:

https://pypi.org/project/queryswap/

https://github.com/mikedesu/qs

To install:

pip3 install queryswap

To use:

echo "https://www.evildojo.com/index.php?q=a&v=b" | python3 -m qs d3v