Skip to content

Commit c74abc5

Browse files
committed
README: update for v0.3.1
1 parent a9756e9 commit c74abc5

6 files changed

+236
-146
lines changed

README-ja_JP.md

+56-44
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ $ make INSDIR=/path/to/blesh install
5757

5858
`wget` を使う場合:
5959
```console
60-
$ wget https://github.com/akinomyoga/ble.sh/releases/download/v0.3.0/ble-0.3.0.tar.xz
61-
$ tar xJf ble-0.3.0.tar.xz
62-
$ source ble-0.3.0/ble.sh
60+
$ wget https://github.com/akinomyoga/ble.sh/releases/download/v0.3.1/ble-0.3.1.tar.xz
61+
$ tar xJf ble-0.3.1.tar.xz
62+
$ source ble-0.3.1/ble.sh
6363
```
6464
`curl` を使う場合:
6565
```console
66-
$ curl -LO https://github.com/akinomyoga/ble.sh/releases/download/v0.3.0/ble-0.3.0.tar.xz
67-
$ tar xJf ble-0.3.0.tar.xz
68-
$ source ble-0.3.0/ble.sh
66+
$ curl -LO https://github.com/akinomyoga/ble.sh/releases/download/v0.3.1/ble-0.3.1.tar.xz
67+
$ tar xJf ble-0.3.1.tar.xz
68+
$ source ble-0.3.1/ble.sh
6969
```
7070

7171
指定したディレクトリに `ble.sh` を配置するには単に `ble-0.1.7` ディレクトリをコピーします。
7272
```console
73-
$ cp -r ble-0.3.0 /path/to/blesh
73+
$ cp -r ble-0.3.1 /path/to/blesh
7474
```
7575

