From 892f7a2489d4451b770b241b1cb637e8871fa864 Mon Sep 17 00:00:00 2001 From: "Gary R. Van Sickle" Date: Sat, 17 Oct 2015 15:16:17 -0500 Subject: [PATCH 1/8] - Improved README.md. --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fc4016bd..4914bf5b 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,34 @@ UniversalCodeGrep (ucg) is another [Ack](http://beyondgrep.com/) clone. It is a Ucg is written in C++ and takes advantage of the C++11 and newer facilities of the language to reduce reliance on non-standard libraries, increase portability, and increase scanning speed. +## License + +[GPL (Version 3 only)](https://github.com/gvansickle/ucg/blob/master/COPYING) ## Installation -[@TODO - No releases yet.] +UniversalCodeGrep installs from the source tarball in the standard autotools manner: + +```sh +tar -xaf +cd +./configure +make +make install +``` + +This will install the `ucg` executable in `/usr/local/bin`. If you wish to install it elsewhere or don't have permissions on `/usr/local/bin`, specify an installation prefix on the `./configure` command line: + +```sh +./configure --prefix=~/ +``` ### Prerequisites - gcc version 4.9 or greater. + +Versions of gcc prior to 4.9 are known to ship with an incomplete implementation of the standard library. + +## Author + +Gary R. Van Sickle From 089b95153fb7e2ca976a43054d9b78250d543c2e Mon Sep 17 00:00:00 2001 From: "Gary R. Van Sickle" Date: Sat, 17 Oct 2015 16:16:40 -0500 Subject: [PATCH 2/8] - #if 0'ed out "File inclusion/exclusion:" options, since they're not implemented yet. - More work on README.md. --- README.md | 18 +++++++++++++++--- src/ArgParse.cpp | 2 ++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4914bf5b..3c87178a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ UniversalCodeGrep (ucg) is another [Ack](http://beyondgrep.com/) clone. It is a grep-like tool specialized for searching large bodies of source code. -Ucg is written in C++ and takes advantage of the C++11 and newer facilities of the language to reduce reliance on non-standard libraries, increase portability, and increase scanning speed. +`ucg` is written in C++ and takes advantage of the C++11 and newer facilities of the language to reduce reliance on non-standard libraries, increase portability, and increase scanning speed. ## License @@ -28,9 +28,21 @@ This will install the `ucg` executable in `/usr/local/bin`. If you wish to inst ### Prerequisites -- gcc version 4.9 or greater. +- `gcc` version 4.9 or greater. + +Versions of `gcc` prior to 4.9 are known to ship with an incomplete implementation of the standard `` library. Since `ucg` depends on this C++11 feature, `configure` attempts to detect a broken `` at configure-time. + +### Supported OSes and Distributions + +UniversalCodeGrep should build and function anywhere there's a `gcc` 4.9 or greater available. It has been tested on the following OSes/distros: + +- Linux + - Ubuntu 15.04 (with gcc 4.9.2, the current default compiler on this distro) +- Windows 7 + Cygwin 64-bit (with gcc 4.9.3, the current default compiler on this distro) + +## Usage + -Versions of gcc prior to 4.9 are known to ship with an incomplete implementation of the standard library. ## Author diff --git a/src/ArgParse.cpp b/src/ArgParse.cpp index d3196050..0876b297 100644 --- a/src/ArgParse.cpp +++ b/src/ArgParse.cpp @@ -67,9 +67,11 @@ static struct argp_option options[] = { {"colour", OPT_COLOR, 0, OPTION_ALIAS }, {"nocolor", OPT_NOCOLOR, 0, 0, "Render the output without ANSI color codes."}, {"nocolour", OPT_NOCOLOR, 0, OPTION_ALIAS }, +#if 0 /// @todo Put this back in, add the functionality. {0,0,0,0, "File inclusion/exclusion:"}, {"ignore-dir", OPT_IGNORE_DIR, "REGEX", 0, "Exclude directories matching this regex pattern."}, {"noignore-dir", OPT_NOIGNORE_DIR, "REGEX", 0, "Do not exclude directories matching this regex pattern."}, +#endif {0,0,0,0, "Miscellaneous:" }, {"jobs", 'j', "NUM_JOBS", 0, "Number of scanner jobs (std::thread<>s) to use" }, { 0 } From 9b82f8682cc409c613167ca267331df37d423943 Mon Sep 17 00:00:00 2001 From: "Gary R. Van Sickle" Date: Sat, 17 Oct 2015 16:40:35 -0500 Subject: [PATCH 3/8] - Added speed comparison to README.md. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 3c87178a..3c612f8d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,14 @@ UniversalCodeGrep (ucg) is another [Ack](http://beyondgrep.com/) clone. It is a `ucg` is written in C++ and takes advantage of the C++11 and newer facilities of the language to reduce reliance on non-standard libraries, increase portability, and increase scanning speed. +As a consequence of `ucg`'s use of these facilities and its overall design for maximum concurrency and speed, `ucg` is extremely fast. Under Ubuntu 15.04, scanning the Boost 1.58.0 source tree with `ucg` 0.1.0, [`ag`](http://geoff.greer.fm/ag/) 0.28.0, and `ack` 2.14 produces the following results: + +| Command | Approximate Real Time | +|---------|-----------------------| +| time ucg '#endif' ~/src/boost_1_58_0 | ~ 3 seconds | +| time ag '#endif' ~/src/boost_1_58_0 | ~ 10 seconds | +| time ack '#endif' ~/src/boost_1_58_0 | ~ 19 seconds | + ## License [GPL (Version 3 only)](https://github.com/gvansickle/ucg/blob/master/COPYING) From 2f5c06b901773b2ecf5cbf9605c12783d0751fd5 Mon Sep 17 00:00:00 2001 From: "Gary R. Van Sickle" Date: Sat, 17 Oct 2015 16:42:20 -0500 Subject: [PATCH 4/8] - Cleaned up speed table formatting. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3c612f8d..a1b383d6 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ As a consequence of `ucg`'s use of these facilities and its overall design for m | Command | Approximate Real Time | |---------|-----------------------| -| time ucg '#endif' ~/src/boost_1_58_0 | ~ 3 seconds | -| time ag '#endif' ~/src/boost_1_58_0 | ~ 10 seconds | -| time ack '#endif' ~/src/boost_1_58_0 | ~ 19 seconds | +| `time ucg '#endif' ~/src/boost_1_58_0` | ~ 3 seconds | +| `time ag '#endif' ~/src/boost_1_58_0` | ~ 10 seconds | +| `time ack '#endif' ~/src/boost_1_58_0` | ~ 19 seconds | ## License From 7601ee9ffa48d2a2c12644cb138dd8bcc2316604 Mon Sep 17 00:00:00 2001 From: "Gary R. Van Sickle" Date: Sun, 18 Oct 2015 13:35:06 -0500 Subject: [PATCH 5/8] - Added usage documentation. --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index a1b383d6..76b403d7 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,29 @@ UniversalCodeGrep should build and function anywhere there's a `gcc` 4.9 or grea ## Usage +Invoking `ucg` is the same as with `ack`: +```sh +ucg [OPTION...] PATTERN [FILES OR DIRECTORIES] +``` + +...where `PATTERN` is an ECMAScript-compatible regular expression. + +If no `FILES OR DIRECTORIES` are specified, searching starts in the current directory. + +### Options + +Version 0.1.0 of `ucg` only supports a small subset of the options supported by `ack`. Future releases will have support for more options. + +#### Searching +|----------------------|------------------------------------------| +| `-i, --ignore-case` | Ignore case distinctions in PATTERN | +|----------------------|------------------------------------------| + +#### File presentation + +| `--color, --colour` | Render the output with ANSI color codes. | +| `--nocolor, --nocolour` | Render the output without ANSI color codes. | ## Author From 853cab0ea0132db726286d81e180314e741c0fa4 Mon Sep 17 00:00:00 2001 From: "Gary R. Van Sickle" Date: Sun, 18 Oct 2015 13:38:46 -0500 Subject: [PATCH 6/8] - Corrected formatting. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 76b403d7..4e1888de 100644 --- a/README.md +++ b/README.md @@ -65,12 +65,16 @@ If no `FILES OR DIRECTORIES` are specified, searching starts in the current dire Version 0.1.0 of `ucg` only supports a small subset of the options supported by `ack`. Future releases will have support for more options. #### Searching + +| Option | Description | |----------------------|------------------------------------------| | `-i, --ignore-case` | Ignore case distinctions in PATTERN | -|----------------------|------------------------------------------| + #### File presentation +| Option | Description | +|----------------------|------------------------------------------| | `--color, --colour` | Render the output with ANSI color codes. | | `--nocolor, --nocolour` | Render the output without ANSI color codes. | From 2b569663bf2ffcab7b604ed1fe43ff42abc66bc8 Mon Sep 17 00:00:00 2001 From: "Gary R. Van Sickle" Date: Sun, 18 Oct 2015 13:50:18 -0500 Subject: [PATCH 7/8] - "source" -> "distribution". --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e1888de..a26e07dc 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ As a consequence of `ucg`'s use of these facilities and its overall design for m ## Installation -UniversalCodeGrep installs from the source tarball in the standard autotools manner: +UniversalCodeGrep installs from the distribution tarball in the standard autotools manner: ```sh tar -xaf From bea011edf2213b091c1e170d5c1c60df518526b0 Mon Sep 17 00:00:00 2001 From: "Gary R. Van Sickle" Date: Sun, 18 Oct 2015 14:00:51 -0500 Subject: [PATCH 8/8] - Added link to distribution tarball. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a26e07dc..5114412c 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,11 @@ As a consequence of `ucg`'s use of these facilities and its overall design for m ## Installation -UniversalCodeGrep installs from the distribution tarball in the standard autotools manner: +UniversalCodeGrep installs from the distribution tarball (available [here](https://github.com/gvansickle/ucg/releases/download/0.1.0/universalcodegrep-0.1.0.tar.gz)) in the standard autotools manner: ```sh -tar -xaf -cd +tar -xaf universalcodegrep-0.1.0.tar.gz +cd universalcodegrep-0.1.0.tar.gz ./configure make make install