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

Add --replace as a command #261

Closed
wants to merge 21 commits into from
Closed

Conversation

jacobmealey
Copy link
Contributor

implement --replace as seen in #260 discussion

@jacobmealey jacobmealey changed the title a working implementation of --replace an implementation of --replace Nov 27, 2023
trurl.c Fixed Show fixed Hide fixed
@jacobmealey jacobmealey changed the title an implementation of --replace Add --replace as a command Nov 28, 2023
trurl.c Outdated Show resolved Hide resolved
trurl.1 Outdated Show resolved Hide resolved
@emanuele6
Copy link
Collaborator

emanuele6 commented Nov 28, 2023

Instead of adding a replacelist and all this extra code‚ can't this be implemented as just calls to trimadd(); appendadd() in replaceadd()?

@jacobmealey
Copy link
Contributor Author

jacobmealey commented Nov 29, 2023

I was worried about preserving the order of the other items in the list query list, if we did it with trimadd and appendadd it would always put it at the end of the query list, right? If that's not an issue then I can rework this pr this evening to do it that way because it will simplify things.

trurl.c Outdated Show resolved Hide resolved
@bagder
Copy link
Member

bagder commented Feb 6, 2024

Thanks for this work @jacobmealey.

These options are rather specific for query strings, as they are the only components in a URL that is actually a list of value pairs and therefore the only component where replace makes sense as everywhere else you can just set the component to replace it.

Based on this, I don't foresee that these options can be made to support other components than the query. If nobody else can come up with a scenario where that could happen, maybe we could streamline these a little more? For example maybe --replace foo=bar directly instead of --replace query=foo=bar ?

@jacobmealey
Copy link
Contributor Author

@bagder that makes sense, I will get started on that this weekend. It should be pretty quick so hopefully I'll have a PR by Sunday.

@jacobmealey jacobmealey requested a review from bagder February 10, 2024 15:33
@bagder bagder closed this in f969627 Feb 19, 2024
@bagder
Copy link
Member

bagder commented Feb 19, 2024

Thanks!

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.

3 participants