7676
## `.bashrc` に設定する
@@ -204,37 +204,46 @@ bleopt edit_abell=
204204
構文に従った着色で使用される、各文法要素の色と属性は `ble-color-setface` シェル関数で設定します。
205205
既定の設定は以下のコードに対応します:
206206
```bash
207-
ble-color-setface region bg=60,fg=white
208-
ble-color-setface region_target bg=153,fg=black
209-
ble-color-setface region_match bg=55,fg=white
210-
ble-color-setface region_insert fg=12,bg=252
211-
ble-color-setface disabled fg=242
212-
ble-color-setface overwrite_mode fg=black,bg=51
213-
ble-color-setface syntax_default none
214-
ble-color-setface syntax_command fg=brown
215-
ble-color-setface syntax_quoted fg=green
216-
ble-color-setface syntax_quotation fg=green,bold
217-
ble-color-setface syntax_expr fg=26
218-
ble-color-setface syntax_error bg=203,fg=231
219-
ble-color-setface syntax_varname fg=202
220-
ble-color-setface syntax_delimiter bold
221-
ble-color-setface syntax_param_expansion fg=purple
222-
ble-color-setface syntax_history_expansion bg=94,fg=231
223-
ble-color-setface syntax_function_name fg=92,bold
224-
ble-color-setface syntax_comment fg=242
225-
ble-color-setface syntax_glob fg=198,bold
226-
ble-color-setface syntax_brace fg=37,bold
227-
ble-color-setface syntax_tilde fg=navy,bold
228-
ble-color-setface syntax_document fg=94
229-
ble-color-setface syntax_document_begin fg=94,bold
230-
ble-color-setface command_builtin_dot fg=red,bold
231-
ble-color-setface command_builtin fg=red
232-
ble-color-setface command_alias fg=teal
233-
ble-color-setface command_function fg=92
234-
ble-color-setface command_file fg=green
235-
ble-color-setface command_keyword fg=blue
236-
ble-color-setface command_jobs fg=red
237-
ble-color-setface command_directory fg=26,underline
207+
# 編集に関連する着色の設定
208+
ble-color-setface region bg=60,fg=white
209+
ble-color-setface region_target bg=153,fg=black
210+
ble-color-setface region_match bg=55,fg=white
211+
ble-color-setface region_insert fg=12,bg=252
212+
ble-color-setface disabled fg=242
213+
ble-color-setface overwrite_mode fg=black,bg=51
214+
ble-color-setface auto_complete fg=238,bg=254
215+
ble-color-setface menu_filter_fixed bold
216+
ble-color-setface menu_filter_input fg=16,bg=229
217+
ble-color-setface vbell reverse
218+
ble-color-setface vbell_erase bg=252
219+
ble-color-setface vbell_flash fg=green,reverse
220+
221+
# 構文着色の設定
222+
ble-color-setface syntax_default none
223+
ble-color-setface syntax_command fg=brown
224+
ble-color-setface syntax_quoted fg=green
225+
ble-color-setface syntax_quotation fg=green,bold
226+
ble-color-setface syntax_expr fg=26
227+
ble-color-setface syntax_error bg=203,fg=231
228+
ble-color-setface syntax_varname fg=202
229+
ble-color-setface syntax_delimiter bold
230+
ble-color-setface syntax_param_expansion fg=purple
231+
ble-color-setface syntax_history_expansion bg=94,fg=231
232+
ble-color-setface syntax_function_name fg=92,bold
233+
ble-color-setface syntax_comment fg=242
234+
ble-color-setface syntax_glob fg=198,bold
235+
ble-color-setface syntax_brace fg=37,bold
236+
ble-color-setface syntax_tilde fg=navy,bold
237+
ble-color-setface syntax_document fg=94
238+
ble-color-setface syntax_document_begin fg=94,bold
239+
ble-color-setface command_builtin_dot fg=red,bold
240+
ble-color-setface command_builtin fg=red
241+
ble-color-setface command_alias fg=teal
242+
ble-color-setface command_function fg=92
243+
ble-color-setface command_file fg=green
244+
ble-color-setface command_keyword fg=blue
245+
ble-color-setface command_jobs fg=red
246+
ble-color-setface command_directory fg=26,underline
238247
ble-color-setface filename_directory underline,fg=26
239248
ble-color-setface filename_directory_sticky underline,fg=white,bg=26
240249
ble-color-setface filename_link underline,fg=teal
@@ -250,12 +259,15 @@ ble-color-setface filename_block underline,fg=yellow,bg=black
250259
ble-color-setface filename_warning underline,fg=red
251260
ble-color-setface filename_url underline,fg=blue
252261
ble-color-setface filename_ls_colors underline
253-
ble-color-setface auto_complete fg=238,bg=254
254-
ble-color-setface menu_filter_fixed bold
255-
ble-color-setface menu_filter_input fg=16,bg=229
256-
ble-color-setface vbell reverse
257-
ble-color-setface vbell_erase bg=252
258-
ble-color-setface vbell_flash fg=green,reverse
262+
ble-color-setface varname_array fg=orange,bold
263+
ble-color-setface varname_empty fg=31
264+
ble-color-setface varname_export fg=200,bold
265+
ble-color-setface varname_expr fg=92,bold
266+
ble-color-setface varname_hash fg=70,bold
267+
ble-color-setface varname_number fg=64
268+
ble-color-setface varname_readonly fg=200
269+
ble-color-setface varname_transform fg=29,bold
270+
ble-color-setface varname_unset fg=124
259271
```
260272

261273
現在の描画設定の一覧は以下のコマンドでも確認できます (`ble-color-setface` を無引数で呼び出す)。

README.md

+56-44
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,20 @@ $ make INSDIR=/path/to/blesh install
5454

