Skip to content

Help Template

clap.help.HelpTemplate module-attribute

HelpTemplate = str

Tags are given inside curly brackets.

Valid tags are:

  • {name} - Display name for the (sub-)command.
  • {version} - Version number.
  • {author} - Author information.
  • {author-with-newline} - Author followed by \n.
  • {author-section} - Author preceded and followed by \n.
  • {about} - General description (from about or long_about).
  • {about-with-newline} - About followed by \n.
  • {about-section} - About preceded and followed by \n.
  • {usage-heading} - Automatically generated usage heading.
  • {usage} - Automatically generated or given usage string.
  • {all-args} - Help for all arguments (options, flags, positional arguments, and subcommands) including titles.
  • {options} - Help for options.
  • {positionals} - Help for positional arguments.
  • {subcommands} - Help for subcommands.
  • {tab} - Standard tab size used within clap.
  • {after-help} - Help from after_help or after_long_help.
  • {before-help} - Help from before_help or before_long_help.

DEFAULT_TEMPLATE is the default help template.

clap.help.DEFAULT_TEMPLATE module-attribute

DEFAULT_TEMPLATE: HelpTemplate = "{before-help}{about-with-newline}\n{usage-heading} {usage}\n\n{all-args}{after-help}"

This is the default help template.