Skip to content

Add support for variable interpolation in message strings. #526

@bobtiernay-okta

Description

@bobtiernay-okta

Similar 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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions