Skip to content

Commit 42e4789

Browse files
committed
Account for conditional command line output in case of no results
1 parent c682af8 commit 42e4789

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

include/word-log.hpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,14 @@ struct Word_Log
4545
return a;
4646
};
4747

48-
cout << "Word: " << word << endl << endl;
49-
for (auto i: posGroups) {
50-
for (auto itr: i.prettySenses)
51-
itr.consoleDump();
52-
}
48+
if (posGroups.size() != 0) {
49+
cout << "Word: " << word << endl << endl;
50+
for (auto i: posGroups) {
51+
for (auto itr: i.prettySenses)
52+
itr.consoleDump();
53+
}
54+
} else
55+
cout << "No results found for `" << word << "` :\\" << endl << endl;
5356
}
5457
};
5558

0 commit comments

Comments
 (0)