5555
With `wget`:
5656
```console
57-
$ wget https://github.com/akinomyoga/ble.sh/releases/download/v0.3.0/ble-0.3.0.tar.xz
58-
$ tar xJf ble-0.3.0.tar.xz
59-
$ source ble-0.3.0/ble.sh
57+
$ wget https://github.com/akinomyoga/ble.sh/releases/download/v0.3.1/ble-0.3.1.tar.xz
58+
$ tar xJf ble-0.3.1.tar.xz
59+
$ source ble-0.3.1/ble.sh
6060
```
6161
With `curl`:
6262
```console
63-
$ curl -LO https://github.com/akinomyoga/ble.sh/releases/download/v0.3.0/ble-0.3.0.tar.xz
64-
$ tar xJf ble-0.3.0.tar.xz
65-
$ source ble-0.3.0/ble.sh
63+
$ curl -LO https://github.com/akinomyoga/ble.sh/releases/download/v0.3.1/ble-0.3.1.tar.xz
64+
$ tar xJf ble-0.3.1.tar.xz
65+
$ source ble-0.3.1/ble.sh
6666
```
6767

6868
If you want to place `ble.sh` in a specific directory, just copy the directory:
6969
```console
70-
$ cp -r ble-0.3.0 /path/to/blesh
70+
$ cp -r ble-0.3.1 /path/to/blesh
7171
```
7272

7373
## Setup `.bashrc`
@@ -192,37 +192,46 @@ bleopt edit_abell=
192192

193193
The colors and attributes used in the syntax highlighting are controlled by `ble-color-setface` function. The following code reproduces the default configuration:
194194
```bash
195-
ble-color-setface region bg=60,fg=white
196-
ble-color-setface region_target bg=153,fg=black
197-
ble-color-setface region_match bg=55,fg=white
198-
ble-color-setface region_insert fg=12,bg=252
199-
ble-color-setface disabled fg=242
200-
ble-color-setface overwrite_mode fg=black,bg=51
201-
ble-color-setface syntax_default none
202-
ble-color-setface syntax_command fg=brown
203-
ble-color-setface syntax_quoted fg=green
204-
ble-color-setface syntax_quotation fg=green,bold
205-
ble-color-setface syntax_expr fg=26
206-
ble-color-setface syntax_error bg=203,fg=231
207-
ble-color-setface syntax_varname fg=202
208-
ble-color-setface syntax_delimiter bold
209-
ble-color-setface syntax_param_expansion fg=purple
210-
ble-color-setface syntax_history_expansion bg=94,fg=231
211-
ble-color-setface syntax_function_name fg=92,bold
212-
ble-color-setface syntax_comment fg=242
213-
ble-color-setface syntax_glob fg=198,bold
214-
ble-color-setface syntax_brace fg=37,bold
215-
ble-color-setface syntax_tilde fg=navy,bold
216-
ble-color-setface syntax_document fg=94
217-
ble-color-setface syntax_document_begin fg=94,bold
218-
ble-color-setface command_builtin_dot fg=red,bold
219-
ble-color-setface command_builtin fg=red
220-
ble-color-setface command_alias fg=teal
221-
ble-color-setface command_function fg=92
222-
ble-color-setface command_file fg=green
223-
ble-color-setface command_keyword fg=blue
224-
ble-color-setface command_jobs fg=red
225-
ble-color-setface command_directory fg=26,underline
195+
# highlighting related to editing
196+
ble-color-setface region bg=60,fg=white
197+
ble-color-setface region_target bg=153,fg=black
198+
ble-color-setface region_match bg=55,fg=white
199+
ble-color-setface region_insert fg=12,bg=252
200+
ble-color-setface disabled fg=242
201+
ble-color-setface overwrite_mode fg=black,bg=51
202+
ble-color-setface auto_complete fg=238,bg=254
203+
ble-color-setface menu_filter_fixed bold
204+
ble-color-setface menu_filter_input fg=16,bg=229
205+
ble-color-setface vbell reverse
206+
ble-color-setface vbell_erase bg=252
207+
ble-color-setface vbell_flash fg=green,reverse
208+
209+
# syntax highlighting
210+
ble-color-setface syntax_default none
211+
ble-color-setface syntax_command fg=brown
212+
ble-color-setface syntax_quoted fg=green
213+
ble-color-setface syntax_quotation fg=green,bold
214+
ble-color-setface syntax_expr fg=26
215+
ble-color-setface syntax_error bg=203,fg=231
216+
ble-color-setface syntax_varname fg=202
217+
ble-color-setface syntax_delimiter bold
218+
ble-color-setface syntax_param_expansion fg=purple
219+
ble-color-setface syntax_history_expansion bg=94,fg=231
220+
ble-color-setface syntax_function_name fg=92,bold
221+
ble-color-setface syntax_comment fg=242
222+
ble-color-setface syntax_glob fg=198,bold
223+
ble-color-setface syntax_brace fg=37,bold
224+
ble-color-setface syntax_tilde fg=navy,bold
225+
ble-color-setface syntax_document fg=94
226+
ble-color-setface syntax_document_begin fg=94,bold
227+
ble-color-setface command_builtin_dot fg=red,bold
228+
ble-color-setface command_builtin fg=red
229+
ble-color-setface command_alias fg=teal
230+
ble-color-setface command_function fg=92
231+
ble-color-setface command_file fg=green
232+
ble-color-setface command_keyword fg=blue
233+
ble-color-setface command_jobs fg=red
234+
ble-color-setface command_directory fg=26,underline
226235
ble-color-setface filename_directory underline,fg=26
227236
ble-color-setface filename_directory_sticky underline,fg=white,bg=26
228237
ble-color-setface filename_link underline,fg=teal
@@ -238,12 +247,15 @@ ble-color-setface filename_block underline,fg=yellow,bg=black
238247
ble-color-setface filename_warning underline,fg=red
239248
ble-color-setface filename_url underline,fg=blue
240249
ble-color-setface filename_ls_colors underline
241-
ble-color-setface auto_complete fg=238,bg=254
242-
ble-color-setface menu_filter_fixed bold
243-
ble-color-setface menu_filter_input fg=16,bg=229
244-
ble-color-setface vbell reverse
245-
ble-color-setface vbell_erase bg=252
246-
ble-color-setface vbell_flash fg=green,reverse
250+
ble-color-setface varname_array fg=orange,bold
251+
ble-color-setface varname_empty fg=31
252+
ble-color-setface varname_export fg=200,bold
253+
ble-color-setface varname_expr fg=92,bold
254+
ble-color-setface varname_hash fg=70,bold
255+
ble-color-setface varname_number fg=64
256+
ble-color-setface varname_readonly fg=200
257+
ble-color-setface varname_transform fg=29,bold
258+
ble-color-setface varname_unset fg=124
247259
```
248260

