YesChief!
C++ argv parser
Loading...
Searching...
No Matches
yeschief::HelpCommand Class Referencefinal

#include <yeschief.h>

Inheritance diagram for yeschief::HelpCommand:
yeschief::Command

Public Member Functions

 HelpCommand (CLI *cli)
 
auto getDescription () const -> std::string override
 
auto getName () const -> std::string override
 
auto run (const CLIResults &results) -> int override
 
auto setup (CLI &cli) -> void override
 

Detailed Description

help command. It takes an optional parameter [command]

  • If no parameter is given, it prints the full help
  • If parameter is given, it prints help for given command name

Member Function Documentation

◆ getDescription()

auto yeschief::HelpCommand::getDescription ( ) const -> std::string
inlinenodiscardoverridevirtual
Returns
Description of the command

Reimplemented from yeschief::Command.

◆ getName()

auto yeschief::HelpCommand::getName ( ) const -> std::string
inlinenodiscardoverridevirtual
Returns
Name of the command

Implements yeschief::Command.

◆ run()

auto yeschief::HelpCommand::run ( const CLIResults & results) -> int
overridevirtual

Parse argv against configuration of the command and pass the result to this method.

This method is launched when parent CLI is run with an argv corresponding to the current command

Parameters
resultsResults of the argv parsing
Returns
Exit code of command

Implements yeschief::Command.

◆ setup()

auto yeschief::HelpCommand::setup ( CLI & cli) -> void
overridevirtual

Configure options or sub-commands of the current command.

The configuration is done with a CLI object the same way you do it with your own one

Parameters
cliThe sub CLI of the command

Reimplemented from yeschief::Command.


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