Fossil SCM
Listed the actual differences between fossil grep options and those defined by POSIX in www/grep.md.
Commit
d5499091eed2757ccf8e93e502236517ba9605fbca5625e14d5231be3add77ed
Parent
9fc411ab58e4dac…
1 file changed
+31
-6
+31
-6
| --- www/grep.md | ||
| +++ www/grep.md | ||
| @@ -16,17 +16,42 @@ | ||
| 16 | 16 | |--------|------------------------------------------------------------- |
| 17 | 17 | | `-i` | ignore case in matches |
| 18 | 18 | | `-l` | list a checkin ID prefix for matching historical versions of the file |
| 19 | 19 | | `-v` | print each checkin ID considered, regardless of whether it matches |
| 20 | 20 | |
| 21 | -No equivalent of other POSIX `grep` options currently exist. | |
| 21 | +That leaves many divergences at the option level from POSIX `grep`: | |
| 22 | + | |
| 23 | +* There is no built-in way to get a count of matches, as with `grep | |
| 24 | + -c`. | |
| 25 | + | |
| 26 | +* You cannot give more than one pattern, as with `grep -e` or `grep | |
| 27 | + -f`. | |
| 28 | + | |
| 29 | +* There is no equivalent of `grep -F` to do literal fixed-string | |
| 30 | + matches only. | |
| 31 | + | |
| 32 | +* `fossil grep -l` does not do precisely the same thing as POSIX | |
| 33 | + `grep -l`: it lists checkin ID prefixes, not file names. | |
| 34 | + | |
| 35 | +* Fossil always gives the line number in its output, which is to say | |
| 36 | + that it acts like `grep -n`. There is no way to disable the line | |
| 37 | + number in `fossil grep` output. | |
| 38 | + | |
| 39 | +* There is no way to suppress all output, returning only a status code | |
| 40 | + to indicate whether the pattern matched, as with `grep -q`. | |
| 41 | + | |
| 42 | +* There is no way to suppress error output, as with `grep -s`. | |
| 43 | + | |
| 44 | +* Fossil `grep` accepts only a single input file name. You cannot give | |
| 45 | + it a list of file names, and you cannot give it a directory name for | |
| 46 | + Fossil to expand to the set of all files under that directory. This | |
| 47 | + means Fossil `grep` has no equivalent of the common POSIX `grep -R` | |
| 48 | + extension. (And if it did, it would probably have a different option | |
| 49 | + letter, since `-R` in Fossil has a different meaning, by | |
| 50 | + convention.) | |
| 22 | 51 | |
| 23 | -Note in partcicular that there is no equivalent of `grep -R`, either | |
| 24 | -implicitly or explicitly. Fossil `grep` currently accepts only a single | |
| 25 | -input file name. You cannot give it a list of file names, and you cannot | |
| 26 | -give it a directory name for Fossil to expand to the set of all files | |
| 27 | -under that directory. | |
| 52 | +* You cannot invert the match, as with `grep -v`. | |
| 28 | 53 | |
| 29 | 54 | Patches to remove those limitations will be thoughtfully considered. |
| 30 | 55 | |
| 31 | 56 | |
| 32 | 57 | ## Regular Expression Dialect |
| 33 | 58 |
| --- www/grep.md | |
| +++ www/grep.md | |
| @@ -16,17 +16,42 @@ | |
| 16 | |--------|------------------------------------------------------------- |
| 17 | | `-i` | ignore case in matches |
| 18 | | `-l` | list a checkin ID prefix for matching historical versions of the file |
| 19 | | `-v` | print each checkin ID considered, regardless of whether it matches |
| 20 | |
| 21 | No equivalent of other POSIX `grep` options currently exist. |
| 22 | |
| 23 | Note in partcicular that there is no equivalent of `grep -R`, either |
| 24 | implicitly or explicitly. Fossil `grep` currently accepts only a single |
| 25 | input file name. You cannot give it a list of file names, and you cannot |
| 26 | give it a directory name for Fossil to expand to the set of all files |
| 27 | under that directory. |
| 28 | |
| 29 | Patches to remove those limitations will be thoughtfully considered. |
| 30 | |
| 31 | |
| 32 | ## Regular Expression Dialect |
| 33 |
| --- www/grep.md | |
| +++ www/grep.md | |
| @@ -16,17 +16,42 @@ | |
| 16 | |--------|------------------------------------------------------------- |
| 17 | | `-i` | ignore case in matches |
| 18 | | `-l` | list a checkin ID prefix for matching historical versions of the file |
| 19 | | `-v` | print each checkin ID considered, regardless of whether it matches |
| 20 | |
| 21 | That leaves many divergences at the option level from POSIX `grep`: |
| 22 | |
| 23 | * There is no built-in way to get a count of matches, as with `grep |
| 24 | -c`. |
| 25 | |
| 26 | * You cannot give more than one pattern, as with `grep -e` or `grep |
| 27 | -f`. |
| 28 | |
| 29 | * There is no equivalent of `grep -F` to do literal fixed-string |
| 30 | matches only. |
| 31 | |
| 32 | * `fossil grep -l` does not do precisely the same thing as POSIX |
| 33 | `grep -l`: it lists checkin ID prefixes, not file names. |
| 34 | |
| 35 | * Fossil always gives the line number in its output, which is to say |
| 36 | that it acts like `grep -n`. There is no way to disable the line |
| 37 | number in `fossil grep` output. |
| 38 | |
| 39 | * There is no way to suppress all output, returning only a status code |
| 40 | to indicate whether the pattern matched, as with `grep -q`. |
| 41 | |
| 42 | * There is no way to suppress error output, as with `grep -s`. |
| 43 | |
| 44 | * Fossil `grep` accepts only a single input file name. You cannot give |
| 45 | it a list of file names, and you cannot give it a directory name for |
| 46 | Fossil to expand to the set of all files under that directory. This |
| 47 | means Fossil `grep` has no equivalent of the common POSIX `grep -R` |
| 48 | extension. (And if it did, it would probably have a different option |
| 49 | letter, since `-R` in Fossil has a different meaning, by |
| 50 | convention.) |
| 51 | |
| 52 | * You cannot invert the match, as with `grep -v`. |
| 53 | |
| 54 | Patches to remove those limitations will be thoughtfully considered. |
| 55 | |
| 56 | |
| 57 | ## Regular Expression Dialect |
| 58 |