diff -r 030f1015f898 -r 01707a8a4ca6 demo/coloring.cc --- a/demo/coloring.cc Fri Jul 15 14:35:07 2005 +0000 +++ b/demo/coloring.cc Fri Jul 15 16:01:55 2005 +0000 @@ -5,10 +5,26 @@ #include #include +#include +#include + + using namespace std; using namespace lemon; -int main() { +int main(int argc, char *argv[]) +{ + if(argc<2) + { + std::cerr << "USAGE: coloring " << std::endl; + std::cerr << "The file 'input_file.lgf' has to contain a graph in LEMON format together with a nodemap called 'coords' to draw the graph (e.g. sample.lgf is not such a file)." << std::endl; + return 0; + } + + + //input stream to read the graph from + std::ifstream is(argv[1]); + typedef UndirSmartGraph Graph; typedef Graph::Node Node; typedef Graph::NodeIt NodeIt; @@ -17,7 +33,7 @@ Graph graph; - UndirGraphReader reader(std::cin, graph); + UndirGraphReader reader(is, graph); Graph::NodeMap > coords(graph); reader.readNodeMap("coords", coords);