File: array_option.cpp

package info (click to toggle)
cli11 2.6.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,520 kB
  • sloc: cpp: 26,743; python: 129; sh: 64; makefile: 11
file content (21 lines) | stat: -rw-r--r-- 616 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright (c) 2017-2025, University of Cincinnati, developed by Henry Schreiner
// under NSF AWARD 1414736 and by the respective contributors.
// All rights reserved.
//
// SPDX-License-Identifier: BSD-3-Clause

// Code modified from Loic Gouarin(https://github.com/gouarin) https://github.com/CLIUtils/CLI11/issues/1135

#include <CLI/CLI.hpp>
#include <array>
#include <iostream>

int main(int argc, char **argv) {
    std::array<int, 2> a{0, 1};
    CLI::App app{"My app"};
    app.add_option("--a", a, "an array")->capture_default_str();
    app.parse(argc, argv);

    std::cout << "pass\n";
    return 0;
}