Commit c65d9fdcb266d64afdae35359611483c832a74fa

Authored by Henry Schreiner
Committed by GitHub
1 parent 7f463c9d

Dropping deprecated names (#192)

CHANGELOG.md
@@ -12,6 +12,7 @@ Passing the same subcommand multiple times is better supported. A few new featur @@ -12,6 +12,7 @@ Passing the same subcommand multiple times is better supported. A few new featur
12 * 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] 12 * 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]
13 * Use the standard `BUILD_TESTING` over `CLI11_TESTING` if defined (`CLI11_TESTING` may eventually be removed) [#183] 13 * Use the standard `BUILD_TESTING` over `CLI11_TESTING` if defined (`CLI11_TESTING` may eventually be removed) [#183]
14 * Cleanup warnings [#191] 14 * Cleanup warnings [#191]
  15 +* Remove deprecated names: `set_footer`, `set_name`, `set_callback`, and `set_type_name`. Use without the `set_` instead. [#192]
15 16
16 [#179]: https://github.com/CLIUtils/CLI11/pull/179 17 [#179]: https://github.com/CLIUtils/CLI11/pull/179
17 [#183]: https://github.com/CLIUtils/CLI11/pull/183 18 [#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 @@ -20,6 +21,7 @@ Passing the same subcommand multiple times is better supported. A few new featur
20 [#187]: https://github.com/CLIUtils/CLI11/pull/187 21 [#187]: https://github.com/CLIUtils/CLI11/pull/187
21 [#190]: https://github.com/CLIUtils/CLI11/pull/190 22 [#190]: https://github.com/CLIUtils/CLI11/pull/190
22 [#191]: https://github.com/CLIUtils/CLI11/pull/191 23 [#191]: https://github.com/CLIUtils/CLI11/pull/191
  24 +[#192]: https://github.com/CLIUtils/CLI11/pull/192
23 25
24 ## Version 1.6.2: Help-all 26 ## Version 1.6.2: Help-all
25 27
include/CLI/App.hpp
@@ -1356,18 +1356,6 @@ class App { @@ -1356,18 +1356,6 @@ class App {
1356 return formatter_->make_help(this, prev, mode); 1356 return formatter_->make_help(this, prev, mode);
1357 } 1357 }
1358 1358
1359 - /// Provided for backwards compatibility \deprecated  
1360 - CLI11_DEPRECATED("Please use footer instead")  
1361 - App *set_footer(std::string msg) { return footer(msg); }  
1362 -  
1363 - /// Provided for backwards compatibility \deprecated  
1364 - CLI11_DEPRECATED("Please use name instead")  
1365 - App *set_name(std::string msg) { return name(msg); }  
1366 -  
1367 - /// Provided for backwards compatibility \deprecated  
1368 - CLI11_DEPRECATED("Please use callback instead")  
1369 - App *set_callback(std::function<void()> fn) { return callback(fn); }  
1370 -  
1371 ///@} 1359 ///@}
1372 /// @name Getters 1360 /// @name Getters
1373 ///@{ 1361 ///@{
include/CLI/Option.hpp
@@ -734,10 +734,6 @@ class Option : public OptionBase&lt;Option&gt; { @@ -734,10 +734,6 @@ class Option : public OptionBase&lt;Option&gt; {
734 return this; 734 return this;
735 } 735 }
736 736
737 - /// Provided for backward compatibility \deprecated  
738 - CLI11_DEPRECATED("Please use type_name instead")  
739 - Option *set_type_name(std::string typeval) { return type_name(typeval); }  
740 -  
741 /// Set a custom option size 737 /// Set a custom option size
742 Option *type_size(int option_type_size) { 738 Option *type_size(int option_type_size) {
743 type_size_ = option_type_size; 739 type_size_ = option_type_size;
tests/DeprecatedTest.cpp
@@ -6,38 +6,7 @@ @@ -6,38 +6,7 @@
6 6
7 #include "gtest/gtest.h" 7 #include "gtest/gtest.h"
8 8
9 -TEST(Deprecated, SetFooter) {  
10 - CLI::App app{"My prog"};  
11 -  
12 - app.set_footer("My Footer");  
13 - EXPECT_EQ("My Footer", app.get_footer());  
14 -}  
15 -  
16 -TEST(Deprecated, SetName) {  
17 - CLI::App app{"My prog"};  
18 -  
19 - app.set_name("My Name");  
20 - EXPECT_EQ("My Name", app.get_name());  
21 -}  
22 -  
23 -TEST(Deprecated, SetCallback) {  
24 - CLI::App app{"My prog"};  
25 -  
26 - bool val;  
27 - app.set_callback([&val]() { val = true; });  
28 -  
29 - std::vector<std::string> something;  
30 - app.parse(something);  
31 -  
32 - EXPECT_TRUE(val);  
33 -}  
34 -  
35 -TEST(Deprecated, SetTypeName) {  
36 - CLI::App app{"My prog"};  
37 -  
38 - std::string val;  
39 - auto opt = app.add_option("--val", val);  
40 - opt->set_type_name("THAT");  
41 -  
42 - EXPECT_EQ(opt->get_type_name(), "THAT"); 9 +TEST(Deprecated, Emtpy) {
  10 + // No deprecated features at this time.
  11 + EXPECT_TRUE(true);
43 } 12 }