249261
The current list of faces can be obtained by the following command (`ble-color-setface` without arguments):

blerc

+11-2
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,12 @@
372372
# ble-color-setface syntax_quoted fg=green
373373
# ble-color-setface syntax_quotation fg=green,bold
374374
# ble-color-setface syntax_expr fg=navy
375-
# ble-color-setface syntax_error bg=203,fg=231 # bg=224
375+
# ble-color-setface syntax_error bg=203,fg=231
376376
# ble-color-setface syntax_varname fg=202
377377
# ble-color-setface syntax_delimiter bold
378378
# ble-color-setface syntax_param_expansion fg=purple
379379
# ble-color-setface syntax_history_expansion bg=94,fg=231
380-
# ble-color-setface syntax_function_name fg=92,bold # fg=purple
380+
# ble-color-setface syntax_function_name fg=92,bold
381381
# ble-color-setface syntax_comment fg=gray
382382
# ble-color-setface syntax_glob fg=198,bold
383383
# ble-color-setface syntax_brace fg=37,bold
@@ -407,6 +407,15 @@
407407
# ble-color-setface filename_warning underline,fg=red
408408
# ble-color-setface filename_url underline,fg=blue
409409
# ble-color-setface filename_ls_colors underline
410+
# ble-color-setface varname_array fg=orange,bold
411+
# ble-color-setface varname_empty fg=31
412+
# ble-color-setface varname_export fg=200,bold
413+
# ble-color-setface varname_expr fg=92,bold
414+
# ble-color-setface varname_hash fg=70,bold
415+
# ble-color-setface varname_number fg=64
416+
# ble-color-setface varname_readonly fg=200
417+
# ble-color-setface varname_transform fg=29,bold
418+
# ble-color-setface varname_unset fg=124
410419

