Arkanjo 0.2
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
command.hpp
Go to the documentation of this file.
1#pragma once
4
11class ICommand {
12
13 public:
14 virtual ~ICommand() = default;
15
16 virtual const CliOption* options() const = 0;
17 virtual std::string_view description() const = 0;
18
29 virtual bool validate(const ParsedOptions& options) = 0;
30
41 virtual bool run(const ParsedOptions& options) = 0;
42 virtual bool do_run(const std::string command_name, const ParsedOptions& options, const OptionsCollector* collector = nullptr) = 0;
43};
Basic interface for all CLI commands.
Definition command.hpp:11
virtual bool run(const ParsedOptions &options)=0
Executes the main logic of the command.
virtual bool validate(const ParsedOptions &options)=0
Validate the arguments already analyzed.
virtual ~ICommand()=default
virtual bool do_run(const std::string command_name, const ParsedOptions &options, const OptionsCollector *collector=nullptr)=0
virtual const CliOption * options() const =0
virtual std::string_view description() const =0