Add help option
This commit is contained in:
parent
6cc47ac543
commit
b9d951ec9a
|
@ -4,6 +4,11 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
void Clippy::Run(const std::vector<std::string>& args) {
|
void Clippy::Run(const std::vector<std::string>& args) {
|
||||||
|
TryExecuteClippyCommand(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Clippy::TryExecuteClippyCommand(const std::vector<std::string>& args) {
|
||||||
|
if (args.size() >= 2 && (args[1] == "help" || args[1] == "hello")) {
|
||||||
std::cout << "Hello I'm clippy" << std::endl;
|
std::cout << "Hello I'm clippy" << std::endl;
|
||||||
std::cout << "Parametres: { ";
|
std::cout << "Parametres: { ";
|
||||||
for (size_t i = 0; i < args.size(); ++i) {
|
for (size_t i = 0; i < args.size(); ++i) {
|
||||||
|
@ -11,3 +16,6 @@ void Clippy::Run(const std::vector<std::string>& args) {
|
||||||
}
|
}
|
||||||
std::cout << "}" << std::endl;
|
std::cout << "}" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
@ -8,4 +8,5 @@ class Clippy {
|
||||||
void Run(const std::vector<std::string>& args);
|
void Run(const std::vector<std::string>& args);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool TryExecuteClippyCommand(const std::vector<std::string>& args);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue