changed highlighter behaviour when no input file is given
This commit is contained in:
parent
2d1c077303
commit
6dbb31179a
|
@ -4,12 +4,14 @@
|
|||
#include <fstream>
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
ConsoleHighlighter *highlighter;
|
||||
if(argc == 2) {
|
||||
std::ifstream in(argv[1]);
|
||||
ConsoleHighlighter highlighter(in);
|
||||
highlighter.highlight(std::cout);
|
||||
highlighter = new ConsoleHighlighter(in);
|
||||
} else {
|
||||
std::cout << "Usage: " << argv[0] << " <filename.xml>\n";
|
||||
highlighter = new ConsoleHighlighter(std::cin);
|
||||
}
|
||||
highlighter->highlight(std::cout);
|
||||
delete highlighter;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue