aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus/project/main.cpp
blob: 338201089af60f1dea0d88a69d55f42ab31c9409 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include <toml++/toml.hpp>

int main(int argc, char** argv)
{
    if (argc < 2)
        return 1;

    try
    {
        toml::table tbl;
        tbl = toml::parse_file(argv[1]);
        std::cout << tbl << "\n";
    }
    catch (const toml::parse_error& err)
    {
        std::cerr << "Parsing failed: " << err << "\n";
        return 2;
    }

    return 0;
}