diff options
author | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2021-10-24 21:32:58 +0900 |
---|---|---|
committer | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2021-10-24 21:32:58 +0900 |
commit | c7a391fa0562a86605a676a313a4f512d8de1979 (patch) | |
tree | e888d4481d7b16030a848412b92c0e3b7f321d36 | |
parent | e40938c1287beaeb6eaeb0a4ce62d786a65930d3 (diff) | |
download | zsh-c7a391fa0562a86605a676a313a4f512d8de1979.tar.gz zsh-c7a391fa0562a86605a676a313a4f512d8de1979.tar.xz zsh-c7a391fa0562a86605a676a313a4f512d8de1979.zip |
49493: fix '_arguments --' to correctly recognize optional argument
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Base/Utility/_arguments | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog index 21e72305a..22cbff507 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-10-24 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + + * 49493: Completion/Base/Utility/_arguments: fix handling of + optional argument of long option in help text + 2021-10-23 Oliver Kiddle <opk@zsh.org> * 49499 based on 49496 by Jun T.: Src/Zle/computil.c diff --git a/Completion/Base/Utility/_arguments b/Completion/Base/Utility/_arguments index 3f1b39304..cab7c929e 100644 --- a/Completion/Base/Utility/_arguments +++ b/Completion/Base/Utility/_arguments @@ -132,8 +132,8 @@ if (( long )); then # variant syntax seen in fetchmail: # --[fetch]all means --fetchall or --all. # maybe needs to be more general - if [[ $start = (#b)(*)\[(*)\](*) ]]; then - tmp+=("${match[1]}${match[2]}${match[3]}" "${match[1]}${match[3]}") + if [[ $start = (#b)--\[(*)\](*) ]]; then + tmp+=("--${match[1]}${match[2]}" "--${match[2]}") else tmp+=($start) fi |