X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=grep.cpp;h=0a3cd8d236bb7ebd8c96c7953fc5ad6d2ebff339;hp=8c369a56f0c2fb3834c9d3ba5b0eed998ed92e67;hb=7735d609f5ecc2ae924d82c1395f028df9cfabd9;hpb=f3afcce30a6213fedba4330a5c0b1edc5b528b70 diff --git a/grep.cpp b/grep.cpp index 8c369a5..0a3cd8d 100644 --- a/grep.cpp +++ b/grep.cpp @@ -1,28 +1,35 @@ /* $Id$ */ #include #include -#include "regex.h" +#include +#include using namespace std; using namespace Msp; int main(int argc, char **argv) { - if(argc<2) + bool debug=false; + GetOpt getopt; + getopt.add_option('d', "debug", debug, GetOpt::NO_ARG); + getopt(argc, argv); + + const vector &args=getopt.get_args(); + + if(args.empty()) { cerr<<"Usage: "<\n"; return 1; } - Regex regex(argv[1]); - cout<