HFormatter

Inheritance diagram of hformatter

Utility class to format help text.

module:

hformatter

author:

Le Bars, Yoann

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. See file LICENSE or go to:

https://www.gnu.org/licenses/gpl-3.0.html

exception hformatter.InvalidCommandLine(message: str, *args: object)

Exception raised when the command line is invalid.

Parameters:

message (str) – Error message.

hformatter.create_parser(program_description: str, positional_name: str, optional_name: str, program_version: str, version_message: str, help_message: str, usage_message: str = 'Usage: ', default_message: str = 'default') PersonalizedArgumentParser

Generates an argument parser.

Parameters:
  • program_description (str) – String describing the aims of the program.

  • positional_name (str) – String for positional arguments title.

  • optional_name (str) – String for optional arguments title.

  • program_version (str) – String describing program version.

  • version_message (str) – String describing the version program option.

  • help_message (str) – String describing the help program option.

  • usage_message (str) – Title for usage section. Default to “Usage: ”

  • usage_message – Title for default value description. Default to “default”

Returns:

An argument parser.

Return type:

PersonalizedArgumentParser