https://github.com/kekepower/zini
A Zsh INI file reader
https://github.com/kekepower/zini
ini ini-reader shell shell-functions shell-script zsh zsh-function
Last synced: about 1 month ago
JSON representation
A Zsh INI file reader
- Host: GitHub
- URL: https://github.com/kekepower/zini
- Owner: kekePower
- License: gpl-3.0
- Created: 2024-02-21T12:56:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-23T22:12:16.000Z (over 2 years ago)
- Last Synced: 2024-12-29T08:12:06.078Z (over 1 year ago)
- Topics: ini, ini-reader, shell, shell-functions, shell-script, zsh, zsh-function
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zini
A Zsh INI file reader.
I created this Zsh function as part of my [Quick Site Generator 2](https://github.com/kekePower/qsgen2) script to read the config file.
### Example INI file
```
; This is a comment
[section]
name = value
[other_section]
name = value
```
### Usage
Place the file ```zini``` in your ```fpath``` and use Zsh's ```autoload``` to load the function.
```
#!/usr/bin/zsh
# You can also add your own paths to fpath
# and place zini there.
fpath=(${HOME}/zsh-functions $fpath)
autoload zini
zini /path/to/your/ini-file
```
Then you can fetch the values like this
```
${config[section_name]}
${config[other_section_name]}
```