--- trunk/SHAPES/visualizer.cpp 2004/06/28 23:05:25 1315 +++ trunk/SHAPES/visualizer.cpp 2004/07/20 20:22:43 1361 @@ -32,10 +32,10 @@ int main(int argc, char* argv[]){ if (cmdline_parser (argc, argv, &args_info) != 0) exit(1) ; - if (args_info.shape_given){ - shapeFileName = args_info.shape_arg; - } - else{ + + if (args_info.inputs_num > 0) { + shapeFileName = args_info.inputs[0]; + } else { std::cerr << "Does not have shape file name" << endl; exit(1); } @@ -43,14 +43,14 @@ int main(int argc, char* argv[]){ shape = new SHAPE(); shape->readSHAPEfile(shapeFileName); - - if (args_info.output_given){ - outputFileName = args_info.output_arg; + if (args_info.inputs_num > 1) { + outputFileName = args_info.inputs[1]; + } else { + std::cerr << "No output file name specified." << endl; + outputFileName = strdup(shapeFileName); + strcat(outputFileName, ".viz"); + std::cerr << "Using: " << outputFileName << endl; } - else{ - std::cerr << "Does not have output file name" << endl; - exit(1); - } outputFile = fopen(outputFileName, "w");