sat-solver/cmdln_flags.cpp

62 lines
1.2 KiB
C++

#include <unistd.h>
#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include "cmdln_flags.hpp"
cmdln_flags::cmdln_flags(int argc, char* const* argv)
{
static const struct option long_options[] = {
{"input-file", required_argument, 0, 'i'},
{"dump-automata", no_argument, 0, 'd'},
{"verbose", no_argument, 0, 'v'},
{"verify", no_argument, 0, 'V'},
{0, 0, 0, 0}
};
for (int c; (c = getopt_long(argc, argv, "i:dvV", long_options, NULL)) >= 0; )
{
switch (c)
{
case 'i':
input_path = optarg;
break;
case 'd':
dump_automata = true;
break;
case 'v':
verbose = true;
break;
case 'V':
verify = true;
break;
default:
exit(1);
break;
}
}
if (!input_path)
{
puts("usage: sat-solver [-v] [-d] -i ./input/file.txt");
exit(1);
}
}