-
Notifications
You must be signed in to change notification settings - Fork 78
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 port command #52
Add port command #52
Conversation
@LarsKumbier Thanks for your contribution. It's published on npm as |
Thanks for this feature. Do you agree? Should I raise a PR? |
@stefanmeschke Makes sense to me. @LarsKumbier Would this break something for you aside from only getting the port? |
@AlexZeitler usually I believe we do not "enhance" original After all, all you need to do to read the port from the output would then be as simple as const output = "0.0.0.0:2181"
const pos = output.indexOf(":")
const port = output.slice(pos + 1) |
yeah, but it get's more complicated with ipv6, error-messages of docker-compose, docker not reachable for whatever reason... string-parsing is just one of the things that is bound to break somewhen. I think it would be a good addition to get a more structured output in this package to any of the commands, because everyone using this will currently write the same code to do the same things. For this specific command, an output like this would be more appropriate:
So yeah, I'd like to see a generally changed output format like this:
|
@LarsKumbier That's exactly what I had in mind after reading the response from @Steveb-p. I think we should embrace this for each command/result. We should use
|
I really like the idea of
To be backward compatible it could be something like this:
|
Yes. @stefanmeschke Please create a new issue and copy your suggestion and your last answer from here as a starting point to it. Also please refer to this PR so we have everything tracked. We should also define what |
@stefanmeschke when output was not an address & port, what did you receive? @AlexZeitler @stefanmeschke democratically I'm outvoted I guess :) and I do see the merit of what you want to do. Can we open a new issue so we can check each and every call to |
Adds the port command, closes #51