projects
/
selector.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1010fbd
)
*** empty log message ***
author
Francois Fleuret
<francois@fleuret.org>
Thu, 12 Mar 2009 13:54:27 +0000
(14:54 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Thu, 12 Mar 2009 13:54:27 +0000
(14:54 +0100)
selector.cc
patch
|
blob
|
history
diff --git
a/selector.cc
b/selector.cc
index
f1b4ad8
..
d719c1a
100644
(file)
--- 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];
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;
strcpy(output_filename, "/tmp/selector.out");
int i = 1;
@@
-327,7
+327,15
@@
int main(int argc, char **argv) {
}
else {
}
else {
- cerr << argv[0] << " [-h] [-o <output filename>] [-b] [-l <max number of lines>] [-s <pattern separator>] [-v]" << endl;
+ cerr << argv[0]
+ << " [-h]"
+ << " [-b]"
+ << " [-v]"
+ << " [-o <output filename>]"
+ << " [-s <pattern separator>]"
+ << " [-l <max number of lines>]"
+ << " -f <input filename>"
+ << endl;
if(strcmp(argv[i], "-h") == 0) {
exit(0);
} else {
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()) {
ifstream file(input_filename);
if(file.fail()) {