ChainCLI
A modern C++20 command-line interface library
Loading...
Searching...
No Matches
docs_exception.h
1/*
2 * Copyright 2025 Dominik Czekai
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18#include <stdexcept>
19#include <string>
20#include <format>
21#include "commands/command.h"
22
23namespace cli::commands::docwriting
24{
26class DocsNotBuildException : public std::runtime_error
27{
28public:
32 DocsNotBuildException(const std::string &message, const Command &command)
33 : std::runtime_error(message), command(command)
34 {
35 }
36
39 const Command &getCommand() const noexcept { return command; }
40
41private:
42 const Command &command;
43};
44} // namespace cli::commands::docwriting
Represents a command in the CLI application.
Definition command.h:36
Exception thrown when documentation strings of a command are not built.
Definition docs_exception.h:27
const Command & getCommand() const noexcept
Gets the command whose documentation wasn't built.
Definition docs_exception.h:39
DocsNotBuildException(const std::string &message, const Command &command)
Construct a DocsNotBuildException with a message and command.
Definition docs_exception.h:32