Skip to content

Commit

Permalink
util (bleopt,bind): fix an error message and the error exit status
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Sep 5, 2021
1 parent 925b2cd commit b663cee
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions memo/ChangeLog.md
Expand Up @@ -51,6 +51,7 @@
- util (`blehook`): show explicitly specified internal hooks `#D1594` f4312df
- util (`bleopt`): do no select obsoleted options by wildcards `#D1595` f4312df
- util (`bleopt`): fix error messages for unknown options `#D1610` 66df3e2
- util (`bleopt`, `bind`): fix error message and exit status, respectively `#D1640` 0000000
- progcomp: support quoted commands and better `progcomp_alias` `#D1581` `#D1583` dbe87c3
- progcomp: fix a bug that command names may stray into completer function names `#D1611` 1f2d45f
- syntax: highlight quotes of the `\?` form `#D1584` 5076a03
Expand Down
10 changes: 6 additions & 4 deletions note.txt
Expand Up @@ -1616,10 +1616,6 @@ bash_tips
./ble.pp:145: { ((${#BASH_SOURCE[@]})) && [[ ${BASH_SOURCE[${#BASH_SOURCE[@]}-1]} == *bashrc ]]; } ||
./src/decode.sh:3632: [[ ${keys[*]} != "$bind_keys" ]] &&

2021-07-20

* bind --help の exit status が 1 になっている

2021-07-14

* bash-it によるプロンプト設定が prompt attach で反映されない。
Expand Down Expand Up @@ -4991,6 +4987,12 @@ bash_tips

2021-09-01

* util (bleopt, bind): fix interfaces [#D1640]

* bleopt の unknown option のエラーメッセージでオプション名が '-c' 固定になっている。

* 2021-07-20 bind --help の exit status が 1 になっている。2 であるべき。

* complete: 古い bash における -D, -I の対応 [#D1639]

どうやら -D, -I はそれぞれ内部的には _DefaultCmD_, _InitialWorD_ という名
Expand Down
10 changes: 5 additions & 5 deletions src/decode.sh
Expand Up @@ -3871,13 +3871,13 @@ function ble/builtin/bind {
nocasematch=1

ble/decode/initialize
local flags=
local flags= ext=0
ble/builtin/bind/.process "$@"
if [[ $_ble_decode_bind_state == none ]]; then
builtin bind "$@"
else
[[ $flags != *[eh]* ]]
fi; local ext=$?
builtin bind "$@"; ext=$?
elif [[ $flags == *[eh]* ]]; then
ext=2
fi

[[ $nocasematch ]] &&
shopt -s nocasematch
Expand Down
2 changes: 1 addition & 1 deletion src/util.sh
Expand Up @@ -73,7 +73,7 @@ function bleopt/.read-arguments {
(u) bleopt/.read-arguments/process-option changed ;;
(I) bleopt/.read-arguments/process-option initialize ;;
(*)
ble/util/print "bleopt: unrecognized option '-c'." >&2
ble/util/print "bleopt: unrecognized option '-$c'." >&2
flags=E$flags ;;
esac
done ;;
Expand Down

0 comments on commit b663cee

Please sign in to comment.