Skip to main content

Module cli_tools

Module cli_tools 

Source
Expand description

Port of fontTools.misc.cliTools: utilities for command-line interfaces.

Also holds the program name of the command lines (with_program_name, program_text), with which the fontoxide executable names itself in their usage and help texts.

Functions§

make_output_file_name
makeOutputFileName: a file name to write the output for an input file to, with the directory replaced by output_dir, suffix added to the name, and the extension replaced by extension. Without over_write, a number is added to avoid overwriting a file.
program_name
The name of the program running the command lines, when it is not fontTools’ (see with_program_name).
program_text
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.
with_program_name
Runs f with the command lines naming themselves <name> <module> in their usage and help texts (see program_text), on this thread. This is how the fontoxide executable runs a module; by default, the texts are fontTools’.