Skip to content

Package io.github.qishr.cascara.common.util

Interface IParamLabelRenderer

java.lang.Object
        io.github.qishr.cascara.common.util.CommandLine.Help.IParamLabelRenderer

Enclosing Class:
    io.github.qishr.cascara.common.util.CommandLine.Help


public static interface IParamLabelRenderer

When customizing online usage help for an option parameter or a positional parameter, a custom IParamLabelRenderer can be used to render the parameter name or label to a String.

Method Summary

Modifier and Type Method Description
public abstract Text renderParameterLabel(ArgSpec argSpec, Ansi ansi, List<IStyle> styles) Returns a text rendering of the option parameter or positional parameter; returns an empty string "" if the option is a boolean and does not take a parameter.
public abstract String separator() Returns the separator between option name and param label.

Method Details

renderParameterLabel

public abstract Text renderParameterLabel(ArgSpec argSpec, Ansi ansi, List<IStyle> styles)

Returns a text rendering of the option parameter or positional parameter; returns an empty string "" if the option is a boolean and does not take a parameter.

Parameters:

argSpec - the named or positional parameter with a parameter label

ansi - determines whether ANSI escape codes should be emitted or not

styles - the styles to apply to the parameter label

Returns:

a text rendering of the Option parameter or positional parameter

Since:

3.0


separator

public abstract String separator()

Returns the separator between option name and param label.

Returns:

the separator between option name and param label