From c379f2eca9accbc87a545ef4c899177641ef7829 Mon Sep 17 00:00:00 2001 From: ADoyle Date: Fri, 6 Sep 2024 22:00:17 +0800 Subject: [PATCH] release: v0.7.0 --- CHANGELOG.md | 27 ++++++++++++++++++++++++++- VERSION | 2 +- config.example | 2 ++ docs/module-usages/README.md | 4 +++- docs/module-usages/array.md | 24 ++++++++++++++++++++++++ docs/module-usages/util.md | 2 +- src/internals/categories/array | 2 ++ src/modules/array_has_key.bash | 2 +- src/modules/array_size.bash | 2 +- 9 files changed, 61 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a398cc..c7037eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,32 @@ The versions follow the rules of [Semantic Versioning 2.0.0](http://semver.org/s ## [Unreleased] -[Full Changes](https://github.com/adoyle-h/lobash/compare/master...develop) +[Full Changes](https://github.com/adoyle-h/lobash/compare/v0.7.0...HEAD) + + + +## v0.7.0 (2024-09-06 21:38:01 +08:00) + +[Full Changes](https://github.com/adoyle-h/lobash/compare/v0.6.0...v0.7.0) + +### New Features + +- add module l.array_size ([2b4f2a1](https://github.com/adoyle-h/lobash/commit/2b4f2a1ee2e8854665fc527243004bbc78d74085)) +- add module l.parse_args. And l.parse_params is deprecated. ([b506bf5](https://github.com/adoyle-h/lobash/commit/b506bf5f8aa2da8e38f031d484b533d1c0db4e16)) + > User should use l.parse_args instead of l.parse_params. + > The l.parse_params has some limitations on use. So it is deprecated and + > will be removed in soon. +- add module l.array_has_key ([00013b0](https://github.com/adoyle-h/lobash/commit/00013b0ddb927902c5069cfa89548f351f602a22)) +- add module: is_associative_array ([80f3153](https://github.com/adoyle-h/lobash/commit/80f31539e1360b91132d02db9fe610dad5cef7c8)) +- add modules: var_attrs ([b5455e4](https://github.com/adoyle-h/lobash/commit/b5455e45abb7764f742d218700d283423f4d2e07)) + +### Document Changes + +- update docs ([e723a75](https://github.com/adoyle-h/lobash/commit/e723a75f9842a8f2f9f32e996a0e41bb1e56794a)) +- update README ([0ab8056](https://github.com/adoyle-h/lobash/commit/0ab8056872f21ec8252a46d517d9a0d6bb6c9be0)) +- improve CONTRIBUTING ([784aa24](https://github.com/adoyle-h/lobash/commit/784aa24f4ceafd44e48a0a45ef3110ba506b8018)) +- renew license && add CONTRIBUTING in Chinese ([dbd4e6d](https://github.com/adoyle-h/lobash/commit/dbd4e6d15fc649af036b40d57591eca1a6419d33)) +- update version in README ([cf8883e](https://github.com/adoyle-h/lobash/commit/cf8883ecb29b7309ec722d327b3ca1d3bd8c4bdc)) ## v0.6.0 (2022-12-15 02:35:30 +08:00) diff --git a/VERSION b/VERSION index a918a2a..faef31a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.0 +0.7.0 diff --git a/config.example b/config.example index 878f70d..abea947 100644 --- a/config.example +++ b/config.example @@ -12,9 +12,11 @@ PREFIX: l. - [ ] sub - [ ] Array + - [ ] array_has_key - [ ] array_include - [ ] array_include.s - [ ] array_reverse + - [ ] array_size - [ ] each - [ ] each.p - [ ] first diff --git a/docs/module-usages/README.md b/docs/module-usages/README.md index d59a3aa..f878589 100644 --- a/docs/module-usages/README.md +++ b/docs/module-usages/README.md @@ -1,6 +1,6 @@ # Module Usages -15 Categories, 143 Modules, 802 Test Cases. +15 Categories, 145 Modules, 817 Test Cases. Each module provides only one function which naming prefixed with `l.` by default. @@ -23,9 +23,11 @@ Most Lobash modules support Bash 4.0+ except below modules. - [inc](./arithmetic.md#inc) - [sub](./arithmetic.md#sub) - [Array](./array.md) + - [array_has_key](./array.md#array_has_key) - [array_include](./array.md#array_include) - [array_include.s](./array.md#array_includes) - [array_reverse](./array.md#array_reverse) + - [array_size](./array.md#array_size) - [each](./array.md#each) - [each.p](./array.md#eachp) - [first](./array.md#first) diff --git a/docs/module-usages/array.md b/docs/module-usages/array.md index ee5068a..ea7dbd6 100644 --- a/docs/module-usages/array.md +++ b/docs/module-usages/array.md @@ -4,9 +4,11 @@ ## TOC +- [array_has_key](#array_has_key) - [array_include](#array_include) - [array_include.s](#array_includes) - [array_reverse](#array_reverse) +- [array_size](#array_size) - [each](#each) - [each.p](#eachp) - [first](#first) @@ -20,6 +22,17 @@ ## Modules +### array_has_key + +- Usage: `l.array_has_key ` +- Description: + - Check key whether defined in array or associative array. + - Return 0 (true) or 1 (false). This function should never throw exception error. +- Since: 0.7.0 +- Bash: 4.0+ +- Test Cases: [tests/modules/array_has_key.bats](../../tests/modules/array_has_key.bats) +- Source Code: [src/modules/array_has_key.bash](../../src/modules/array_has_key.bash) + ### array_include - Usage: `l.array_include ` @@ -56,6 +69,17 @@ - Test Cases: [tests/modules/array_reverse.bats](../../tests/modules/array_reverse.bats) - Source Code: [src/modules/array_reverse.bash](../../src/modules/array_reverse.bash) +### array_size + +- Usage: `l.array_size ` +- Description: + - Return the actual size of array and associative array + - For `declare -A array=([test]='')`, the `${#array[@]}` is 0, because bash excludes the null value. +- Since: 0.7.0 +- Bash: 4.0+ +- Test Cases: [tests/modules/array_size.bats](../../tests/modules/array_size.bats) +- Source Code: [src/modules/array_size.bash](../../src/modules/array_size.bash) + ### each - Usage: diff --git a/docs/module-usages/util.md b/docs/module-usages/util.md index bb426d1..65002aa 100644 --- a/docs/module-usages/util.md +++ b/docs/module-usages/util.md @@ -47,7 +47,7 @@ - "count": the value of option defaults to 0. And increasing count by times. For example: `-v` `-vv` `-vvv`. - "kv": key/value. It means the option must has an argument. If user not pass argument to "kv" option. It will print error and stop. - See test cases for details. -- Dependent: [`each`](./array.md#each) [`match_list`](./string.md#match_list) [`var_attrs`](./variable.md#var_attrs) +- Dependent: [`each`](./array.md#each) [`match_list`](./string.md#match_list) [`var_attrs`](./variable.md#var_attrs) [`array_has_key`](./array.md#array_has_key) - Since: 0.7.0 - Bash: 4.0+ - **Notice**: **Only with bash 4.3, there may be something wrong if opts and args are not array.** diff --git a/src/internals/categories/array b/src/internals/categories/array index cca027d..3898d0f 100644 --- a/src/internals/categories/array +++ b/src/internals/categories/array @@ -1,6 +1,8 @@ +array_has_key array_include array_include.s array_reverse +array_size each each.p first diff --git a/src/modules/array_has_key.bash b/src/modules/array_has_key.bash index 1e643e6..5b4154d 100644 --- a/src/modules/array_has_key.bash +++ b/src/modules/array_has_key.bash @@ -1,6 +1,6 @@ # --- # Category: Array -# Since: next +# Since: 0.7.0 # Usage: l.array_has_key # Description: Check key whether defined in array or associative array. # Description: Return 0 (true) or 1 (false). This function should never throw exception error. diff --git a/src/modules/array_size.bash b/src/modules/array_size.bash index 7bd3c08..8012d41 100644 --- a/src/modules/array_size.bash +++ b/src/modules/array_size.bash @@ -1,6 +1,6 @@ # --- # Category: Array -# Since: next +# Since: 0.7.0 # Usage: l.array_size # Description: Return the actual size of array and associative array # Description: For `declare -A array=([test]='')`, the `${#array[@]}` is 0, because bash excludes the null value.