File: example.cpp

package info (click to toggle)
cli11 2.1.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,592 kB
  • sloc: cpp: 19,206; python: 140; sh: 64; makefile: 12; ruby: 6
file content (20 lines) | stat: -rw-r--r-- 382 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// This file is a "Hello, world!" CLI11 program

#include "CLI/CLI.hpp"

#include <iostream>

int main(int argc, char **argv) {

    CLI::App app("Some nice description");

    int x = 0;
    app.add_option("-x", x, "an integer value")->capture_default_str();

    bool flag;
    app.add_flag("-f,--flag", flag, "a flag option");

    CLI11_PARSE(app, argc, argv);

    return 0;
}