From: Francois Fleuret Date: Thu, 12 Mar 2009 13:54:27 +0000 (+0100) Subject: *** empty log message *** X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=9073cafb7f527ce4cd460c82bbd49ee78768b566;p=selector.git *** empty log message *** --- diff --git a/selector.cc b/selector.cc index f1b4ad8..d719c1a 100644 --- a/selector.cc +++ b/selector.cc @@ -287,7 +287,7 @@ int main(int argc, char **argv) { int no_blink = 0; char input_filename[buffer_size], output_filename[buffer_size]; - strcpy(input_filename, "/dev/stdin"); + strcpy(input_filename, ""); strcpy(output_filename, "/tmp/selector.out"); int i = 1; @@ -327,7 +327,15 @@ int main(int argc, char **argv) { } else { - cerr << argv[0] << " [-h] [-o ] [-b] [-l ] [-s ] [-v]" << endl; + cerr << argv[0] + << " [-h]" + << " [-b]" + << " [-v]" + << " [-o ]" + << " [-s ]" + << " [-l ]" + << " -f " + << endl; if(strcmp(argv[i], "-h") == 0) { exit(0); } else { @@ -336,6 +344,11 @@ int main(int argc, char **argv) { } } + if(!input_filename[0]) { + cerr << "You must specify a input file with -f." << endl; + exit(1); + } + ifstream file(input_filename); if(file.fail()) {