Commit 8570ffb5649e5f80e284e4985441cfcfd59c44dc
Committed by
GitHub
1 parent
417a978a
Check for switch enum (#393)
* Check for switch enum * Add missing cases
Showing
2 changed files
with
8 additions
and
1 deletions
CMakeLists.txt
| @@ -62,7 +62,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) | @@ -62,7 +62,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) | ||
| 62 | target_compile_options(CLI11_warnings INTERFACE "/WX") | 62 | target_compile_options(CLI11_warnings INTERFACE "/WX") |
| 63 | endif() | 63 | endif() |
| 64 | else() | 64 | else() |
| 65 | - target_compile_options(CLI11_warnings INTERFACE -Wall -Wextra -pedantic -Wshadow -Wsign-conversion) | 65 | + target_compile_options(CLI11_warnings INTERFACE -Wall -Wextra -pedantic -Wshadow -Wsign-conversion -Wswitch-enum) |
| 66 | if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | 66 | if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") |
| 67 | if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) | 67 | if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) |
| 68 | # GCC 4.8 has a false positive | 68 | # GCC 4.8 has a false positive |
include/CLI/Validators.hpp
| @@ -283,6 +283,13 @@ inline path_type check_path(const char *file) noexcept { | @@ -283,6 +283,13 @@ inline path_type check_path(const char *file) noexcept { | ||
| 283 | return path_type::nonexistant; | 283 | return path_type::nonexistant; |
| 284 | case std::filesystem::file_type::directory: | 284 | case std::filesystem::file_type::directory: |
| 285 | return path_type::directory; | 285 | return path_type::directory; |
| 286 | + case std::filesystem::file_type::symlink: | ||
| 287 | + case std::filesystem::file_type::block: | ||
| 288 | + case std::filesystem::file_type::character: | ||
| 289 | + case std::filesystem::file_type::fifo: | ||
| 290 | + case std::filesystem::file_type::socket: | ||
| 291 | + case std::filesystem::file_type::regular: | ||
| 292 | + case std::filesystem::file_type::unknown: | ||
| 286 | default: | 293 | default: |
| 287 | return path_type::file; | 294 | return path_type::file; |
| 288 | } | 295 | } |