X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=grep.cpp;h=c87ee72171615ec8056adcf687f8f0e74d78b621;hp=8c369a56f0c2fb3834c9d3ba5b0eed998ed92e67;hb=82f9f26dde92ea0e9714fd8878db8dad186ce7af;hpb=f3afcce30a6213fedba4330a5c0b1edc5b528b70 diff --git a/grep.cpp b/grep.cpp index 8c369a5..c87ee72 100644 --- a/grep.cpp +++ b/grep.cpp @@ -1,28 +1,34 @@ -/* $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<