tools/dimacs-to-lgf.cc
changeset 1177 3c00344f49c9
parent 584 33c6b6e755cd
equal deleted inserted replaced
5:aaef048a2936 6:9185d6353e3a
    71     case 2:
    71     case 2:
    72       output.open(ap.files()[1].c_str());
    72       output.open(ap.files()[1].c_str());
    73       if (!output) {
    73       if (!output) {
    74         throw IoError("Cannot open the file for writing", ap.files()[1]);
    74         throw IoError("Cannot open the file for writing", ap.files()[1]);
    75       }
    75       }
       
    76       // fall through
    76     case 1:
    77     case 1:
    77       input.open(ap.files()[0].c_str());
    78       input.open(ap.files()[0].c_str());
    78       if (!input) {
    79       if (!input) {
    79         throw IoError("File cannot be found", ap.files()[0]);
    80         throw IoError("File cannot be found", ap.files()[0]);
    80       }
    81       }
       
    82       // fall through
    81     case 0:
    83     case 0:
    82       break;
    84       break;
    83     default:
    85     default:
    84       cerr << ap.commandName() << ": too many arguments\n";
    86       cerr << ap.commandName() << ": too many arguments\n";
    85       return 1;
    87       return 1;