Commit 6cc757f769ba72261860f5bd3f47e1cc197124a3

Authored by Christoph Bachhuber
Committed by Henry Schreiner
1 parent b856c0ba

Fix includes in examples (#407)

* Fix includes in examples

* Fix order

* Align with other subcommand files

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
examples/callback_passthrough.cpp
1   -#include "CLI/CLI.hpp"
  1 +#include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <string>
2 4  
3 5 int main(int argc, char **argv) {
4 6  
... ...
examples/enum.cpp
1 1 #include <CLI/CLI.hpp>
  2 +#include <iostream>
2 3 #include <map>
  4 +#include <string>
3 5  
4 6 enum class Level : int { High, Medium, Low };
5 7  
... ...
examples/enum_ostream.cpp
1 1 #include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <map>
  4 +#include <string>
2 5  
3 6 enum class Level : int { High, Medium, Low };
4 7  
... ...
examples/formatter.cpp
1 1 #include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <memory>
2 4  
3 5 class MyFormatter : public CLI::Formatter {
4 6 public:
... ...
examples/groups.cpp
1   -#include "CLI/CLI.hpp"
2   -#include "CLI/Timer.hpp"
  1 +#include <CLI/CLI.hpp>
  2 +#include <CLI/Timer.hpp>
  3 +#include <iostream>
  4 +#include <string>
3 5  
4 6 int main(int argc, char **argv) {
5 7 CLI::AutoTimer("This is a timer");
... ...
examples/json.cpp
1 1 #include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <memory>
2 4 #include <nlohmann/json.hpp>
  5 +#include <string>
  6 +#include <vector>
3 7  
4 8 // This example is only built on GCC 7 on Travis due to mismatch in stdlib
5 9 // for clang (CLI11 is forgiving about mismatches, json.hpp is not)
... ...
examples/modhelp.cpp
1   -
2   -#include "CLI/CLI.hpp"
3   -
  1 +#include <CLI/CLI.hpp>
4 2 #include <iostream>
  3 +#include <string>
5 4  
6 5 int main(int argc, char **argv) {
7 6 CLI::App test{R"raw(Modify the help print so that argument values are accessible.
... ...
examples/option_groups.cpp
1   -#include "CLI/CLI.hpp"
  1 +#include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <string>
2 4  
3 5 int main(int argc, char **argv) {
4 6  
... ...
examples/positional_arity.cpp
1   -#include "CLI/CLI.hpp"
  1 +#include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <string>
2 4  
3 5 int main(int argc, char **argv) {
4 6  
... ...
examples/positional_validation.cpp
1   -#include "CLI/CLI.hpp"
  1 +#include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <string>
2 4  
3 5 int main(int argc, char **argv) {
4 6  
... ...
examples/prefix_command.cpp
1   -#include "CLI/CLI.hpp"
  1 +#include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <string>
  4 +#include <vector>
2 5  
3 6 int main(int argc, char **argv) {
4 7  
... ...
examples/ranges.cpp
1   -#include "CLI/CLI.hpp"
  1 +#include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <vector>
2 4  
3 5 int main(int argc, char **argv) {
4 6  
... ...
examples/retired.cpp
1   -#include "CLI/CLI.hpp"
  1 +#include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <utility>
2 4 #include <vector>
3 5  
4 6 // This example shows the usage of the retired and deprecated option helper methods
... ...
examples/shapes.cpp
1   -#include "CLI/CLI.hpp"
  1 +#include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <vector>
2 4  
3 5 int main(int argc, char **argv) {
4 6  
... ...
examples/simple.cpp
1   -#include "CLI/CLI.hpp"
  1 +#include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <string>
2 4  
3 5 int main(int argc, char **argv) {
4 6  
... ...
examples/subcom_help.cpp
1 1 #include <CLI/CLI.hpp>
2 2 #include <iostream>
  3 +#include <string>
3 4  
4 5 int main(int argc, char *argv[]) {
5 6 CLI::App cli_global{"Demo app"};
... ...
examples/subcom_in_files/subcommand_a.cpp
1   -// ===================================================================
2   -// subcommand_a.cpp
3   -// ===================================================================
4   -
5 1 #include "subcommand_a.hpp"
  2 +#include <iostream>
  3 +#include <memory>
6 4  
7 5 /// Set up a subcommand and capture a shared_ptr to a struct that holds all its options.
8 6 /// The variables of the struct are bound to the CLI options.
... ...
examples/subcom_in_files/subcommand_a.hpp
1 1 #pragma once
2   -// ===================================================================
3   -// subcommand_a.hpp
4   -// ===================================================================
5 2  
6   -#include "CLI/CLI.hpp"
7   -#include <memory>
  3 +#include <CLI/CLI.hpp>
8 4 #include <string>
9 5  
10 6 /// Collection of all options of Subcommand A.
... ...
examples/subcom_in_files/subcommand_main.cpp
1   -// ===================================================================
2   -// main.cpp
3   -// ===================================================================
4   -
5 1 #include "subcommand_a.hpp"
  2 +#include <CLI/CLI.hpp>
6 3  
7 4 int main(int argc, char **argv) {
8 5 CLI::App app{"..."};
... ...
examples/subcom_partitioned.cpp
1   -#include "CLI/CLI.hpp"
2   -#include "CLI/Timer.hpp"
  1 +#include <CLI/CLI.hpp>
  2 +#include <CLI/Timer.hpp>
  3 +#include <iostream>
  4 +#include <memory>
  5 +#include <string>
3 6  
4 7 int main(int argc, char **argv) {
5 8 CLI::AutoTimer("This is a timer");
... ...
examples/subcommands.cpp
1   -#include "CLI/CLI.hpp"
  1 +#include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <string>
2 4  
3 5 int main(int argc, char **argv) {
4 6  
... ...
examples/validators.cpp
1   -#include "CLI/CLI.hpp"
  1 +#include <CLI/CLI.hpp>
  2 +#include <iostream>
  3 +#include <string>
2 4  
3 5 int main(int argc, char **argv) {
4 6  
... ...