Arkanjo 0.2
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
ICommand Class Referenceabstract

Basic interface for all CLI commands. More...

#include <command.hpp>

+ Inheritance diagram for ICommand:

Public Member Functions

virtual ~ICommand ()=default
 
virtual const CliOptionoptions () const =0
 
virtual std::string_view description () const =0
 
virtual bool validate (const ParsedOptions &options)=0
 Validate the arguments already analyzed.
 
virtual bool run (const ParsedOptions &options)=0
 Executes the main logic of the command.
 
virtual bool do_run (const std::string command_name, const ParsedOptions &options, const OptionsCollector *collector=nullptr)=0
 

Detailed Description

Basic interface for all CLI commands.

The ICommand interface defines the minimum structure that a command must implement to be executed by the command-line system.

Definition at line 11 of file command.hpp.

Constructor & Destructor Documentation

◆ ~ICommand()

virtual ICommand::~ICommand ( )
virtualdefault

Member Function Documentation

◆ description()

virtual std::string_view ICommand::description ( ) const
pure virtual

◆ do_run()

◆ options()

◆ run()

virtual bool ICommand::run ( const ParsedOptions & options)
pure virtual

Executes the main logic of the command.

You must use the validated arguments to perform the action desired by the command.

Parameters
optionsThe ParsedOptions structure will be populated with the arguments.
Returns
True if the execution is successful, false if an error occurs.

Implemented in BigCloneFormater, BigCloneTailorEvaluator, CounterDuplicationCode, Help, PreprocessorBuild, PreprocessorList, RandomSelector, SimilarFunctionFinder, and SimilarityExplorer.

◆ validate()

virtual bool ICommand::validate ( const ParsedOptions & options)
pure virtual

Validate the arguments already analyzed.

Verify that all required options have been selected and that the values ​​provided are valid.

Parameters
optionsThe ParsedOptions structure will be populated with the arguments.
Returns
True if the arguments are valid, false otherwise.

Implemented in BigCloneFormater, BigCloneTailorEvaluator, CounterDuplicationCode, Help, PreprocessorBuild, PreprocessorList, RandomSelector, SimilarFunctionFinder, and SimilarityExplorer.


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