1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-29 12:13:52 +00:00

Fix includes in examples (#407)

* Fix includes in examples

* Fix order

* Align with other subcommand files

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
This commit is contained in:
Christoph Bachhuber 2020-01-18 17:58:02 +01:00 committed by Henry Schreiner
parent b856c0ba9c
commit 6cc757f769
22 changed files with 61 additions and 31 deletions

View File

@ -1,4 +1,6 @@
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include <iostream>
#include <string>
int main(int argc, char **argv) { int main(int argc, char **argv) {

View File

@ -1,5 +1,7 @@
#include <CLI/CLI.hpp> #include <CLI/CLI.hpp>
#include <iostream>
#include <map> #include <map>
#include <string>
enum class Level : int { High, Medium, Low }; enum class Level : int { High, Medium, Low };

View File

@ -1,4 +1,7 @@
#include <CLI/CLI.hpp> #include <CLI/CLI.hpp>
#include <iostream>
#include <map>
#include <string>
enum class Level : int { High, Medium, Low }; enum class Level : int { High, Medium, Low };

View File

@ -1,4 +1,6 @@
#include <CLI/CLI.hpp> #include <CLI/CLI.hpp>
#include <iostream>
#include <memory>
class MyFormatter : public CLI::Formatter { class MyFormatter : public CLI::Formatter {
public: public:

View File

@ -1,5 +1,7 @@
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include "CLI/Timer.hpp" #include <CLI/Timer.hpp>
#include <iostream>
#include <string>
int main(int argc, char **argv) { int main(int argc, char **argv) {
CLI::AutoTimer("This is a timer"); CLI::AutoTimer("This is a timer");

View File

@ -1,5 +1,9 @@
#include <CLI/CLI.hpp> #include <CLI/CLI.hpp>
#include <iostream>
#include <memory>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#include <string>
#include <vector>
// This example is only built on GCC 7 on Travis due to mismatch in stdlib // This example is only built on GCC 7 on Travis due to mismatch in stdlib
// for clang (CLI11 is forgiving about mismatches, json.hpp is not) // for clang (CLI11 is forgiving about mismatches, json.hpp is not)

View File

@ -1,7 +1,6 @@
#include <CLI/CLI.hpp>
#include "CLI/CLI.hpp"
#include <iostream> #include <iostream>
#include <string>
int main(int argc, char **argv) { int main(int argc, char **argv) {
CLI::App test{R"raw(Modify the help print so that argument values are accessible. CLI::App test{R"raw(Modify the help print so that argument values are accessible.

View File

@ -1,4 +1,6 @@
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include <iostream>
#include <string>
int main(int argc, char **argv) { int main(int argc, char **argv) {

View File

@ -1,4 +1,6 @@
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include <iostream>
#include <string>
int main(int argc, char **argv) { int main(int argc, char **argv) {

View File

@ -1,4 +1,6 @@
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include <iostream>
#include <string>
int main(int argc, char **argv) { int main(int argc, char **argv) {

View File

@ -1,4 +1,7 @@
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include <iostream>
#include <string>
#include <vector>
int main(int argc, char **argv) { int main(int argc, char **argv) {

View File

@ -1,4 +1,6 @@
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include <iostream>
#include <vector>
int main(int argc, char **argv) { int main(int argc, char **argv) {

View File

@ -1,4 +1,6 @@
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include <iostream>
#include <utility>
#include <vector> #include <vector>
// This example shows the usage of the retired and deprecated option helper methods // This example shows the usage of the retired and deprecated option helper methods

View File

@ -1,4 +1,6 @@
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include <iostream>
#include <vector>
int main(int argc, char **argv) { int main(int argc, char **argv) {

View File

@ -1,4 +1,6 @@
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include <iostream>
#include <string>
int main(int argc, char **argv) { int main(int argc, char **argv) {

View File

@ -1,5 +1,6 @@
#include <CLI/CLI.hpp> #include <CLI/CLI.hpp>
#include <iostream> #include <iostream>
#include <string>
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
CLI::App cli_global{"Demo app"}; CLI::App cli_global{"Demo app"};

View File

@ -1,8 +1,6 @@
// ===================================================================
// subcommand_a.cpp
// ===================================================================
#include "subcommand_a.hpp" #include "subcommand_a.hpp"
#include <iostream>
#include <memory>
/// Set up a subcommand and capture a shared_ptr to a struct that holds all its options. /// Set up a subcommand and capture a shared_ptr to a struct that holds all its options.
/// The variables of the struct are bound to the CLI options. /// The variables of the struct are bound to the CLI options.

View File

@ -1,10 +1,6 @@
#pragma once #pragma once
// ===================================================================
// subcommand_a.hpp
// ===================================================================
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include <memory>
#include <string> #include <string>
/// Collection of all options of Subcommand A. /// Collection of all options of Subcommand A.

View File

@ -1,8 +1,5 @@
// ===================================================================
// main.cpp
// ===================================================================
#include "subcommand_a.hpp" #include "subcommand_a.hpp"
#include <CLI/CLI.hpp>
int main(int argc, char **argv) { int main(int argc, char **argv) {
CLI::App app{"..."}; CLI::App app{"..."};

View File

@ -1,5 +1,8 @@
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include "CLI/Timer.hpp" #include <CLI/Timer.hpp>
#include <iostream>
#include <memory>
#include <string>
int main(int argc, char **argv) { int main(int argc, char **argv) {
CLI::AutoTimer("This is a timer"); CLI::AutoTimer("This is a timer");

View File

@ -1,4 +1,6 @@
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include <iostream>
#include <string>
int main(int argc, char **argv) { int main(int argc, char **argv) {

View File

@ -1,4 +1,6 @@
#include "CLI/CLI.hpp" #include <CLI/CLI.hpp>
#include <iostream>
#include <string>
int main(int argc, char **argv) { int main(int argc, char **argv) {