Skip to content

feat: allow specifying multiple transforms #66

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

Closed
wants to merge 1 commit into from
Closed

feat: allow specifying multiple transforms #66

wants to merge 1 commit into from

Conversation

kiprasmel
Copy link
Contributor

maybe would be nicer if the interface would be -t t1 -t t2 -t t3
instead of current -t t1,t2,t3 (you could separate into multiple lines
and keep it cleaner), but don't know how to do that so this works just fine.

maybe would be nicer if the interface would be `-t t1 -t t2 -t t3`
instead of current `-t t1,t2,t3` (you could separate into multiple lines
and keep it cleaner), but don't know how to do that so this works just fine.

Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
@danieldelcore
Copy link
Contributor

Hey @kiprasmel, Commanderjs actually has a way to support -t path1 path2 path3, I think that would be a nice solution for us.

https://github.com/tj/commander.js/#variadic-option

Would you like to have a crack at that?

@kiprasmel
Copy link
Contributor Author

hey @danieldelcore!

Commanderjs actually has a way to support -t path1 path2 path3

I haven't seen that. Looked thru - actually it looks a little too magical for me:D I think people are not really used to it, and myself I'd expect only the first argument to be picked up after the option -t, and wouldn't know what the other ones do (at least that's what my experience has been with other CLIs and I like that it's predictable).

I'd love if we could make the -t path1 -t -path2 -t path3 work though - do you know if there's a way to do it?

@danieldelcore
Copy link
Contributor

danieldelcore commented Nov 8, 2021

Not as far as I know, commander doesn't seem to support it anything like that. Unless it comes by default, but if that was the case i'd probably already work ahah (might be worth double-checking though). Do you know of any CLIs with this style of API? Would be interesting to see how it's done elsewhere.

I think people are not really used to it

Commander is quite nice in that it encapsulates a lot of the established CLI conventions, things like variatic options are often used in common CLIs like git, example: git cherry-pick f6bfe65325a 196321c6829.

At this point, I prefer to go with either path1 path2 path3 or path1,path2,path3. Potentially we could support both because I'm pretty sure variadic arguments can be prone to some ambiguity 😄

@kiprasmel
Copy link
Contributor Author

yeah i thought that the -t t1 -t t2 would be more common tbh, but not sure.

the git cherry-pick example - that's true, but the variadic options are for the cherry-pick command - i think it's way clearer this way, rather than for a command option e.g. if it were git cherry-pick -X --foo bar -c f6bfe65325a 196321c6829 45678986es --dir ./src, then it becomes confusing imo.

i thus think perhaps the current one -t t1,t2,t3 should be enough for now

@kiprasmel
Copy link
Contributor Author

hey @danieldelcore! you think we could merge this? we'd like to move away from having our codemods in the fork and instead utilize #58, and we kinda depend on this.

@danieldelcore
Copy link
Contributor

No worries, i have some time today! Thanks for letting me know again 😄

@danieldelcore
Copy link
Contributor

Hey @kiprasmel, I wasn't able to push to your remote so I've recreated this Pr with a changeset here: #80

Merging it now, thanks for your patience 😄

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.

2 participants