kaycxx-cli
C++ CLI library
Loading...
Searching...
No Matches
parameter_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
11#include <utility>
12
14
15namespace kaycxx::cli {
16
24template <parseable_value T>
26public:
33 return *definition_;
34 }
35
44 definition_->default_value(std::move(value));
45 return *this;
46 }
47
48private:
49 friend class command;
50
57 : definition_(&definition)
58 {}
59
61 parameter<T>* definition_;
62};
63
64} // namespace kaycxx::cli
Defines and parses a command line interface.
Definition command.hpp:68
Handle for a registered option.
Definition option_handle.hpp:25
option_handle default_value(T value)
Sets the default option value.
Definition option_handle.hpp:53
Handle for a registered positional parameter.
Definition parameter_handle.hpp:25
parameter< T > const & definition() const noexcept
Returns the underlying parameter definition.
Definition parameter_handle.hpp:32
parameter_handle default_value(T value)
Sets the default parameter value.
Definition parameter_handle.hpp:43
Defines single positional parameters.