1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-30 20:53:52 +00:00

Dropping deprecated names (#192)

This commit is contained in:
Henry Schreiner 2019-01-13 13:52:42 +01:00 committed by GitHub
parent 7f463c9db3
commit c65d9fdcb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 50 deletions

View File

@ -12,6 +12,7 @@ Passing the same subcommand multiple times is better supported. A few new featur
* Dropped the mostly undocumented `short_curcuit` property, as help flag parsing is a bit more complex, and the default callback behavior of options now works properly. [#179]
* Use the standard `BUILD_TESTING` over `CLI11_TESTING` if defined (`CLI11_TESTING` may eventually be removed) [#183]
* Cleanup warnings [#191]
* Remove deprecated names: `set_footer`, `set_name`, `set_callback`, and `set_type_name`. Use without the `set_` instead. [#192]
[#179]: https://github.com/CLIUtils/CLI11/pull/179
[#183]: https://github.com/CLIUtils/CLI11/pull/183
@ -20,6 +21,7 @@ Passing the same subcommand multiple times is better supported. A few new featur
[#187]: https://github.com/CLIUtils/CLI11/pull/187
[#190]: https://github.com/CLIUtils/CLI11/pull/190
[#191]: https://github.com/CLIUtils/CLI11/pull/191
[#192]: https://github.com/CLIUtils/CLI11/pull/192
## Version 1.6.2: Help-all

View File

@ -1356,18 +1356,6 @@ class App {
return formatter_->make_help(this, prev, mode);
}
/// Provided for backwards compatibility \deprecated
CLI11_DEPRECATED("Please use footer instead")
App *set_footer(std::string msg) { return footer(msg); }
/// Provided for backwards compatibility \deprecated
CLI11_DEPRECATED("Please use name instead")
App *set_name(std::string msg) { return name(msg); }
/// Provided for backwards compatibility \deprecated
CLI11_DEPRECATED("Please use callback instead")
App *set_callback(std::function<void()> fn) { return callback(fn); }
///@}
/// @name Getters
///@{

View File

@ -734,10 +734,6 @@ class Option : public OptionBase<Option> {
return this;
}
/// Provided for backward compatibility \deprecated
CLI11_DEPRECATED("Please use type_name instead")
Option *set_type_name(std::string typeval) { return type_name(typeval); }
/// Set a custom option size
Option *type_size(int option_type_size) {
type_size_ = option_type_size;

View File

@ -6,38 +6,7 @@
#include "gtest/gtest.h"
TEST(Deprecated, SetFooter) {
CLI::App app{"My prog"};
app.set_footer("My Footer");
EXPECT_EQ("My Footer", app.get_footer());
}
TEST(Deprecated, SetName) {
CLI::App app{"My prog"};
app.set_name("My Name");
EXPECT_EQ("My Name", app.get_name());
}
TEST(Deprecated, SetCallback) {
CLI::App app{"My prog"};
bool val;
app.set_callback([&val]() { val = true; });
std::vector<std::string> something;
app.parse(something);
EXPECT_TRUE(val);
}
TEST(Deprecated, SetTypeName) {
CLI::App app{"My prog"};
std::string val;
auto opt = app.add_option("--val", val);
opt->set_type_name("THAT");
EXPECT_EQ(opt->get_type_name(), "THAT");
TEST(Deprecated, Emtpy) {
// No deprecated features at this time.
EXPECT_TRUE(true);
}