Skip to content
Permalink
Browse files

Merge pull request #59 from jgarciamesa/bugfix/tribool

Use boost::optional instead of boost::tribool
  • Loading branch information...
reedacartwright committed Mar 20, 2019
2 parents 62ca1a4 + 538b5c2 commit 6a27c78b677ddd24bf974a6521c0368f1ce4186d
Showing with 6 additions and 6 deletions.
  1. +3 −3 src/dawg.cpp
  2. +3 −3 src/dawgarg.xmh
@@ -137,9 +137,9 @@ int dawg_app::run() {
//bool split = (!vm["split"].defaulted()) ? arg.split : glopts.output_split;
//bool append = (!vm["append"].defaulted()) ? arg.append : glopts.output_append;

bool split = arg.split || (indeterminate(arg.split) && glopts.output_split);
bool append = arg.append || (indeterminate(arg.append) && glopts.output_append);
bool label = arg.label || (indeterminate(arg.label) && glopts.output_label);
bool split = arg.split.value_or(glopts.output_split);
bool append = arg.append.value_or(glopts.output_append);
bool label = arg.label.value_or(glopts.output_label);

if(!write_aln.open(file_name, num_reps-1, split, append, label)) {
DAWG_ERROR("bad configuration");
@@ -30,9 +30,9 @@ XM((help), , "display help message", bool, DL(false, "off"))
XM((output), (o), "output to this file", std::string, std::string())
XM((seed), , "PRNG seed", unsigned int, 0)
XM((reps), , "the number of alignments to generate", unsigned int, 0)
XM((split), , "split output into separate files", boost::tribool, DL(boost::indeterminate, "null"))
XM((append), , "append output to file", boost::tribool, DL(boost::indeterminate, "null"))
XM((label), , "label each simulation with a unique id", boost::tribool, DL(boost::indeterminate, "null"))
XM((split), , "split output into separate files", boost::optional<bool>, DL(boost::none, "not defined"))
XM((append), , "append output to file", boost::optional<bool>, DL(boost::none, "not defined"))
XM((label), , "label each simulation with a unique id", boost::optional<bool>, DL(boost::none, "not defined"))

XM((arg)(file), , "read arguments from file", std::string, std::string(""))

0 comments on commit 6a27c78

Please sign in to comment.
You can’t perform that action at this time.