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