RADSex  1.0.0
RAD-Sequencing analysis pipeline for sex determination
CustomFormatter Class Reference

Custom CLI11 Formatter. More...

#include <arg_parser.h>

Inheritance diagram for CustomFormatter:

Public Member Functions

virtual std::string make_option (const CLI::Option *opt, const bool is_positional) const
 Format help message for an option. More...
 
virtual std::string make_description (const CLI::App *) const
 Format command description. More...
 
void set_column_widths (const CLI::App &parser)
 Set column widths in help message for a CLI::App. More...
 

Public Attributes

uint column_widths [3] {0, 0, 0}
 Maximum width of each column, in order: flags, type, description.
 
uint border_width = 4
 Define number of spaces between two columns.
 

Detailed Description

Custom CLI11 Formatter.

This class is used to override default help message format in CLI11 Formatter.

Definition at line 73 of file arg_parser.h.

Member Function Documentation

◆ make_description()

virtual std::string CustomFormatter::make_description ( const CLI::App *  ) const
inlinevirtual

Format command description.

Remove command description in CLI help message.

Returns
An empty string

Definition at line 135 of file arg_parser.h.

◆ make_option()

virtual std::string CustomFormatter::make_option ( const CLI::Option *  opt,
const bool  is_positional 
) const
inlinevirtual

Format help message for an option.

Generate a nicely formatted help message for an option, using column widths to align columns for all options properly.

Parameters
optPointer to an CLI::Option instance
is_positionalBoolean indicating whether the option is positional
Returns
A string containing the formatted help message for the option

Definition at line 93 of file arg_parser.h.

◆ set_column_widths()

void CustomFormatter::set_column_widths ( const CLI::App &  parser)
inline

Set column widths in help message for a CLI::App.

Determine column widths from the maximum element length in each column

Parameters
parserPointer to a CLI::App instance

Definition at line 149 of file arg_parser.h.


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