Skip to content

Commit 318e0f7

Browse files
committed
fix a few comments, and change default version flag to only use "--version"
1 parent f804317 commit 318e0f7

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ set_property(TEST simple_all PROPERTY PASS_REGULAR_EXPRESSION
5454
"Received flag: 2 (2) times"
5555
"Some value: 1.2")
5656

57-
add_test(NAME simple_version COMMAND simple -v)
57+
add_test(NAME simple_version COMMAND simple --version)
5858
set_property(TEST simple_version PROPERTY PASS_REGULAR_EXPRESSION
5959
"${CLI11_VERSION}")
6060

include/CLI/App.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,13 +746,13 @@ class App {
746746
}
747747
/// Set the version as a string
748748
App *version(const std::string &versionString) {
749-
set_version_flag("-v,--version", versionString);
749+
set_version_flag("--version", versionString);
750750
return this;
751751
}
752752

753753
/// Generate the version string through a callback function
754754
App *version(std::function<std::string()> vfunc) {
755-
set_version_flag("-v,--version", vfunc);
755+
set_version_flag("--version", vfunc);
756756
return this;
757757
}
758758

include/CLI/StringTools.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ inline bool valid_name_string(const std::string &str) {
190190
return true;
191191
}
192192

193-
/// check if a string is a container segment separator (empty or "%%"
193+
/// check if a string is a container segment separator (empty or "%%")
194194
inline bool is_separator(const std::string &str) {
195195
static const std::string sep("%%");
196196
return (str.empty() || str == sep);

include/CLI/TypeTools.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ struct is_mutable_container<
232232
// check to see if an object is a mutable container (fail by default)
233233
template <typename T, typename _ = void> struct is_readable_container : std::false_type {};
234234

235-
/// type trait to test if a type is a container meaning it has a value_type, it has an iterator, a clear, and an en end
235+
/// type trait to test if a type is a container meaning it has a value_type, it has an iterator, a clear, and an end
236236
/// methods and an insert function. And for our purposes we exclude std::string and types that can be constructed from
237237
/// a std::string
238238
template <typename T>
@@ -244,7 +244,7 @@ struct is_readable_container<
244244
// check to see if an object is a wrapper (fail by default)
245245
template <typename T, typename _ = void> struct is_wrapper : std::false_type {};
246246

247-
// check if an object is a is a wrapper (it has a value_type defined)
247+
// check if an object is a wrapper (it has a value_type defined)
248248
template <typename T>
249249
struct is_wrapper<T, conditional_t<false, void_t<typename T::value_type>, void>> : public std::true_type {};
250250

@@ -344,7 +344,7 @@ auto value_string(const T &value) -> decltype(to_string(value)) {
344344
return to_string(value);
345345
}
346346

347-
/// temple to get the underlying value type if it exists or use a default
347+
/// template to get the underlying value type if it exists or use a default
348348
template <typename T, typename def, typename Enable = void> struct wrapped_type { using type = def; };
349349

350350
/// Type size for regular object types that do not look like a tuple

tests/HelpTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ TEST(TVersion, parse_throw) {
12201220
app.version(CLI11_VERSION);
12211221

12221222
EXPECT_THROW(app.parse("--version"), CLI::CallForVersion);
1223-
EXPECT_THROW(app.parse("-v --arg2 5"), CLI::CallForVersion);
1223+
EXPECT_THROW(app.parse("--version --arg2 5"), CLI::CallForVersion);
12241224

12251225
auto ptr = app.get_version_ptr();
12261226

0 commit comments

Comments
 (0)