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

Switch from native flags to posix flags #111

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

andrewbenton
Copy link

This is beneficial because it makes grpcurl more like curl. Many more
flags are now common between grpcurl and curl which will help users that
are new to the tool.

This is beneficial because it makes grpcurl more like curl.  Many more
flags are now common between grpcurl and curl which will help users that
are new to the tool.
@jhump
Copy link
Contributor

jhump commented Aug 9, 2019

@andrewbenton, does this require long flag names to use two dashes and only allows short flag names with a single dash? If so, this is not backwards-compatible and will be a serious breaking change for anyone that has scripts that reference this tool.

I know the flag-handling is awkward due to the standard Go flag package, but I don't want to replace it with something that won't be backwards-compatible. My personal preference is just to swap for an implementation that allows flag aliases (e.g. multiple names for the same flag -- to support and short and long names) and that allows the arguments to be mixed in with flags, vs. having to come at the end. That would likely make it "close enough" to curl, but also preserve backwards-compatibility, especially since the existing flag support allows either one or two dashes for each flag. So users that were used to two dashes for long names and one dash for short names could still be accommodated.

@andrewbenton
Copy link
Author

There might be some other library that's able to accept the single dash as well as the double dashed form of the argument. I'll have to see what I can find. Under posix flags, something like -proto is actually treated as all of the single letter flags p, r, o, t, and o again. Given that, we need a library that isn't posix flags if we want to keep that backward compatibility.

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