Skip to content

Conversation

@mitar
Copy link
Contributor

@mitar mitar commented Dec 2, 2021

Fixes #246.

@alecthomas
Copy link
Owner

Thanks for the PR, but I think this change is too specific to this one problem. I think what I'd prefer, if you're willing to iterate, would be a new field OrigHelp which is just the original un-interpolated help string, and make the interpolateHasVar() function public for reuse as HasInterpolatedVar(). This will be general purpose enough so that the fields can be reused in the future for different purposes, while still fixing this issue.

@mitar
Copy link
Contributor Author

mitar commented Dec 4, 2021

Sounds good.

@mitar
Copy link
Contributor Author

mitar commented Dec 4, 2021

One quick question, does interpolation allow me to obtain string like ${env} after interpolation? I think $${env} should be interpolated into ${env}, yes?

@alecthomas
Copy link
Owner

Kong doesn't currently support escaping $, which is a bit of an issue, so I think that $$ could/should be the escaping system, yeah.

@mitar
Copy link
Contributor Author

mitar commented Dec 4, 2021

I see. Because reading README makes me think that it supports escaping, given that it is written Kong will append ($$${env}) to the help string. I will open an issue to track this.

@mitar
Copy link
Contributor Author

mitar commented Dec 4, 2021

Made: #248

@mitar
Copy link
Contributor Author

mitar commented Dec 4, 2021

Updated it as requested.

@alecthomas alecthomas merged commit deebf0b into alecthomas:master Dec 4, 2021
@alecthomas
Copy link
Owner

Thanks!

@mitar mitar deleted the env-in-help branch December 4, 2021 20:22
@mitar
Copy link
Contributor Author

mitar commented Dec 4, 2021

Superb!

Care to make a release with those recent fixes?

And, BTW, I really love this package. It is really smooth. Thank you for it!

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.

Default help formatter appends environment variable even when ${env} is inside the help string

2 participants