1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-29 20:23:55 +00:00

Check for switch enum (#393)

* Check for switch enum

* Add missing cases
This commit is contained in:
Henry Schreiner 2020-01-08 10:17:36 -05:00 committed by GitHub
parent 417a978aba
commit 8570ffb564
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -62,7 +62,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
target_compile_options(CLI11_warnings INTERFACE "/WX") target_compile_options(CLI11_warnings INTERFACE "/WX")
endif() endif()
else() else()
target_compile_options(CLI11_warnings INTERFACE -Wall -Wextra -pedantic -Wshadow -Wsign-conversion) target_compile_options(CLI11_warnings INTERFACE -Wall -Wextra -pedantic -Wshadow -Wsign-conversion -Wswitch-enum)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
# GCC 4.8 has a false positive # GCC 4.8 has a false positive

View File

@ -283,6 +283,13 @@ inline path_type check_path(const char *file) noexcept {
return path_type::nonexistant; return path_type::nonexistant;
case std::filesystem::file_type::directory: case std::filesystem::file_type::directory:
return path_type::directory; return path_type::directory;
case std::filesystem::file_type::symlink:
case std::filesystem::file_type::block:
case std::filesystem::file_type::character:
case std::filesystem::file_type::fifo:
case std::filesystem::file_type::socket:
case std::filesystem::file_type::regular:
case std::filesystem::file_type::unknown:
default: default:
return path_type::file; return path_type::file;
} }