X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=grep.cpp;h=68ecf874f46b919306c703f5e6fc07c2af4b5249;hp=8c369a56f0c2fb3834c9d3ba5b0eed998ed92e67;hb=refs%2Fheads%2Fstrings-master;hpb=f3afcce30a6213fedba4330a5c0b1edc5b528b70 diff --git a/grep.cpp b/grep.cpp index 8c369a5..68ecf87 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<