Skip to main content

program_text

Function program_text 

Source
pub fn program_text<'a>(text: &'a str, prog: &str, module: &str) -> Cow<'a, str>
Expand description

A usage, help or error text of the command line of module (e.g. "subset"), which names the program prog as fontTools does (e.g. "fonttools subset", or an argparse prog such as "cu2qu"), adapted to the program name set by with_program_name: the program becomes "<name> <module>". Without a program name, the text is returned unchanged.

A prog of the form fonttools <module> is replaced wherever it appears as a word, including the examples of the help. Another prog is only replaced where it names the program for argparse: after usage: at the start of a line, and before : error: at the start of a line. The continuation lines of a usage are indented to keep them aligned.