From: Mikko Rasa Date: Wed, 20 Jun 2007 20:19:10 +0000 (+0000) Subject: Add a simple grep program X-Git-Tag: strings-1.0~15 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=f3afcce30a6213fedba4330a5c0b1edc5b528b70;p=libs%2Fcore.git Add a simple grep program --- diff --git a/Build b/Build index 8a7d481..688fe61 100644 --- a/Build +++ b/Build @@ -10,4 +10,15 @@ package "mspstrings" install true; install_headers "msp/strings"; }; + + program "grep" + { + source "grep.cpp"; + build_info + { + incpath "source"; + libpath "."; + library "mspstrings"; + }; + }; }; diff --git a/grep.cpp b/grep.cpp new file mode 100644 index 0000000..8c369a5 --- /dev/null +++ b/grep.cpp @@ -0,0 +1,29 @@ +/* $Id$ */ +#include +#include +#include "regex.h" + +using namespace std; +using namespace Msp; + +int main(int argc, char **argv) +{ + if(argc<2) + { + cerr<<"Usage: "<\n"; + return 1; + } + + Regex regex(argv[1]); + cout<