summaryrefslogtreecommitdiff
path: root/examples/file/driver.cxx
blob: 03b361a7fb617ac5ce9821e6f10f111e4691c34c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// file      : examples/file/driver.cxx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC
// license   : MIT; see accompanying LICENSE file

#include <iostream>
#include <iterator>
#include <algorithm>

#include "options.hxx"

using namespace std;

int
main (int argc, char* argv[])
{
  try
  {
    cli::argv_file_scanner s (argc, argv, "--options-file");
    options o (s);

    cout << "verbosity: " << o.verbose () << endl
         << "values: ";

    copy (o.val ().begin (),
          o.val ().end (),
          ostream_iterator<int> (cout, " "));

    cerr << endl;
  }
  catch (const cli::exception& e)
  {
    cerr << e << endl;
    return 1;
  }
}