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:
parent
b856c0ba9c
commit
6cc757f769
@ -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) {
|
||||||
|
|
||||||
|
@ -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 };
|
||||||
|
|
||||||
|
@ -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 };
|
||||||
|
|
||||||
|
@ -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:
|
||||||
|
@ -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");
|
||||||
|
@ -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)
|
||||||
|
@ -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.
|
||||||
|
@ -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) {
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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) {
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
|
||||||
|
@ -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"};
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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{"..."};
|
||||||
|
@ -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");
|
||||||
|
@ -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) {
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user