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:
parent
417a978aba
commit
8570ffb564
@ -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
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user