Browse Source

changes to option parser output

main
Stefan Pranger 3 years ago
parent
commit
6cf89a9847
  1. 2
      main.cpp
  2. 8
      util/OptionParser.cpp

2
main.cpp

@ -17,7 +17,7 @@ int main(int argc, char* argv[]) {
auto verbose_max_flow = optionParser.add<popl::Switch, popl::Attribute::optional>("a", "max-flow", "Include verbose information about the max flow to the output.");
auto min_cut_option = optionParser.add<popl::Switch, popl::Attribute::optional>("m", "minimum-cut", "Include the minimum cut set to the output.");
auto verbose_option = optionParser.add<popl::Switch, popl::Attribute::optional>("v", "verbose", "Output verbose algorithmic information and runtime. Pass twice to get step-by-step information.");
auto verbose_option = optionParser.add<popl::Switch, popl::Attribute::optional>("v", "verbose", "Output verbose algorithmic information and runtime. Pass twice to get information about all augmenting paths computed.");
try {
optionParser.parse(argc, argv);

8
util/OptionParser.cpp

@ -34,19 +34,19 @@ namespace parser {
int checkOption(const int input_filename_count,
const int input_string_count) {
if(input_filename_count > 1) {
std::cerr << "You may only pass one input graph file.";
std::cerr << "You may only pass one input graph file.\n";
return INPUT_ERROR;
}
if(input_string_count > 1) {
std::cerr << "You may only pass one input graph string.";
std::cerr << "You may only pass one input graph string.\n";
return INPUT_ERROR;
}
if(input_filename_count > 0 && input_string_count > 0) {
std::cerr << "You may only pass either an input graph file or an input graph string.";
std::cerr << "You may only pass either an input graph file or an input graph string.\n";
return INPUT_ERROR;
}
if(input_filename_count == 0 && input_string_count == 0) {
std::cerr << "You need to pass either and input graph file or an input graph string.";
std::cerr << "You need to pass either and input graph file or an input graph string.\n";
return INPUT_ERROR;
}
return INPUT_OK;

Loading…
Cancel
Save