Porytiles
Loading...
Searching...
No Matches
porytiles::PorytilesFormatter Class Reference

Custom CLI11 formatter for cleaner help output. More...

#include <custom_formatter.hpp>

Inheritance diagram for porytiles::PorytilesFormatter:
[legend]
Collaboration diagram for porytiles::PorytilesFormatter:
[legend]

Public Member Functions

 PorytilesFormatter ()
 
std::string make_group (std::string group, bool is_positional, std::vector< const CLI::Option * > opts) const override
 Override to customize option group headers.
 
std::string make_expanded (const CLI::App *sub, CLI::AppFormatMode mode) const override
 Override to handle option groups (inline subcommands) with clean headers.
 
std::string make_option_opts (const CLI::Option *opt) const override
 Override to strip verbose transformer descriptions from type names.
 

Detailed Description

Custom CLI11 formatter for cleaner help output.

This formatter customizes CLI11's default help output by:

  • Hiding verbose type labels (REQUIRED, TEXT, INT, etc.)
  • Using clean option group headers without "[Option Group: ...]" prefix
  • Stripping verbose transformer descriptions from enum type names
  • Adjusting column width for better alignment

Definition at line 23 of file custom_formatter.hpp.

Constructor & Destructor Documentation

◆ PorytilesFormatter()

porytiles::PorytilesFormatter::PorytilesFormatter ( )
inline

Definition at line 25 of file custom_formatter.hpp.

Member Function Documentation

◆ make_expanded()

std::string porytiles::PorytilesFormatter::make_expanded ( const CLI::App *  sub,
CLI::AppFormatMode  mode 
) const
inlineoverride

Override to handle option groups (inline subcommands) with clean headers.

CLI11 renders option groups as expanded subcommands. This override provides a cleaner format that doesn't use "[Option Group: ...]" style headers. It also filters out the help flag to avoid duplication and outputs options directly without intermediate group headers.

Definition at line 71 of file custom_formatter.hpp.

◆ make_group()

std::string porytiles::PorytilesFormatter::make_group ( std::string  group,
bool  is_positional,
std::vector< const CLI::Option * >  opts 
) const
inlineoverride

Override to customize option group headers.

Removes the "[Option Group: ...]" prefix and uses a clean "GroupName:" format.

Definition at line 44 of file custom_formatter.hpp.

◆ make_option_opts()

std::string porytiles::PorytilesFormatter::make_option_opts ( const CLI::Option *  opt) const
inlineoverride

Override to strip verbose transformer descriptions from type names.

CLI11's CheckedTransformer appends verbose descriptions like ":value in {locked->locked,...} OR {locked,...}" after the type name. This override strips everything after the first colon to show just the clean type name like "{locked|patch|optimize}".

Definition at line 128 of file custom_formatter.hpp.


The documentation for this class was generated from the following file: