I have a LaTeX document using the listings package for some bash scripts. I'd like to create a different styling for text that is meant to show the syntax of a command. For instance, I have the following command in a bash-styles listing:

However, I'd like to style this differently to a command that is actually entered into a terminal, since it is not a real command but just showing the syntax to be used. Is there a default styling for such a thing. Perhaps following:

Note the following conventions in the definition of the command parameters:

Angle brackets ( < > ) indicate a mandatory parameter.
Square brackets ( [ ] ) indicate an optional parameter. If you omit the parameter, InfoSphere CDC uses a default value.
A vertical bar ( | ) separating one or more parameters indicate that only one of the parameters in the list can be used. When one or more vertical bars appear in a list of parameters that is enclosed by square brackets [ ], the choices are limited to the parameters in the list, but you have the option to not specify any of the parameters.
Ellipsis ( ... ) means that a parameter or option can be repeated more than once.
Unless otherwise noted, the commands apply to all operating systems.

1 Answer
1

The options in the scope of the | have to be delimited some way, in this example I have used the colon : as a delimiter. It does not show on the output because the option [is] in the definition (i stands for invisible).

I'm not sure that the ellipsis works as you are expecting (currently it is just highlighted in magenta).

If you want to combine this kind of hihglighting with the bash highlighting already provided by lstlistings, I have added some code as an example.