Arkanjo 0.2
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
cli_error.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4#include <stdexcept>
5
10class CLIError : public std::runtime_error {
11public:
12 explicit CLIError(const std::string& msg) : std::runtime_error(msg) {}
13};
14
21public:
25 OptionMissingError(const std::string& option)
26 : CLIError("Option missing: " + option) {}
27};
28
33public:
37 CommandNotFoundError(const std::string& cmd)
38 : CLIError("Unknown command: " + cmd) {}
39};
Base class for CLI-related errors.
Definition cli_error.hpp:10
CLIError(const std::string &msg)
Definition cli_error.hpp:12
An error is thrown when an unknown command is passed.
Definition cli_error.hpp:32
CommandNotFoundError(const std::string &cmd)
Definition cli_error.hpp:37
An error is thrown when a required option is not provided.
Definition cli_error.hpp:20
OptionMissingError(const std::string &option)
Definition cli_error.hpp:25