Skip to content

Commit

Permalink
Make a vector of possible output formats
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Jan 9, 2024
1 parent 6d05ef6 commit 3a03a72
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tools/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,12 @@ int main(int argc, char **argv)
exit(1);
}

if ((outformat != "svg") && (outformat != "mei") && (outformat != "mei-basic") && (outformat != "mei-pb")
&& (outformat != "mei-facs") && (outformat != "midi") && (outformat != "timemap")
&& (outformat != "expansionmap") && (outformat != "humdrum") && (outformat != "hum") && (outformat != "pae")) {
const std::vector<std::string> outformats = { "mei", "mei-basic", "mei-pb", "mei-facs", "svg", "midi", "timemap",
"expansionmap", "humdrum", "hum", "pae" };
if (std::find(outformats.begin(), outformats.end(), outformat) == outformats.end()) {
std::cerr << "Output format (" << outformat
<< ") can only be 'mei', 'mei-basic', 'mei-pb', mei-facs', 'svg', 'midi', 'timemap', 'expansionmap', "
"'humdrum' "
"or 'pae'."
"'humdrum', 'hum', or 'pae'."
<< std::endl;
exit(1);
}
Expand Down

0 comments on commit 3a03a72

Please sign in to comment.