kaycxx-cli
C++ CLI library
Loading...
Searching...
No Matches
flag_handle.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
12
13namespace kaycxx::cli {
14
15class command;
16
23public:
30 definition_->mark_as_action();
31 return *this;
32 }
33
40 return *definition_;
41 }
42
43private:
44 friend class command;
45
52 : definition_(&definition)
53 {}
54
56 switch_base* definition_;
57};
58
59} // namespace kaycxx::cli
Defines and parses a command line interface.
Definition command.hpp:68
Handle for a registered flag.
Definition flag_handle.hpp:22
switch_base const & definition() const noexcept
Returns the underlying flag definition.
Definition flag_handle.hpp:39
flag_handle action() noexcept
Marks the flag as a mutually exclusive command action.
Definition flag_handle.hpp:29
Handle for a registered option.
Definition option_handle.hpp:25
Common base class for command line switches.
Definition switch_base.hpp:22
void mark_as_action() noexcept
Marks this switch as a mutually exclusive command action.
Defines the common base class for flags and options.