Skip to content

Commit

Permalink
Allow myank -l when there are no measure numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangDrescher committed Nov 30, 2023
1 parent 8310dab commit 83d17e1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions min/humlib.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Programmer: Craig Stuart Sapp <[email protected]>
// Creation Date: Sat Aug 8 12:24:49 PDT 2015
// Last Modified: Do 30 Nov 2023 08:29:32 CET
// Last Modified: Do 30 Nov 2023 12:59:09 CET
// Filename: min/humlib.cpp
// URL: https://github.com/craigsapp/humlib/blob/master/min/humlib.cpp
// Syntax: C++11
Expand Down Expand Up @@ -106021,6 +106021,15 @@ void Tool_myank::getMeasureStartStop(vector<MeasureInfo>& measurelist, HumdrumFi
measurelist.push_back(current);
}

// allow "myank -l" when there are no measure numbers
if (getBoolean("lines") && measurelist.size() == 0) {
current.clear();
current.num = 0;
current.start = 0;
current.stop = dataend;
current.file = &infile;
measurelist.push_back(current);
}

}

Expand Down Expand Up @@ -106189,7 +106198,7 @@ void Tool_myank::expandMeasureOutList(vector<MeasureInfo>& measureout,
minmeasure = measurein[i].num;
}
}
if (maxmeasure <= 0) {
if (maxmeasure <= 0 && !getBoolean("lines")) {
cerr << "Error: There are no measure numbers present in the data" << endl;
exit(1);
}
Expand Down
2 changes: 1 addition & 1 deletion min/humlib.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Programmer: Craig Stuart Sapp <[email protected]>
// Creation Date: Sat Aug 8 12:24:49 PDT 2015
// Last Modified: Do 30 Nov 2023 08:29:32 CET
// Last Modified: Do 30 Nov 2023 12:59:09 CET
// Filename: min/humlib.h
// URL: https://github.com/craigsapp/humlib/blob/master/min/humlib.h
// Syntax: C++11
Expand Down
11 changes: 10 additions & 1 deletion src/tool-myank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1925,6 +1925,15 @@ void Tool_myank::getMeasureStartStop(vector<MeasureInfo>& measurelist, HumdrumFi
measurelist.push_back(current);
}

// allow "myank -l" when there are no measure numbers
if (getBoolean("lines") && measurelist.size() == 0) {
current.clear();
current.num = 0;
current.start = 0;
current.stop = dataend;
current.file = &infile;
measurelist.push_back(current);
}

}

Expand Down Expand Up @@ -2093,7 +2102,7 @@ void Tool_myank::expandMeasureOutList(vector<MeasureInfo>& measureout,
minmeasure = measurein[i].num;
}
}
if (maxmeasure <= 0) {
if (maxmeasure <= 0 && !getBoolean("lines")) {
cerr << "Error: There are no measure numbers present in the data" << endl;
exit(1);
}
Expand Down

0 comments on commit 83d17e1

Please sign in to comment.