Skip to content

Commit 264d376

Browse files
authored
Rename .name() to .option() in the Options-related error classes (#2019)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent d894234 commit 264d376

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/extension/options/include/sourcemeta/core/options_error.h

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,38 @@ struct SOURCEMETA_CORE_OPTIONS_EXPORT OptionsError : public std::runtime_error {
2929
/// This class represents a unknown option error
3030
struct SOURCEMETA_CORE_OPTIONS_EXPORT OptionsUnknownOptionError
3131
: public OptionsError {
32-
explicit OptionsUnknownOptionError(std::string name)
33-
: OptionsError{"Unknown option"}, name_{std::move(name)} {}
34-
[[nodiscard]] auto name() const -> const auto & { return this->name_; }
32+
explicit OptionsUnknownOptionError(std::string option)
33+
: OptionsError{"Unknown option"}, option_{std::move(option)} {}
34+
[[nodiscard]] auto option() const -> const auto & { return this->option_; }
3535

3636
private:
37-
std::string name_;
37+
std::string option_;
3838
};
3939

4040
/// @ingroup options
4141
/// This class represents a value being passed to a flag
4242
struct SOURCEMETA_CORE_OPTIONS_EXPORT OptionsUnexpectedValueFlagError
4343
: public OptionsError {
44-
explicit OptionsUnexpectedValueFlagError(std::string name)
45-
: OptionsError{"This flag cannot take a value"}, name_{std::move(name)} {}
46-
[[nodiscard]] auto name() const -> const auto & { return this->name_; }
44+
explicit OptionsUnexpectedValueFlagError(std::string option)
45+
: OptionsError{"This flag cannot take a value"},
46+
option_{std::move(option)} {}
47+
[[nodiscard]] auto option() const -> const auto & { return this->option_; }
4748

4849
private:
49-
std::string name_;
50+
std::string option_;
5051
};
5152

5253
/// @ingroup options
5354
/// This class represents a missing value from an option
5455
struct SOURCEMETA_CORE_OPTIONS_EXPORT OptionsMissingOptionValueError
5556
: public OptionsError {
56-
explicit OptionsMissingOptionValueError(std::string name)
57-
: OptionsError{"This option must take a value"}, name_{std::move(name)} {}
58-
[[nodiscard]] auto name() const -> const auto & { return this->name_; }
57+
explicit OptionsMissingOptionValueError(std::string option)
58+
: OptionsError{"This option must take a value"},
59+
option_{std::move(option)} {}
60+
[[nodiscard]] auto option() const -> const auto & { return this->option_; }
5961

6062
private:
61-
std::string name_;
63+
std::string option_;
6264
};
6365

6466
#if defined(_MSC_VER)

0 commit comments

Comments
 (0)