YesChief!
C++ argv parser
Loading...
Searching...
No Matches
yeschief::Command Class Referenceabstract

#include <yeschief.h>

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

Public Member Functions

virtual auto getDescription () const -> std::string
 
virtual auto getName () const -> std::string=0
 
virtual auto run (const CLIResults &results) -> int=0
 
virtual auto setup (CLI &cli) -> void
 

Detailed Description

A command that can be executed

Member Function Documentation

◆ getDescription()

virtual auto yeschief::Command::getDescription ( ) const -> std::string
inlinenodiscardvirtual
Returns
Description of the command

Reimplemented in yeschief::HelpCommand.

◆ getName()

virtual auto yeschief::Command::getName ( ) const -> std::string
nodiscardpure virtual
Returns
Name of the command

Implemented in yeschief::HelpCommand.

◆ run()

virtual auto yeschief::Command::run ( const CLIResults & results) -> int
pure virtual

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

Implemented in yeschief::HelpCommand.

◆ setup()

virtual auto yeschief::Command::setup ( CLI & cli) -> void
inlinevirtual

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 in yeschief::HelpCommand.


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