kaycxx-cli
C++ CLI library
Loading...
Searching...
No Matches
flag.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Klaus Reimer <k@ailis.de>
2// SPDX-License-Identifier: MIT
3
9#pragma once
10
11#include <string>
12
14
15namespace kaycxx::cli {
16
22class flag : public switch_base {
23public:
25
31 [[nodiscard]] std::string usage() const override;
32
39};
40
41} // namespace kaycxx::cli
Command line flag definition.
Definition flag.hpp:22
bool expects_value() const noexcept override
Checks whether this flag expects a value.
std::string usage() const override
Returns generated help usage for this flag.
Handle for a registered option.
Definition option_handle.hpp:25
Common base class for command line switches.
Definition switch_base.hpp:22
switch_base(std::string_view name, std::optional< std::string_view > description=std::nullopt)
Creates a switch without a short alias.
Defines the common base class for flags and options.