Fossil SCM
Added -- support to (diff, finfo, grep, new). We can now grep for patterns which start with a dash.
Commit
639b2c183e216c28de5f218233243d86439ad908bf1f5fdeef904edf21055f34
Parent
ef763bcf08af754…
4 files changed
+5
-3
+4
-2
+6
-4
+5
-2
M
src/db.c
+5
-3
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2213,12 +2213,12 @@ | ||
| 2213 | 2213 | |
| 2214 | 2214 | /* |
| 2215 | 2215 | ** COMMAND: new* |
| 2216 | 2216 | ** COMMAND: init |
| 2217 | 2217 | ** |
| 2218 | -** Usage: %fossil new ?OPTIONS? FILENAME | |
| 2219 | -** or: %fossil init ?OPTIONS? FILENAME | |
| 2218 | +** Usage: %fossil new ?OPTIONS? ?--? FILENAME | |
| 2219 | +** or: %fossil init ?OPTIONS? ?--? FILENAME | |
| 2220 | 2220 | ** |
| 2221 | 2221 | ** Create a repository for a new project in the file named FILENAME. |
| 2222 | 2222 | ** This command is distinct from "clone". The "clone" command makes |
| 2223 | 2223 | ** a copy of an existing project. This command starts a new project. |
| 2224 | 2224 | ** |
| @@ -2238,10 +2238,12 @@ | ||
| 2238 | 2238 | ** Options: |
| 2239 | 2239 | ** --template FILE Copy settings from repository file |
| 2240 | 2240 | ** --admin-user|-A USERNAME Select given USERNAME as admin user |
| 2241 | 2241 | ** --date-override DATETIME Use DATETIME as time of the initial check-in |
| 2242 | 2242 | ** --sha1 Use a initial hash policy of "sha1" |
| 2243 | +** -- Treat all following arguments as files, | |
| 2244 | +** even if they look like flags. | |
| 2243 | 2245 | ** |
| 2244 | 2246 | ** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in |
| 2245 | 2247 | ** year-month-day form, it may be truncated, the "T" may be replaced by |
| 2246 | 2248 | ** a space, and it may also name a timezone offset from UTC as "-HH:MM" |
| 2247 | 2249 | ** (westward) or "+HH:MM" (eastward). Either no timezone suffix or "Z" |
| @@ -2260,11 +2262,11 @@ | ||
| 2260 | 2262 | zTemplate = find_option("template",0,1); |
| 2261 | 2263 | zDate = find_option("date-override",0,1); |
| 2262 | 2264 | zDefaultUser = find_option("admin-user","A",1); |
| 2263 | 2265 | bUseSha1 = find_option("sha1",0,0)!=0; |
| 2264 | 2266 | /* We should be done with options.. */ |
| 2265 | - verify_all_options(); | |
| 2267 | + verify_all_options2(); | |
| 2266 | 2268 | |
| 2267 | 2269 | if( g.argc!=3 ){ |
| 2268 | 2270 | usage("REPOSITORY-NAME"); |
| 2269 | 2271 | } |
| 2270 | 2272 | |
| 2271 | 2273 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2213,12 +2213,12 @@ | |
| 2213 | |
| 2214 | /* |
| 2215 | ** COMMAND: new* |
| 2216 | ** COMMAND: init |
| 2217 | ** |
| 2218 | ** Usage: %fossil new ?OPTIONS? FILENAME |
| 2219 | ** or: %fossil init ?OPTIONS? FILENAME |
| 2220 | ** |
| 2221 | ** Create a repository for a new project in the file named FILENAME. |
| 2222 | ** This command is distinct from "clone". The "clone" command makes |
| 2223 | ** a copy of an existing project. This command starts a new project. |
| 2224 | ** |
| @@ -2238,10 +2238,12 @@ | |
| 2238 | ** Options: |
| 2239 | ** --template FILE Copy settings from repository file |
| 2240 | ** --admin-user|-A USERNAME Select given USERNAME as admin user |
| 2241 | ** --date-override DATETIME Use DATETIME as time of the initial check-in |
| 2242 | ** --sha1 Use a initial hash policy of "sha1" |
| 2243 | ** |
| 2244 | ** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in |
| 2245 | ** year-month-day form, it may be truncated, the "T" may be replaced by |
| 2246 | ** a space, and it may also name a timezone offset from UTC as "-HH:MM" |
| 2247 | ** (westward) or "+HH:MM" (eastward). Either no timezone suffix or "Z" |
| @@ -2260,11 +2262,11 @@ | |
| 2260 | zTemplate = find_option("template",0,1); |
| 2261 | zDate = find_option("date-override",0,1); |
| 2262 | zDefaultUser = find_option("admin-user","A",1); |
| 2263 | bUseSha1 = find_option("sha1",0,0)!=0; |
| 2264 | /* We should be done with options.. */ |
| 2265 | verify_all_options(); |
| 2266 | |
| 2267 | if( g.argc!=3 ){ |
| 2268 | usage("REPOSITORY-NAME"); |
| 2269 | } |
| 2270 | |
| 2271 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2213,12 +2213,12 @@ | |
| 2213 | |
| 2214 | /* |
| 2215 | ** COMMAND: new* |
| 2216 | ** COMMAND: init |
| 2217 | ** |
| 2218 | ** Usage: %fossil new ?OPTIONS? ?--? FILENAME |
| 2219 | ** or: %fossil init ?OPTIONS? ?--? FILENAME |
| 2220 | ** |
| 2221 | ** Create a repository for a new project in the file named FILENAME. |
| 2222 | ** This command is distinct from "clone". The "clone" command makes |
| 2223 | ** a copy of an existing project. This command starts a new project. |
| 2224 | ** |
| @@ -2238,10 +2238,12 @@ | |
| 2238 | ** Options: |
| 2239 | ** --template FILE Copy settings from repository file |
| 2240 | ** --admin-user|-A USERNAME Select given USERNAME as admin user |
| 2241 | ** --date-override DATETIME Use DATETIME as time of the initial check-in |
| 2242 | ** --sha1 Use a initial hash policy of "sha1" |
| 2243 | ** -- Treat all following arguments as files, |
| 2244 | ** even if they look like flags. |
| 2245 | ** |
| 2246 | ** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in |
| 2247 | ** year-month-day form, it may be truncated, the "T" may be replaced by |
| 2248 | ** a space, and it may also name a timezone offset from UTC as "-HH:MM" |
| 2249 | ** (westward) or "+HH:MM" (eastward). Either no timezone suffix or "Z" |
| @@ -2260,11 +2262,11 @@ | |
| 2262 | zTemplate = find_option("template",0,1); |
| 2263 | zDate = find_option("date-override",0,1); |
| 2264 | zDefaultUser = find_option("admin-user","A",1); |
| 2265 | bUseSha1 = find_option("sha1",0,0)!=0; |
| 2266 | /* We should be done with options.. */ |
| 2267 | verify_all_options2(); |
| 2268 | |
| 2269 | if( g.argc!=3 ){ |
| 2270 | usage("REPOSITORY-NAME"); |
| 2271 | } |
| 2272 | |
| 2273 |
+4
-2
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -780,11 +780,11 @@ | ||
| 780 | 780 | |
| 781 | 781 | /* |
| 782 | 782 | ** COMMAND: diff |
| 783 | 783 | ** COMMAND: gdiff |
| 784 | 784 | ** |
| 785 | -** Usage: %fossil diff|gdiff ?OPTIONS? ?FILE1? ?FILE2 ...? | |
| 785 | +** Usage: %fossil diff|gdiff ?OPTIONS? ?--? ?FILE1? ?FILE2 ...? | |
| 786 | 786 | ** |
| 787 | 787 | ** Show the difference between the current version of each of the FILEs |
| 788 | 788 | ** specified (as they exist on disk) and that same file as it was checked |
| 789 | 789 | ** out. Or if the FILE arguments are omitted, show the unsaved changes |
| 790 | 790 | ** currently in the working check-out. |
| @@ -839,10 +839,12 @@ | ||
| 839 | 839 | ** --unified Unified diff |
| 840 | 840 | ** -v|--verbose Output complete text of added or deleted files |
| 841 | 841 | ** -w|--ignore-all-space Ignore white space when comparing lines |
| 842 | 842 | ** -W|--width <num> Width of lines in side-by-side diff |
| 843 | 843 | ** -Z|--ignore-trailing-space Ignore changes to end-of-line whitespace |
| 844 | +** -- Treat all following arguments as files, | |
| 845 | +** even if they look like flags. | |
| 844 | 846 | */ |
| 845 | 847 | void diff_cmd(void){ |
| 846 | 848 | int isGDiff; /* True for gdiff. False for normal diff */ |
| 847 | 849 | int isInternDiff; /* True for internal diff */ |
| 848 | 850 | int verboseFlag; /* True if -v or --verbose flag is used */ |
| @@ -900,11 +902,11 @@ | ||
| 900 | 902 | if( zDiffCmd==0 ) zDiffCmd = diff_command_external(isGDiff); |
| 901 | 903 | } |
| 902 | 904 | zBinGlob = diff_get_binary_glob(); |
| 903 | 905 | fIncludeBinary = diff_include_binary_files(); |
| 904 | 906 | determine_exec_relative_option(1); |
| 905 | - verify_all_options(); | |
| 907 | + verify_all_options2(); | |
| 906 | 908 | if( g.argc>=3 ){ |
| 907 | 909 | int i; |
| 908 | 910 | Blob fname; |
| 909 | 911 | pFileDir = fossil_malloc( sizeof(*pFileDir) * (g.argc-1) ); |
| 910 | 912 | memset(pFileDir, 0, sizeof(*pFileDir) * (g.argc-1)); |
| 911 | 913 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -780,11 +780,11 @@ | |
| 780 | |
| 781 | /* |
| 782 | ** COMMAND: diff |
| 783 | ** COMMAND: gdiff |
| 784 | ** |
| 785 | ** Usage: %fossil diff|gdiff ?OPTIONS? ?FILE1? ?FILE2 ...? |
| 786 | ** |
| 787 | ** Show the difference between the current version of each of the FILEs |
| 788 | ** specified (as they exist on disk) and that same file as it was checked |
| 789 | ** out. Or if the FILE arguments are omitted, show the unsaved changes |
| 790 | ** currently in the working check-out. |
| @@ -839,10 +839,12 @@ | |
| 839 | ** --unified Unified diff |
| 840 | ** -v|--verbose Output complete text of added or deleted files |
| 841 | ** -w|--ignore-all-space Ignore white space when comparing lines |
| 842 | ** -W|--width <num> Width of lines in side-by-side diff |
| 843 | ** -Z|--ignore-trailing-space Ignore changes to end-of-line whitespace |
| 844 | */ |
| 845 | void diff_cmd(void){ |
| 846 | int isGDiff; /* True for gdiff. False for normal diff */ |
| 847 | int isInternDiff; /* True for internal diff */ |
| 848 | int verboseFlag; /* True if -v or --verbose flag is used */ |
| @@ -900,11 +902,11 @@ | |
| 900 | if( zDiffCmd==0 ) zDiffCmd = diff_command_external(isGDiff); |
| 901 | } |
| 902 | zBinGlob = diff_get_binary_glob(); |
| 903 | fIncludeBinary = diff_include_binary_files(); |
| 904 | determine_exec_relative_option(1); |
| 905 | verify_all_options(); |
| 906 | if( g.argc>=3 ){ |
| 907 | int i; |
| 908 | Blob fname; |
| 909 | pFileDir = fossil_malloc( sizeof(*pFileDir) * (g.argc-1) ); |
| 910 | memset(pFileDir, 0, sizeof(*pFileDir) * (g.argc-1)); |
| 911 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -780,11 +780,11 @@ | |
| 780 | |
| 781 | /* |
| 782 | ** COMMAND: diff |
| 783 | ** COMMAND: gdiff |
| 784 | ** |
| 785 | ** Usage: %fossil diff|gdiff ?OPTIONS? ?--? ?FILE1? ?FILE2 ...? |
| 786 | ** |
| 787 | ** Show the difference between the current version of each of the FILEs |
| 788 | ** specified (as they exist on disk) and that same file as it was checked |
| 789 | ** out. Or if the FILE arguments are omitted, show the unsaved changes |
| 790 | ** currently in the working check-out. |
| @@ -839,10 +839,12 @@ | |
| 839 | ** --unified Unified diff |
| 840 | ** -v|--verbose Output complete text of added or deleted files |
| 841 | ** -w|--ignore-all-space Ignore white space when comparing lines |
| 842 | ** -W|--width <num> Width of lines in side-by-side diff |
| 843 | ** -Z|--ignore-trailing-space Ignore changes to end-of-line whitespace |
| 844 | ** -- Treat all following arguments as files, |
| 845 | ** even if they look like flags. |
| 846 | */ |
| 847 | void diff_cmd(void){ |
| 848 | int isGDiff; /* True for gdiff. False for normal diff */ |
| 849 | int isInternDiff; /* True for internal diff */ |
| 850 | int verboseFlag; /* True if -v or --verbose flag is used */ |
| @@ -900,11 +902,11 @@ | |
| 902 | if( zDiffCmd==0 ) zDiffCmd = diff_command_external(isGDiff); |
| 903 | } |
| 904 | zBinGlob = diff_get_binary_glob(); |
| 905 | fIncludeBinary = diff_include_binary_files(); |
| 906 | determine_exec_relative_option(1); |
| 907 | verify_all_options2(); |
| 908 | if( g.argc>=3 ){ |
| 909 | int i; |
| 910 | Blob fname; |
| 911 | pFileDir = fossil_malloc( sizeof(*pFileDir) * (g.argc-1) ); |
| 912 | memset(pFileDir, 0, sizeof(*pFileDir) * (g.argc-1)); |
| 913 |
+6
-4
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -21,11 +21,11 @@ | ||
| 21 | 21 | #include "finfo.h" |
| 22 | 22 | |
| 23 | 23 | /* |
| 24 | 24 | ** COMMAND: finfo |
| 25 | 25 | ** |
| 26 | -** Usage: %fossil finfo ?OPTIONS? FILENAME | |
| 26 | +** Usage: %fossil finfo ?OPTIONS? ?--? FILENAME | |
| 27 | 27 | ** |
| 28 | 28 | ** Print the complete change history for a single file going backwards |
| 29 | 29 | ** in time. The default mode is -l. |
| 30 | 30 | ** |
| 31 | 31 | ** For the -l|--log mode: If "-b|--brief" is specified one line per revision |
| @@ -53,10 +53,12 @@ | ||
| 53 | 53 | ** to stdout (only in print mode) |
| 54 | 54 | ** -s|--status select status mode (print a status indicator for FILE) |
| 55 | 55 | ** -W|--width <num> Width of lines (default is to auto-detect). Must be |
| 56 | 56 | ** >22 or 0 (= no limit, resulting in a single line per |
| 57 | 57 | ** entry). |
| 58 | +** -- Treat all following arguments as files, even if they | |
| 59 | +** look like flags. | |
| 58 | 60 | ** |
| 59 | 61 | ** See also: artifact, cat, descendants, info, leaves |
| 60 | 62 | */ |
| 61 | 63 | void finfo_cmd(void){ |
| 62 | 64 | db_must_be_within_tree(); |
| @@ -65,11 +67,11 @@ | ||
| 65 | 67 | Blob line; |
| 66 | 68 | Blob fname; |
| 67 | 69 | int vid; |
| 68 | 70 | |
| 69 | 71 | /* We should be done with options.. */ |
| 70 | - verify_all_options(); | |
| 72 | + verify_all_options2(); | |
| 71 | 73 | |
| 72 | 74 | if( g.argc!=3 ) usage("-s|--status FILENAME"); |
| 73 | 75 | vid = db_lget_int("checkout", 0); |
| 74 | 76 | if( vid==0 ){ |
| 75 | 77 | fossil_fatal("no checkout to finfo files in"); |
| @@ -120,11 +122,11 @@ | ||
| 120 | 122 | Blob record; |
| 121 | 123 | Blob fname; |
| 122 | 124 | const char *zRevision = find_option("revision", "r", 1); |
| 123 | 125 | |
| 124 | 126 | /* We should be done with options.. */ |
| 125 | - verify_all_options(); | |
| 127 | + verify_all_options2(); | |
| 126 | 128 | |
| 127 | 129 | file_tree_name(g.argv[2], &fname, 0, 1); |
| 128 | 130 | if( zRevision ){ |
| 129 | 131 | historical_blob(zRevision, blob_str(&fname), &record, 1); |
| 130 | 132 | }else{ |
| @@ -169,11 +171,11 @@ | ||
| 169 | 171 | }else{ |
| 170 | 172 | iWidth = -1; |
| 171 | 173 | } |
| 172 | 174 | |
| 173 | 175 | /* We should be done with options.. */ |
| 174 | - verify_all_options(); | |
| 176 | + verify_all_options2(); | |
| 175 | 177 | |
| 176 | 178 | if( g.argc!=3 ){ |
| 177 | 179 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 178 | 180 | } |
| 179 | 181 | file_tree_name(g.argv[2], &fname, 0, 1); |
| 180 | 182 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -21,11 +21,11 @@ | |
| 21 | #include "finfo.h" |
| 22 | |
| 23 | /* |
| 24 | ** COMMAND: finfo |
| 25 | ** |
| 26 | ** Usage: %fossil finfo ?OPTIONS? FILENAME |
| 27 | ** |
| 28 | ** Print the complete change history for a single file going backwards |
| 29 | ** in time. The default mode is -l. |
| 30 | ** |
| 31 | ** For the -l|--log mode: If "-b|--brief" is specified one line per revision |
| @@ -53,10 +53,12 @@ | |
| 53 | ** to stdout (only in print mode) |
| 54 | ** -s|--status select status mode (print a status indicator for FILE) |
| 55 | ** -W|--width <num> Width of lines (default is to auto-detect). Must be |
| 56 | ** >22 or 0 (= no limit, resulting in a single line per |
| 57 | ** entry). |
| 58 | ** |
| 59 | ** See also: artifact, cat, descendants, info, leaves |
| 60 | */ |
| 61 | void finfo_cmd(void){ |
| 62 | db_must_be_within_tree(); |
| @@ -65,11 +67,11 @@ | |
| 65 | Blob line; |
| 66 | Blob fname; |
| 67 | int vid; |
| 68 | |
| 69 | /* We should be done with options.. */ |
| 70 | verify_all_options(); |
| 71 | |
| 72 | if( g.argc!=3 ) usage("-s|--status FILENAME"); |
| 73 | vid = db_lget_int("checkout", 0); |
| 74 | if( vid==0 ){ |
| 75 | fossil_fatal("no checkout to finfo files in"); |
| @@ -120,11 +122,11 @@ | |
| 120 | Blob record; |
| 121 | Blob fname; |
| 122 | const char *zRevision = find_option("revision", "r", 1); |
| 123 | |
| 124 | /* We should be done with options.. */ |
| 125 | verify_all_options(); |
| 126 | |
| 127 | file_tree_name(g.argv[2], &fname, 0, 1); |
| 128 | if( zRevision ){ |
| 129 | historical_blob(zRevision, blob_str(&fname), &record, 1); |
| 130 | }else{ |
| @@ -169,11 +171,11 @@ | |
| 169 | }else{ |
| 170 | iWidth = -1; |
| 171 | } |
| 172 | |
| 173 | /* We should be done with options.. */ |
| 174 | verify_all_options(); |
| 175 | |
| 176 | if( g.argc!=3 ){ |
| 177 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 178 | } |
| 179 | file_tree_name(g.argv[2], &fname, 0, 1); |
| 180 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -21,11 +21,11 @@ | |
| 21 | #include "finfo.h" |
| 22 | |
| 23 | /* |
| 24 | ** COMMAND: finfo |
| 25 | ** |
| 26 | ** Usage: %fossil finfo ?OPTIONS? ?--? FILENAME |
| 27 | ** |
| 28 | ** Print the complete change history for a single file going backwards |
| 29 | ** in time. The default mode is -l. |
| 30 | ** |
| 31 | ** For the -l|--log mode: If "-b|--brief" is specified one line per revision |
| @@ -53,10 +53,12 @@ | |
| 53 | ** to stdout (only in print mode) |
| 54 | ** -s|--status select status mode (print a status indicator for FILE) |
| 55 | ** -W|--width <num> Width of lines (default is to auto-detect). Must be |
| 56 | ** >22 or 0 (= no limit, resulting in a single line per |
| 57 | ** entry). |
| 58 | ** -- Treat all following arguments as files, even if they |
| 59 | ** look like flags. |
| 60 | ** |
| 61 | ** See also: artifact, cat, descendants, info, leaves |
| 62 | */ |
| 63 | void finfo_cmd(void){ |
| 64 | db_must_be_within_tree(); |
| @@ -65,11 +67,11 @@ | |
| 67 | Blob line; |
| 68 | Blob fname; |
| 69 | int vid; |
| 70 | |
| 71 | /* We should be done with options.. */ |
| 72 | verify_all_options2(); |
| 73 | |
| 74 | if( g.argc!=3 ) usage("-s|--status FILENAME"); |
| 75 | vid = db_lget_int("checkout", 0); |
| 76 | if( vid==0 ){ |
| 77 | fossil_fatal("no checkout to finfo files in"); |
| @@ -120,11 +122,11 @@ | |
| 122 | Blob record; |
| 123 | Blob fname; |
| 124 | const char *zRevision = find_option("revision", "r", 1); |
| 125 | |
| 126 | /* We should be done with options.. */ |
| 127 | verify_all_options2(); |
| 128 | |
| 129 | file_tree_name(g.argv[2], &fname, 0, 1); |
| 130 | if( zRevision ){ |
| 131 | historical_blob(zRevision, blob_str(&fname), &record, 1); |
| 132 | }else{ |
| @@ -169,11 +171,11 @@ | |
| 171 | }else{ |
| 172 | iWidth = -1; |
| 173 | } |
| 174 | |
| 175 | /* We should be done with options.. */ |
| 176 | verify_all_options2(); |
| 177 | |
| 178 | if( g.argc!=3 ){ |
| 179 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 180 | } |
| 181 | file_tree_name(g.argv[2], &fname, 0, 1); |
| 182 |
+5
-2
| --- src/regexp.c | ||
| +++ src/regexp.c | ||
| @@ -787,11 +787,11 @@ | ||
| 787 | 787 | } |
| 788 | 788 | |
| 789 | 789 | /* |
| 790 | 790 | ** COMMAND: grep |
| 791 | 791 | ** |
| 792 | -** Usage: %fossil grep [OPTIONS] PATTERN FILENAME | |
| 792 | +** Usage: %fossil grep [OPTIONS] ?--? PATTERN FILENAME | |
| 793 | 793 | ** |
| 794 | 794 | ** Attempt to match the given POSIX extended regular expression PATTERN |
| 795 | 795 | ** over all historic versions of FILENAME. For details of the supported |
| 796 | 796 | ** RE dialect, see https://fossil-scm.org/fossil/doc/trunk/www/grep.md |
| 797 | 797 | ** |
| @@ -798,10 +798,13 @@ | ||
| 798 | 798 | ** Options: |
| 799 | 799 | ** |
| 800 | 800 | ** -i|--ignore-case Ignore case |
| 801 | 801 | ** -l|--files-with-matches List only checkin ID for versions that match |
| 802 | 802 | ** -v|--verbose Show each file as it is analyzed |
| 803 | +** -- Treat all following arguments as non-flags, | |
| 804 | +** even if they look like flags. Use this before | |
| 805 | +** the PATTERN or FILENAME, but not both. | |
| 803 | 806 | */ |
| 804 | 807 | void re_grep_cmd(void){ |
| 805 | 808 | u32 flags = 0; |
| 806 | 809 | int bVerbose = 0; |
| 807 | 810 | ReCompiled *pRe; |
| @@ -811,11 +814,11 @@ | ||
| 811 | 814 | |
| 812 | 815 | if( find_option("ignore-case","i",0)!=0 ) ignoreCase = 1; |
| 813 | 816 | if( find_option("files-with-matches","l",0)!=0 ) flags |= GREP_EXISTS; |
| 814 | 817 | if( find_option("verbose","v",0)!=0 ) bVerbose = 1; |
| 815 | 818 | db_find_and_open_repository(0, 0); |
| 816 | - verify_all_options(); | |
| 819 | + verify_all_options2(); | |
| 817 | 820 | if( g.argc<4 ){ |
| 818 | 821 | usage("REGEXP FILENAME"); |
| 819 | 822 | } |
| 820 | 823 | zErr = re_compile(&pRe, g.argv[2], ignoreCase); |
| 821 | 824 | if( zErr ) fossil_fatal("%s", zErr); |
| 822 | 825 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -787,11 +787,11 @@ | |
| 787 | } |
| 788 | |
| 789 | /* |
| 790 | ** COMMAND: grep |
| 791 | ** |
| 792 | ** Usage: %fossil grep [OPTIONS] PATTERN FILENAME |
| 793 | ** |
| 794 | ** Attempt to match the given POSIX extended regular expression PATTERN |
| 795 | ** over all historic versions of FILENAME. For details of the supported |
| 796 | ** RE dialect, see https://fossil-scm.org/fossil/doc/trunk/www/grep.md |
| 797 | ** |
| @@ -798,10 +798,13 @@ | |
| 798 | ** Options: |
| 799 | ** |
| 800 | ** -i|--ignore-case Ignore case |
| 801 | ** -l|--files-with-matches List only checkin ID for versions that match |
| 802 | ** -v|--verbose Show each file as it is analyzed |
| 803 | */ |
| 804 | void re_grep_cmd(void){ |
| 805 | u32 flags = 0; |
| 806 | int bVerbose = 0; |
| 807 | ReCompiled *pRe; |
| @@ -811,11 +814,11 @@ | |
| 811 | |
| 812 | if( find_option("ignore-case","i",0)!=0 ) ignoreCase = 1; |
| 813 | if( find_option("files-with-matches","l",0)!=0 ) flags |= GREP_EXISTS; |
| 814 | if( find_option("verbose","v",0)!=0 ) bVerbose = 1; |
| 815 | db_find_and_open_repository(0, 0); |
| 816 | verify_all_options(); |
| 817 | if( g.argc<4 ){ |
| 818 | usage("REGEXP FILENAME"); |
| 819 | } |
| 820 | zErr = re_compile(&pRe, g.argv[2], ignoreCase); |
| 821 | if( zErr ) fossil_fatal("%s", zErr); |
| 822 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -787,11 +787,11 @@ | |
| 787 | } |
| 788 | |
| 789 | /* |
| 790 | ** COMMAND: grep |
| 791 | ** |
| 792 | ** Usage: %fossil grep [OPTIONS] ?--? PATTERN FILENAME |
| 793 | ** |
| 794 | ** Attempt to match the given POSIX extended regular expression PATTERN |
| 795 | ** over all historic versions of FILENAME. For details of the supported |
| 796 | ** RE dialect, see https://fossil-scm.org/fossil/doc/trunk/www/grep.md |
| 797 | ** |
| @@ -798,10 +798,13 @@ | |
| 798 | ** Options: |
| 799 | ** |
| 800 | ** -i|--ignore-case Ignore case |
| 801 | ** -l|--files-with-matches List only checkin ID for versions that match |
| 802 | ** -v|--verbose Show each file as it is analyzed |
| 803 | ** -- Treat all following arguments as non-flags, |
| 804 | ** even if they look like flags. Use this before |
| 805 | ** the PATTERN or FILENAME, but not both. |
| 806 | */ |
| 807 | void re_grep_cmd(void){ |
| 808 | u32 flags = 0; |
| 809 | int bVerbose = 0; |
| 810 | ReCompiled *pRe; |
| @@ -811,11 +814,11 @@ | |
| 814 | |
| 815 | if( find_option("ignore-case","i",0)!=0 ) ignoreCase = 1; |
| 816 | if( find_option("files-with-matches","l",0)!=0 ) flags |= GREP_EXISTS; |
| 817 | if( find_option("verbose","v",0)!=0 ) bVerbose = 1; |
| 818 | db_find_and_open_repository(0, 0); |
| 819 | verify_all_options2(); |
| 820 | if( g.argc<4 ){ |
| 821 | usage("REGEXP FILENAME"); |
| 822 | } |
| 823 | zErr = re_compile(&pRe, g.argv[2], ignoreCase); |
| 824 | if( zErr ) fossil_fatal("%s", zErr); |
| 825 |