Add support for variable interpolation in message strings.
See original GitHub issueSimilar in spirit to ${DEFAULT-VALUE}
and ${COMPLETION-CANDIDATES}
, it would be very useful to allow a set of variables to be registered that could then be used in message strings.
For example, currently I need to do this on my command methods in a hierarchy:
@Override
@Command(description = "Tails the " + App.SERVICE + " docker logs")
public Status logs() {
return super.logs();
}
what would be nicer is:
@Command(description = "Tails the ${PARENT-COMMAND-NAME} docker logs")
public Status logs() {
// ...
}
This would allow inheritance chains to allow for encapsulating command methods in the base class and thus the need to override just to change the variable value statically.
It would be nice to have some predefined variables for common things like parent command name and current command name, as well as the ability to generalize to support this use case and others.
Issue Analytics
- State:
- Created 5 years ago
- Comments:25 (25 by maintainers)
Top Results From Across the Web
string interpolation - format string output - Microsoft Learn
To concatenate multiple interpolated strings, add the $ special character to each string literal. The expression that produces a result to be ...
Read more >String Interpolation in JavaScript - Dmitri Pavlutin
String interpolation is replacing placeholders with values in a string literal. The string interpolation in JavaScript is performed by ...
Read more >Java Program to Illustrate String Interpolation - GeeksforGeeks
String Interpolation is a process in which the placeholder characters are replaced with the variables (or strings in this case) which allow ...
Read more >String Interpolation in Java | Baeldung
String interpolation is a straightforward and precise way to inject variable values into a string. It allows users to embed variable ...
Read more >Add support for variables in plugins | Grafana documentation
Grafana provides a couple of helper functions to interpolate variables in a string template. Let's see how you can use them in your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
See draft release notes for details.
Very nice work on this, and much appreciated! Will be certain to give feedback as time affords.