main.cpp 930 Bytes
Newer Older
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
37
38
39
40
41
42
43
44
45
46
47

#include <iostream>
#include <fstream>

#include <dlib/cmd_line_parser.h>

using namespace std;
using namespace dlib;

int main(int argc, char** argv)
{
    try
    {
        typedef dlib::cmd_line_parser<char>::check_1a_c parser_type;

        parser_type parser;

        parser.add_option("h","Displays this information.");
        parser.add_option("c","Create an XML file named <arg> listing a set of images.",1);

        parser.parse(argc, argv);

        const char* singles[] = {"h","c"};
        parser.check_one_time_options(singles);

        if (parser.option("h"))
        {
            cout << "Options:\n";
            parser.print_options(cout);
            cout << endl;
            return EXIT_SUCCESS;
        }

        if (parser.option("c"))
        {

            return EXIT_SUCCESS;
        }

    }
    catch (exception& e)
    {
        cout << e.what() << endl;
        return EXIT_FAILURE;
    }
}