Skip to content

Commit

Permalink
1.19.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
pruje committed Feb 4, 2021
1 parent 89f2e39 commit 387b446
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog
This project adheres to [Semantic Versioning](https://semver.org/).

## 1.19.0 (2021-02-04)
### New features
- New `--template` option to `lb_import_config` to import variables only defined in a template file
### Changes
- `lb_test_arguments` is deprecated, but not removed to not break compatibility

## 1.18.1 (2021-01-21)
### Bugfixes
- Fix bug that prevented email to be sent if old mail command was installed
Expand Down
32 changes: 23 additions & 9 deletions docs/libbash.md
Original file line number Diff line number Diff line change
Expand Up @@ -762,18 +762,13 @@ lb_read_config [OPTIONS] PATH
- 3: Specified section was not found

#### Examples
1. Read and print values
Read and print values
```bash
lb_read_config my_config.conf
for i in "${lb_read_config[@]}" ; do
echo "$i"
done
```
2. Analyse config file to secure import
```bash
lb_read_config --analyse template.conf
lb_import_config my_config.conf "${lb_read_config[@]}"
```

---------------------------------------------------------------
<a name="lb_import_config"></a>
Expand All @@ -795,7 +790,7 @@ lb_import_config [OPTIONS] PATH [FILTERS...]
#### Options
```
-s, --section SECTION Import parameters only in the specified section(s)
-t, --template-file FILE Use a config file as reference to import only parameters
-t, --template-file FILE Use a config file as reference to import only defined parameters
-e, --all-errors Return all errors in exit codes
-u, --unsecure Do not prevent shell injection (could be dangerous)
Expand All @@ -814,18 +809,37 @@ FILTERS List of parameters that should be imported (others wil
#### Example
```bash
### content of my_config.conf
# my config file
hello_message="Hello dear users"
hello_message = "Hello dear users"

users = (John Mark)

other_thing = "Something useless"
### end content of my_config.conf
```

1. Simple import of config:
```bash
lb_import_config my_config.conf

# print bye message
echo "$hello_message ${users[@]}"
```

2. Secure import with a template:
```bash
### content of template.conf
hello_message = ""
users = ()
### end content of template.conf

lb_import_config --template template.conf my_config.conf

# $other_thing will be empty

# print bye message
echo "$hello_message ${users[@]}"
```

---------------------------------------------------------------
<a name="lb_migrate_config"></a>
### lb_migrate_config
Expand Down
4 changes: 2 additions & 2 deletions libbash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
# Copyright (c) 2017-2021 Jean Prunneaux #
# Website: https://github.com/pruje/libbash.sh #
# #
# Version 1.18.1 (2021-01-21) #
# Version 1.19.0 (2021-02-04) #
# #
########################################################

declare -r lb_version=1.18.1
declare -r lb_version=1.19.0

# Index
#
Expand Down
2 changes: 1 addition & 1 deletion libbash_gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Copyright (c) 2017-2021 Jean Prunneaux #
# Website: https://github.com/pruje/libbash.sh #
# #
# Version 1.18.1 (2021-01-21) #
# Version 1.19.0 (2021-02-04) #
# #
########################################################

Expand Down

0 comments on commit 387b446

Please sign in to comment.