mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-30 20:53:52 +00:00
Add IWYU pragmas (#1008)
Added include-what-you-use pragmas to: * let IWYU point users to the main include file CLI/CLI.hpp * tell IWYU that CLI/CLI.hpp is the main exporting header. This should fix #816 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Philip Top <phlptp@gmail.com>
This commit is contained in:
parent
fe92f34655
commit
2fa609ad55
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// [CLI11:public_includes:set]
|
// [CLI11:public_includes:set]
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -1442,5 +1444,5 @@ struct AppFriend {
|
|||||||
} // namespace CLI
|
} // namespace CLI
|
||||||
|
|
||||||
#ifndef CLI11_COMPILE
|
#ifndef CLI11_COMPILE
|
||||||
#include "impl/App_inl.hpp"
|
#include "impl/App_inl.hpp" // IWYU pragma: export
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// [CLI11:public_includes:set]
|
// [CLI11:public_includes:set]
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -25,5 +27,5 @@ CLI11_INLINE std::vector<std::string> compute_win32_argv();
|
|||||||
} // namespace CLI
|
} // namespace CLI
|
||||||
|
|
||||||
#ifndef CLI11_COMPILE
|
#ifndef CLI11_COMPILE
|
||||||
#include "impl/Argv_inl.hpp"
|
#include "impl/Argv_inl.hpp" // IWYU pragma: export
|
||||||
#endif
|
#endif
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
// CLI Library includes
|
// CLI Library includes
|
||||||
// Order is important for combiner script
|
// Order is important for combiner script
|
||||||
|
|
||||||
|
// IWYU pragma: begin_exports
|
||||||
|
|
||||||
#include "Version.hpp"
|
#include "Version.hpp"
|
||||||
|
|
||||||
#include "Macros.hpp"
|
#include "Macros.hpp"
|
||||||
@ -38,3 +40,5 @@
|
|||||||
#include "Config.hpp"
|
#include "Config.hpp"
|
||||||
|
|
||||||
#include "Formatter.hpp"
|
#include "Formatter.hpp"
|
||||||
|
|
||||||
|
// IWYU pragma: end_exports
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// [CLI11:public_includes:set]
|
// [CLI11:public_includes:set]
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
@ -49,5 +51,5 @@ void checkParentSegments(std::vector<ConfigItem> &output, const std::string &cur
|
|||||||
} // namespace CLI
|
} // namespace CLI
|
||||||
|
|
||||||
#ifndef CLI11_COMPILE
|
#ifndef CLI11_COMPILE
|
||||||
#include "impl/Config_inl.hpp"
|
#include "impl/Config_inl.hpp" // IWYU pragma: export
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// [CLI11:public_includes:set]
|
// [CLI11:public_includes:set]
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
#include "Macros.hpp"
|
#include "Macros.hpp"
|
||||||
|
|
||||||
// [CLI11:public_includes:set]
|
// [CLI11:public_includes:set]
|
||||||
@ -50,5 +51,5 @@ CLI11_INLINE std::filesystem::path to_path(std::string_view str);
|
|||||||
} // namespace CLI
|
} // namespace CLI
|
||||||
|
|
||||||
#ifndef CLI11_COMPILE
|
#ifndef CLI11_COMPILE
|
||||||
#include "impl/Encoding_inl.hpp"
|
#include "impl/Encoding_inl.hpp" // IWYU pragma: export
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// [CLI11:public_includes:set]
|
// [CLI11:public_includes:set]
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// [CLI11:public_includes:set]
|
// [CLI11:public_includes:set]
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -21,5 +23,5 @@ namespace CLI {
|
|||||||
} // namespace CLI
|
} // namespace CLI
|
||||||
|
|
||||||
#ifndef CLI11_COMPILE
|
#ifndef CLI11_COMPILE
|
||||||
#include "impl/Formatter_inl.hpp"
|
#include "impl/Formatter_inl.hpp" // IWYU pragma: export
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// [CLI11:public_includes:set]
|
// [CLI11:public_includes:set]
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// [CLI11:macros_hpp:verbatim]
|
// [CLI11:macros_hpp:verbatim]
|
||||||
|
|
||||||
// The following version macro is very similar to the one in pybind11
|
// The following version macro is very similar to the one in pybind11
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// [CLI11:public_includes:set]
|
// [CLI11:public_includes:set]
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@ -804,5 +806,5 @@ class Option : public OptionBase<Option> {
|
|||||||
} // namespace CLI
|
} // namespace CLI
|
||||||
|
|
||||||
#ifndef CLI11_COMPILE
|
#ifndef CLI11_COMPILE
|
||||||
#include "impl/Option_inl.hpp"
|
#include "impl/Option_inl.hpp" // IWYU pragma: export
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// [CLI11:public_includes:set]
|
// [CLI11:public_includes:set]
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
@ -44,5 +46,5 @@ get_names(const std::vector<std::string> &input);
|
|||||||
} // namespace CLI
|
} // namespace CLI
|
||||||
|
|
||||||
#ifndef CLI11_COMPILE
|
#ifndef CLI11_COMPILE
|
||||||
#include "impl/Split_inl.hpp"
|
#include "impl/Split_inl.hpp" // IWYU pragma: export
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// [CLI11:public_includes:set]
|
// [CLI11:public_includes:set]
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
@ -263,5 +265,5 @@ CLI11_INLINE bool process_quoted_string(std::string &str, char string_char = '\"
|
|||||||
} // namespace CLI
|
} // namespace CLI
|
||||||
|
|
||||||
#ifndef CLI11_COMPILE
|
#ifndef CLI11_COMPILE
|
||||||
#include "impl/StringTools_inl.hpp"
|
#include "impl/StringTools_inl.hpp" // IWYU pragma: export
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// On GCC < 4.8, the following define is often missing. Due to the
|
// On GCC < 4.8, the following define is often missing. Due to the
|
||||||
// fact that this library only uses sleep_for, this should be safe
|
// fact that this library only uses sleep_for, this should be safe
|
||||||
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5 && __GNUC_MINOR__ < 8
|
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5 && __GNUC_MINOR__ < 8
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// [CLI11:public_includes:set]
|
// [CLI11:public_includes:set]
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
#include "Error.hpp"
|
#include "Error.hpp"
|
||||||
#include "Macros.hpp"
|
#include "Macros.hpp"
|
||||||
#include "StringTools.hpp"
|
#include "StringTools.hpp"
|
||||||
@ -892,5 +894,5 @@ CLI11_INLINE std::pair<std::string, std::string> split_program_name(std::string
|
|||||||
} // namespace CLI
|
} // namespace CLI
|
||||||
|
|
||||||
#ifndef CLI11_COMPILE
|
#ifndef CLI11_COMPILE
|
||||||
#include "impl/Validators_inl.hpp"
|
#include "impl/Validators_inl.hpp" // IWYU pragma: export
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// [CLI11:version_hpp:verbatim]
|
// [CLI11:version_hpp:verbatim]
|
||||||
|
|
||||||
#define CLI11_VERSION_MAJOR 2
|
#define CLI11_VERSION_MAJOR 2
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// This include is only needed for IDEs to discover symbols
|
// This include is only needed for IDEs to discover symbols
|
||||||
#include "../App.hpp"
|
#include "../App.hpp"
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// This include is only needed for IDEs to discover symbols
|
// This include is only needed for IDEs to discover symbols
|
||||||
#include "../Argv.hpp"
|
#include "../Argv.hpp"
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// This include is only needed for IDEs to discover symbols
|
// This include is only needed for IDEs to discover symbols
|
||||||
#include "../Config.hpp"
|
#include "../Config.hpp"
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// This include is only needed for IDEs to discover symbols
|
// This include is only needed for IDEs to discover symbols
|
||||||
#include "../Encoding.hpp"
|
#include "../Encoding.hpp"
|
||||||
#include "../Macros.hpp"
|
#include "../Macros.hpp"
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// This include is only needed for IDEs to discover symbols
|
// This include is only needed for IDEs to discover symbols
|
||||||
#include "../Formatter.hpp"
|
#include "../Formatter.hpp"
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// This include is only needed for IDEs to discover symbols
|
// This include is only needed for IDEs to discover symbols
|
||||||
#include "../Option.hpp"
|
#include "../Option.hpp"
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// This include is only needed for IDEs to discover symbols
|
// This include is only needed for IDEs to discover symbols
|
||||||
#include "../Split.hpp"
|
#include "../Split.hpp"
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
|
|
||||||
// This include is only needed for IDEs to discover symbols
|
// This include is only needed for IDEs to discover symbols
|
||||||
#include "../StringTools.hpp"
|
#include "../StringTools.hpp"
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// IWYU pragma: private, include "CLI/CLI.hpp"
|
||||||
#include "../Validators.hpp"
|
#include "../Validators.hpp"
|
||||||
|
|
||||||
#include "../Encoding.hpp"
|
#include "../Encoding.hpp"
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
//
|
//
|
||||||
// SPDX-License-Identifier: BSD-3-Clause
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
// IWYU pragma: begin_keep
|
||||||
|
|
||||||
#include <CLI/impl/App_inl.hpp>
|
#include <CLI/impl/App_inl.hpp>
|
||||||
#include <CLI/impl/Argv_inl.hpp>
|
#include <CLI/impl/Argv_inl.hpp>
|
||||||
#include <CLI/impl/Config_inl.hpp>
|
#include <CLI/impl/Config_inl.hpp>
|
||||||
@ -13,3 +15,5 @@
|
|||||||
#include <CLI/impl/Split_inl.hpp>
|
#include <CLI/impl/Split_inl.hpp>
|
||||||
#include <CLI/impl/StringTools_inl.hpp>
|
#include <CLI/impl/StringTools_inl.hpp>
|
||||||
#include <CLI/impl/Validators_inl.hpp>
|
#include <CLI/impl/Validators_inl.hpp>
|
||||||
|
|
||||||
|
// IWYU pragma: end_keep
|
||||||
|
Loading…
x
Reference in New Issue
Block a user