411420

412421
##-----------------------------------------------------------------------------

generate-release-note.sh

+62-32
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
2+
3+
fname_changelog=changelog.txt
4+
5+
function read-arguments {
6+
while (($#)); do
7+
local arg=$1; shift 1
8+
case $arg in
9+
(--changelog)
10+
if (($#)); then
11+
fname_changelog=$1; shift
12+
else
13+
flags=E$flags
14+
echo "release-note: missing option argument for '$arg'." >&2
15+
fi ;;
16+
esac
17+
done
18+
}
19+
read-arguments "$@"
220

321
function process {
422
## @arr commits
@@ -7,44 +25,56 @@ function process {
725
## そして before は after に対応する master における commit である。
826
local -a commits; commits=("$@")
927

28+
local commit_pair
1029
for commit_pair in "${commits[@]}"; do
11-
local b=${commit_pair#*:}
12-
local a=${commit_pair%:*}
30+
local a=${commit_pair%%:*}
31+
commit_pair=${commit_pair:${#a}+1}
32+
local b=${commit_pair%%:*}
33+
local c=${commit_pair#*:}
1334

14-
local result=$(sed -n "s/$b/$a (master: $b)/p" changelog.txt)
35+
local result=
36+
[[ $b ]] && result=$(sed -n "s/$b/$a (master: $b)/p" "$fname_changelog")
1537
if [[ $result ]]; then
1638
echo "$result"
39+
elif [[ $c ]]; then
40+
echo "- $c $a (master: ${b:-N/A}) @@@NOT-FOUND@@@"
1741
else
1842
echo "@@@not found $a"
1943
fi
2044
done
2145
}
2246

23-
# ble-0.3.0
24-
#
25-
# 232767a:30cc31c
26-
# 244205f:3f1f472
27-
# 655fbaa:2e6f44c
28-
# 1bc9934:b29f248
29-
# 910313e:309b9e4
30-
# e6ae0be:ab8dad2
31-
# a235aa4:467b7a4
32-
# d2aa2d2:1666ec2
33-
# 8926704:4ce2753
34-
# 7b15550:d94f691
35-
# f8bdf9d:376bfe7
36-
# 45db2ec:b52da28
37-
38-
# ble-0.2.0
39-
#
40-
process \
41-
6713766:f199215 \
42-
b109b46:88a1b0f \
43-
73a191d:36b9a8f \
44-
ae72dc3:ae176b2 \
45-
50fbadf:8e4180c \
46-
7109acf:4efe1a9 \
47-
637ec53:f20f840 \
48-
6f5058d:a46ada0 \
49-
6c931fd:9290adb \
50-
6ad206a:9892d63
47+
function find-commit-pairs {
48+
{
49+
echo __MODE_HEAD__
50+
git log --format=format:'%h%s' --date-order --abbrev-commit "$1"..HEAD; echo
51+
echo __MODE_MASTER__
52+
git log --format=format:'%h%s' --date-order --abbrev-commit "${2:-master}"; echo
53+
} | awk -F '' '
54+
/^__MODE_HEAD__$/ {
55+
mode = "head";
56+
nlist = 0;
57+
next;
58+
}
59+
/^__MODE_MASTER__$/ { mode = "master"; next; }
60+
61+
mode == "head" {
62+
i = nlist++;
63+
titles[i] = $2
64+
commit_head[i] = $1;
65+
title2index[$2] = i;
66+
}
67+
mode == "master" && (i = title2index[$2]) != "" && commit_master[i] == "" {
68+
commit_master[i] = $1;
69+
}
70+
71+
END {
72+
for (i = 0; i < nlist; i++) {
73+
print commit_head[i] ":" commit_master[i] ":" titles[i];
74+
}
75+
}
76+
'
77+
}
78+
79+
IFS=$'\n' eval 'commit_pairs=($(find-commit-pairs "$@"))'
80+
process "${commit_pairs[@]}"

0 commit comments

Comments
 (0)