{"thread":{"id":"3109","subject":"git-grep documentation","startedAt":"2006-01-20T13:47:23Z","lastAt":"2006-01-21T19:19:53Z","messageCount":5,"participants":["sean","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"14948","messageId":"BAYC1-PASMTP07F7EA1F3B544C07AA01F8AE1F0@CEZ.ICE","threadId":"3109","inReplyTo":null,"subject":"git-grep documentation","fromName":"sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2006-01-20T13:47:23Z","receivedAt":"2006-01-20T13:47:23Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"\nIt looks as though git-grep.sh was coded to allow git-ls-files\noptions to be passed after a '--' marker.   However, this marker will \nnever be seen by the script unless the user identifies the <pattern>\nby preceding it with an '-e'.   \n\nIf it's not seen the '--' ends up getting passed to git-ls-files and any\noptions are mistakenly interpreted as paths.  For instance, the following\ntwo commands will do different things:\n\n$ git-grep -e NAME -- --others Documentation/git-grep.txt\n$ git-grep    NAME -- --others Documentation/git-grep.txt\n\n\nEither the comment in the git-grep.sh script should be changed to\nsay that only paths are acceptable after the '--' or fixed up to \nhandle this case a bit better.   The documentation patch below is \nonly applicable if the script is fixed first.\n\nSean\n\n\ndiff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt\nindex 2bfd8ed..c2c6ff3 100644\n--- a/Documentation/git-grep.txt\n+++ b/Documentation/git-grep.txt\n@@ -8,7 +8,7 @@ git-grep - print lines matching a patter\n \n SYNOPSIS\n --------\n-'git-grep' [<option>...] <pattern> [<path>...]\n+'git-grep' [<option>...] [-e] <pattern> [-- [<ls option>...]] [<path>...]\n \n DESCRIPTION\n -----------\n@@ -20,12 +20,21 @@ OPTIONS\n -------\n <option>...::\n \tEither an option to pass to `grep` or `git-ls-files`.\n-\tSome `grep` options, such as `-C` and `-m`, that take\n-\tparameters are known to `git-grep`.\n+\n+\tThe specific `git-ls-files` options that may be supplied are:\n+\t`--cached`, `--deleted`, `--others`, `--killed`, `--ignored`, \n+\t`--exclude=*`, `--exclude-from=*`, or `--exclude-per-directory=*`.\n+\t\n+\tAll other options will be passed to `grep`.\n \n <pattern>::\n \tThe pattern to look for.\n \n+<ls option>...::\n+\tAdditional options for `git-ls-files` which must be preceded\n+\tby the '--' marker.   See `git-ls-files` for a list of \n+\tavailable options.\n+\n <path>...::\n \tOptional paths to limit the set of files to be searched;\n \tpassed to `git-ls-files`.\n"},{"id":"14974","messageId":"7vvewet330.fsf@assigned-by-dhcp.cox.net","threadId":"3109","inReplyTo":"BAYC1-PASMTP07F7EA1F3B544C07AA01F8AE1F0@CEZ.ICE","subject":"Re: git-grep documentation","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-21T08:09:07Z","receivedAt":"2006-01-21T08:09:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"sean <seanlkml@sympatico.ca> writes:\n\n> It looks as though git-grep.sh was coded to allow git-ls-files\n> options to be passed after a '--' marker...\n\nI'd prefer to keep the options before path parameters if only\nfor the sanity's sake.  How about this instead?\n\n-- >8 --\n[PATCH] git-grep: clarification on parameters.\n\nWe forgot to make sure that there is no more than one pattern\nparameter.  Also when looking for files in a directory called\n'--others', it passed that path limiter without preceding the\nend-of-options marker '--' to underlying git-ls-files, which\nmisunderstood it as one of its options instead.\n\n\t$ git grep --others -e Meta/Make Meta\n\t$ git grep -o -e Meta/Make Meta\n\t$ git grep -o Meta/Make Meta\n\nlook for a string \"Meta/Make\" from untracked files in Meta/\ndirectory.\n\n\t$ git grep Meta/Make --others\n\nlooks for the same string from tracked files in ./--others\ndirectory.\n\nOn the other hand,\n\n\t$ git grep -e Meta/Make --others\n\ndoes not have a freestanding pattern, so everybody is parameter\nand there is no path specifier.  It looks for the string in all\nthe untracked files without any path limiter.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n Documentation/git-grep.txt |   25 ++++++++++++++++++++++---\n git-grep.sh                |   27 +++++++++++++++++++--------\n 2 files changed, 41 insertions(+), 11 deletions(-)\n\nb11f9315a792d65a0113e10e478e740ce4f8be73\ndiff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt\nindex 2bfd8ed..55d3bed 100644\n--- a/Documentation/git-grep.txt\n+++ b/Documentation/git-grep.txt\n@@ -8,7 +8,7 @@ git-grep - print lines matching a patter\n \n SYNOPSIS\n --------\n-'git-grep' [<option>...] <pattern> [<path>...]\n+'git-grep' [<option>...] [-e] <pattern> [<path>...]\n \n DESCRIPTION\n -----------\n@@ -18,13 +18,32 @@ containing a match to the given pattern.\n \n OPTIONS\n -------\n+`--`::\n+\tSignals the end of options; the rest of the parameters\n+\tare <path> limiters.\n+\n <option>...::\n \tEither an option to pass to `grep` or `git-ls-files`.\n \tSome `grep` options, such as `-C` and `-m`, that take\n-\tparameters are known to `git-grep`.\n+\tparameters are known to `git-grep`.  Among options\n+\tapplicable to git-ls-files`, `--others` and\n+\t`--exclude=*` (and other variants of exclusion) may be\n+\tof interest.  Only `-o` is recognized as an option to\n+\t`git-ls-files` in the short form (e.g. `-d` and `-m` are\n+\tgiven to `grep`, not to `git-ls-files` as synonym\n+\tfor `--deleted` and `--modifed`), so you need to spell\n+\tout `git-ls-files` options in longer form\n+\te.g. `--deleted`.\n \n <pattern>::\n-\tThe pattern to look for.\n+\tThe pattern to look for.  The first non option is taken\n+\tas the pattern; if your pattern begins with a dash, use\n+\t`-e <pattern>`.  When a pattern is found without `-e`, it\n+\talso terminates the option processing and the rest of\n+\tthe parameters are used as the `<path>...`, and you do\n+\tnot specifically add `--` to protect the path limiter\n+\tthat happens to begin with a dash from being mistaken as\n+\tan option.\n \n <path>...::\n \tOptional paths to limit the set of files to be searched;\ndiff --git a/git-grep.sh b/git-grep.sh\nindex 2ed8e95..23b1e03 100755\n--- a/git-grep.sh\n+++ b/git-grep.sh\n@@ -3,22 +3,32 @@\n # Copyright (c) Linus Torvalds, 2005\n #\n \n-USAGE='<option>... <pattern> <path>...'\n+USAGE='[<option>...] [-e] <pattern> [<path>...]'\n SUBDIRECTORY_OK='Yes'\n . git-sh-setup\n \n+got_pattern () {\n+\tif [ -z \"$no_more_patterns\" ]\n+\tthen\n+\t\tpattern=\"$1\" no_more_patterns=yes\n+\telse\n+\t\tdie \"git-grep: do not specify more than one pattern\"\n+\tfi\n+}\n+\n+no_more_patterns=\n pattern=\n flags=()\n git_flags=()\n while : ; do\n \tcase \"$1\" in\n-\t--cached|--deleted|--others|--killed|\\\n-\t--ignored|--exclude=*|\\\n+\t-o|--cached|--deleted|--others|--killed|\\\n+\t--ignored|--modified|--exclude=*|\\\n \t--exclude-from=*|\\--exclude-per-directory=*)\n \t\tgit_flags=(\"${git_flags[@]}\" \"$1\")\n \t\t;;\n \t-e)\n-\t\tpattern=\"$2\"\n+\t\tgot_pattern \"$2\"\n \t\tshift\n \t\t;;\n \t-A|-B|-C|-D|-d|-f|-m)\n@@ -34,8 +44,9 @@ while : ; do\n \t\tflags=(\"${flags[@]}\" \"$1\")\n \t\t;;\n \t*)\n-\t\tif [ -z \"$pattern\" ]; then\n-\t\t\tpattern=\"$1\"\n+\t\tif [ -z \"$no_more_patterns\" ]\n+\t\tthen\n+\t\t\tgot_pattern \"$1\"\n \t\t\tshift\n \t\tfi\n \t\tbreak\n@@ -46,5 +57,5 @@ done\n [ \"$pattern\" ] || {\n \tusage\n }\n-git-ls-files -z \"${git_flags[@]}\" \"$@\" |\n-\txargs -0 grep \"${flags[@]}\" -e \"$pattern\"\n+git-ls-files -z \"${git_flags[@]}\" -- \"$@\" |\n+\txargs -0 grep \"${flags[@]}\" -e \"$pattern\" --\n-- \n1.1.4.g5c4a-dirty\n"},{"id":"14982","messageId":"BAYC1-PASMTP031BAB23C3237DA15F88D3AE1E0@CEZ.ICE","threadId":"3109","inReplyTo":"7vvewet330.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-grep documentation","fromName":"sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2006-01-21T14:13:18Z","receivedAt":"2006-01-21T14:13:18Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Sat, 21 Jan 2006 00:09:07 -0800\nJunio C Hamano <junkio@cox.net> wrote:\n\n> I'd prefer to keep the options before path parameters if only\n> for the sanity's sake.  How about this instead\n\nHi Junio,\n\nI like your patch and it fixes the \"-e\" problem on the command\nline nicely.   Some comments below though...\n\n\n\n> [PATCH] git-grep: clarification on parameters.\n> \n> We forgot to make sure that there is no more than one pattern\n> parameter.  Also when looking for files in a directory called\n> '--others', it passed that path limiter without preceding the\n> end-of-options marker '--' to underlying git-ls-files, which\n> misunderstood it as one of its options instead.\n\nActually I misinterpreted the intent of git-grep as wanting to\nallow additional git-ls-files options to be given after the '--'\nmarker on its command line.   This misconception arose because\nof the following comment in git-grep.sh :\n\n        --)\n               # The rest are git-ls-files paths (or flags)\n\nSo your new patch should also fix that comment to remove the \n\"(or flags)\" portion.\n\n[...]\n\n> -'git-grep' [<option>...] <pattern> [<path>...]\n> +'git-grep' [<option>...] [-e] <pattern> [<path>...]\n>\n>  DESCRIPTION\n>  -----------\n> @@ -18,13 +18,32 @@ containing a match to the given pattern.\n>  \n>  OPTIONS\n>  -------\n> +`--`::\n> +\tSignals the end of options; the rest of the parameters\n> +\tare <path> limiters.\n> +\n\nSince you comment on the -- marker here I think it should\nalso appear in the command line above:\n\n'git-grep' [<option>...] [-e] <pattern> [--] [<path>...]\n\n\n>  <option>...::\n>  \tEither an option to pass to `grep` or `git-ls-files`.\n>  \tSome `grep` options, such as `-C` and `-m`, that take\n> -\tparameters are known to `git-grep`.\n> +\tparameters are known to `git-grep`.  Among options\n> +\tapplicable to git-ls-files`, `--others` and\n> +\t`--exclude=*` (and other variants of exclusion) may be\n> +\tof interest.  Only `-o` is recognized as an option to\n> +\t`git-ls-files` in the short form (e.g. `-d` and `-m` are\n> +\tgiven to `grep`, not to `git-ls-files` as synonym\n> +\tfor `--deleted` and `--modifed`), so you need to spell\n> +\tout `git-ls-files` options in longer form\n> +\te.g. `--deleted`.\n\n\nI would argue that this is too verbose and strays into the internal\nimplementation too much.   For example a user doesn't care that\ngit-grep.sh needs to specially handle \"grep\" parameters that happen\nto take a single parameter (like -C and -m).\n\nInstead it is more useful for them to be told _specificly_ which \ngit-ls-files options  are available and that all others will be \npassed to grep.   Somthing like:\n\n  Either an option to pass to `grep` or `git-ls-files`.\n\n  The following are the specific `git-ls-files` options\n  that may be given: `-o`, `--cached`, `--deleted`, `--others`,\n  `--killed`, `--ignored`, `--modified`, `--exclude=*`,\n  `--exclude-from=*`, and `--exclude-per-directory=*`.\n\n  All other options will be passed to `grep`.\n\n>  \n>  <pattern>::\n> -\tThe pattern to look for.\n> +\tThe pattern to look for.  The first non option is taken\n> +\tas the pattern; if your pattern begins with a dash, use\n> +\t`-e <pattern>`.  When a pattern is found without `-e`, it\n> +\talso terminates the option processing and the rest of\n> +\tthe parameters are used as the `<path>...`, and you do\n> +\tnot specifically add `--` to protect the path limiter\n> +\tthat happens to begin with a dash from being mistaken as\n> +\tan option.\n\nAnd here I think only your first two sentences are needed and the\nrest actually isn't.    Your patch fixes the problem case and \nthere is no reason now to warn the user away from supplying the --\nmarker in addition to the \"-e\"; it'll work properly in either case.\n\n\nThat's it and the rest looked good.  In case you agree with anything\ni've said here, find an amended version of your patch below.\n\nCheers,\nSean\n\n\n\n\n\ndiff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt\nindex 2bfd8ed..7fd675b 100644\n--- a/Documentation/git-grep.txt\n+++ b/Documentation/git-grep.txt\n@@ -8,7 +8,7 @@ git-grep - print lines matching a patter\n \n SYNOPSIS\n --------\n-'git-grep' [<option>...] <pattern> [<path>...]\n+'git-grep' [<option>...] [-e] <pattern> [--] [<path>...]\n \n DESCRIPTION\n -----------\n@@ -18,13 +18,24 @@ containing a match to the given pattern.\n \n OPTIONS\n -------\n+`--`::\n+\tSignals the end of options; the rest of the parameters\n+\tare <path> limiters.\n+\n <option>...::\n \tEither an option to pass to `grep` or `git-ls-files`.\n-\tSome `grep` options, such as `-C` and `-m`, that take\n-\tparameters are known to `git-grep`.\n+\n+\tThe following are the specific `git-ls-files` options\n+\tthat may be given: `-o`, `--cached`, `--deleted`, `--others`, \n+\t`--killed`, `--ignored`, `--modified`, `--exclude=*`, \n+\t`--exclude-from=*`, and `--exclude-per-directory=*`.\n+\n+\tAll other options will be passed to `grep`.\n \n <pattern>::\n-\tThe pattern to look for.\n+\tThe pattern to look for.  The first non option is taken\n+\tas the pattern; if your pattern begins with a dash, use\n+\t`-e <pattern>`.  \n \n <path>...::\n \tOptional paths to limit the set of files to be searched;\ndiff --git a/git-grep.sh b/git-grep.sh\nindex 2ed8e95..d815c09 100755\n--- a/git-grep.sh\n+++ b/git-grep.sh\n@@ -3,22 +3,32 @@\n # Copyright (c) Linus Torvalds, 2005\n #\n \n-USAGE='<option>... <pattern> <path>...'\n+USAGE='[<option>...] [-e] <pattern> [<path>...]'\n SUBDIRECTORY_OK='Yes'\n . git-sh-setup\n \n+got_pattern () {\n+\tif [ -z \"$no_more_patterns\" ]\n+\tthen\n+\t\tpattern=\"$1\" no_more_patterns=yes\n+\telse\n+\t\tdie \"git-grep: do not specify more than one pattern\"\n+\tfi\n+}\n+\n+no_more_patterns=\n pattern=\n flags=()\n git_flags=()\n while : ; do\n \tcase \"$1\" in\n-\t--cached|--deleted|--others|--killed|\\\n-\t--ignored|--exclude=*|\\\n+\t-o|--cached|--deleted|--others|--killed|\\\n+\t--ignored|--modified|--exclude=*|\\\n \t--exclude-from=*|\\--exclude-per-directory=*)\n \t\tgit_flags=(\"${git_flags[@]}\" \"$1\")\n \t\t;;\n \t-e)\n-\t\tpattern=\"$2\"\n+\t\tgot_pattern \"$2\"\n \t\tshift\n \t\t;;\n \t-A|-B|-C|-D|-d|-f|-m)\n@@ -26,7 +36,7 @@ while : ; do\n \t\tshift\n \t\t;;\n \t--)\n-\t\t# The rest are git-ls-files paths (or flags)\n+\t\t# The rest are git-ls-files paths \n \t\tshift\n \t\tbreak\n \t\t;;\n@@ -34,8 +44,9 @@ while : ; do\n \t\tflags=(\"${flags[@]}\" \"$1\")\n \t\t;;\n \t*)\n-\t\tif [ -z \"$pattern\" ]; then\n-\t\t\tpattern=\"$1\"\n+\t\tif [ -z \"$no_more_patterns\" ]\n+\t\tthen\n+\t\t\tgot_pattern \"$1\"\n \t\t\tshift\n \t\tfi\n \t\tbreak\n@@ -46,5 +57,5 @@ done\n [ \"$pattern\" ] || {\n \tusage\n }\n-git-ls-files -z \"${git_flags[@]}\" \"$@\" |\n-\txargs -0 grep \"${flags[@]}\" -e \"$pattern\"\n+git-ls-files -z \"${git_flags[@]}\" -- \"$@\" |\n+\txargs -0 grep \"${flags[@]}\" -e \"$pattern\" --\n"},{"id":"14988","messageId":"7vzmlpo0y4.fsf@assigned-by-dhcp.cox.net","threadId":"3109","inReplyTo":"BAYC1-PASMTP031BAB23C3237DA15F88D3AE1E0@CEZ.ICE","subject":"Re: git-grep documentation","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-21T19:06:27Z","receivedAt":"2006-01-21T19:06:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"sean <seanlkml@sympatico.ca> writes:\n\n> So your new patch should also fix that comment to remove the \n> \"(or flags)\" portion.\n\nProbably.\n\n> Since you comment on the -- marker here I think it should\n> also appear in the command line above:\n>\n> 'git-grep' [<option>...] [-e] <pattern> [--] [<path>...]\n\nI've thought about this but it is not any more correct than what\nwe have now (both are technically incorrect).  If you do not use\nan `-e` and let a non-option terminate the option processing,\ndouble dashes are not removed, so you do not want it there.\n\n> Instead it is more useful for them to be told _specificly_ which \n> git-ls-files options  are available and that all others will be \n> passed to grep.   Somthing like:\n\nI like it.\n\n> ...    Your patch fixes the problem case and \n> there is no reason now to warn the user away from supplying the --\n> marker in addition to the \"-e\"; it'll work properly in either case.\n\nDoes it?  I think if you give -- without -e it will look for a\npath that matches -- because we pass our own -- to ls-files.\n\n> That's it and the rest looked good.  In case you agree with anything\n> i've said here, find an amended version of your patch below.\n\nThanks.\n\nWhen people make an improvement proposal, I'd often prefer to\nsee a patch that is on top of the patch being discussed, not a\nreplacement.\n"},{"id":"14990","messageId":"BAYC1-PASMTP04A8A5F7BEE906FE8E4924AE1E0@CEZ.ICE","threadId":"3109","inReplyTo":"7vzmlpo0y4.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-grep documentation","fromName":"sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2006-01-21T19:19:53Z","receivedAt":"2006-01-21T19:19:53Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Sat, 21 Jan 2006 11:06:27 -0800\nJunio C Hamano <junkio@cox.net> wrote:\n\n> I've thought about this but it is not any more correct than what\n> we have now (both are technically incorrect).  If you do not use\n> an `-e` and let a non-option terminate the option processing,\n> double dashes are not removed, so you do not want it there.\n\nI think this should be fixed rather than requiring the user\nto remember such an obscure detail.   It's easy to fix git-grep\nto deal with it instead (see below).\n\n> Does it?  I think if you give -- without -e it will look for a\n> path that matches -- because we pass our own -- to ls-files.\n> \n\nYou're right,  in the patch below I added a specific test to handle\nthis case so the documentation can be simplified and the user is\nfree to use any combination of -e and --. \n\n> When people make an improvement proposal, I'd often prefer to\n> see a patch that is on top of the patch being discussed, not a\n> replacement.\n> \n\nYes, I can see how that would be easier to review.   Below\nis a patch on top of your original that now includes the tweak\nmentioned above:\n\n\ndiff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt\nindex 55d3bed..7fd675b 100644\n--- a/Documentation/git-grep.txt\n+++ b/Documentation/git-grep.txt\n@@ -8,7 +8,7 @@ git-grep - print lines matching a patter\n \n SYNOPSIS\n --------\n-'git-grep' [<option>...] [-e] <pattern> [<path>...]\n+'git-grep' [<option>...] [-e] <pattern> [--] [<path>...]\n \n DESCRIPTION\n -----------\n@@ -24,26 +24,18 @@ OPTIONS\n \n <option>...::\n \tEither an option to pass to `grep` or `git-ls-files`.\n-\tSome `grep` options, such as `-C` and `-m`, that take\n-\tparameters are known to `git-grep`.  Among options\n-\tapplicable to git-ls-files`, `--others` and\n-\t`--exclude=*` (and other variants of exclusion) may be\n-\tof interest.  Only `-o` is recognized as an option to\n-\t`git-ls-files` in the short form (e.g. `-d` and `-m` are\n-\tgiven to `grep`, not to `git-ls-files` as synonym\n-\tfor `--deleted` and `--modifed`), so you need to spell\n-\tout `git-ls-files` options in longer form\n-\te.g. `--deleted`.\n+\n+\tThe following are the specific `git-ls-files` options\n+\tthat may be given: `-o`, `--cached`, `--deleted`, `--others`, \n+\t`--killed`, `--ignored`, `--modified`, `--exclude=*`, \n+\t`--exclude-from=*`, and `--exclude-per-directory=*`.\n+\n+\tAll other options will be passed to `grep`.\n \n <pattern>::\n \tThe pattern to look for.  The first non option is taken\n \tas the pattern; if your pattern begins with a dash, use\n-\t`-e <pattern>`.  When a pattern is found without `-e`, it\n-\talso terminates the option processing and the rest of\n-\tthe parameters are used as the `<path>...`, and you do\n-\tnot specifically add `--` to protect the path limiter\n-\tthat happens to begin with a dash from being mistaken as\n-\tan option.\n+\t`-e <pattern>`.  \n \n <path>...::\n \tOptional paths to limit the set of files to be searched;\ndiff --git a/git-grep.sh b/git-grep.sh\nindex 23b1e03..4f06093 100755\n--- a/git-grep.sh\n+++ b/git-grep.sh\n@@ -36,7 +36,7 @@ while : ; do\n \t\tshift\n \t\t;;\n \t--)\n-\t\t# The rest are git-ls-files paths (or flags)\n+\t\t# The rest are git-ls-files paths \n \t\tshift\n \t\tbreak\n \t\t;;\n@@ -49,6 +49,7 @@ while : ; do\n \t\t\tgot_pattern \"$1\"\n \t\t\tshift\n \t\tfi\n+\t\t[ \"$1\" = -- ] && shift\n \t\tbreak\n \t\t;;\n \tesac\n"}]}