https://github.com/hedzr/ini-op
small command-line tool to read/write inifile. it's used by my `git-submodule-rm` script
https://github.com/hedzr/ini-op
cmdr command-line command-line-tool golang ini ini-parser inifile
Last synced: about 1 month ago
JSON representation
small command-line tool to read/write inifile. it's used by my `git-submodule-rm` script
- Host: GitHub
- URL: https://github.com/hedzr/ini-op
- Owner: hedzr
- License: mit
- Created: 2019-02-09T17:03:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-01-23T02:21:51.000Z (4 months ago)
- Last Synced: 2025-03-25T22:35:10.635Z (about 2 months ago)
- Topics: cmdr, command-line, command-line-tool, golang, ini, ini-parser, inifile
- Language: Go
- Homepage:
- Size: 81.1 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# ini-op
[](https://travis-ci.org/hedzr/ini-op)
[](https://goreportcard.com/report/github.com/hedzr/ini-op)
Read/Write inifile. Especially deleting an entry or a section.
It's used for my [git-submodule-rm](https://gist.github.com/hedzr/eff2a3b67efa3d3c52a0fc0d292182d5).
```bash
$ bin/ini-op
ini-op is an effective tool for read/write inifile by Hedzr Yeh - v0.2.3Usages:
ini-op [Commands] [Options] [Parent/Global Options]Commands:
e, entry get/put entry.
s, section, sec get/put section
[Misc]
g, generate, gen generators for this app.
version, ver Show the version of this app.Options:
[Misc]
--config=[Location of config file] load config files from where you specified
-q, --quiet No more screen output. (default=false)
-v, --verbose, --vv, --vvv Show this help screen (default=false)
-V, --version Show the version of this app. (default=false)Type '-h' or '--help' to get command help screen.
```## History
- v0.3.9
- upgrade to [hedzr/cmdr](https://github.com/hedzr/cmdr) v1.11.9+
- security maintains since golang/x/net should be upgraded
- remove unavailable travis actions
- enable github actions
- packaged to github packages: [here](https://github.com/users/hedzr/packages/container/package/ini-op)
- keep dockerhub release## Commands
[TODO] The following chapters need to be simplified.
### command `section`
```bash
$ bin/ini-op section
ini-op is an effective tool for read/write inifile by Hedzr Yeh - v0.2.3Usages:
ini-op section [Sub-Commands] [Options] [Parent/Global Options]Description:
get/put sectionSub-Commands:
g, get, rd, read get a section
r, rm, remove, del, erase, delete remove a scrtionGlobal Options:
[Misc]
--config=[Location of config file] load config files from where you specified
-q, --quiet No more screen output. (default=false)
-v, --verbose, --vv, --vvv Show this help screen (default=false)
-V, --version Show the version of this app. (default=false)Type '-h' or '--help' to get command help screen.
```Usages:
```bash
# print `server` section
$ ini-op s get server $HOME/abc.ini
# delete `server` section
$ ini-op s rm server $HOME/abc.ini```
### command `entry`
```bash
$ bin/ini-op entry
ini-op is an effective tool for read/write inifile by Hedzr Yeh - v0.2.3Usages:
ini-op entry [Sub-Commands] [Options] [Parent/Global Options]Description:
get/put entry.Sub-Commands:
g, get, rd, read get an entry.
p, put put value to an entry.
r, rm, remove, del, erase, delete remove an entry.Global Options:
[Misc]
--config=[Location of config file] load config files from where you specified
-q, --quiet No more screen output. (default=false)
-v, --verbose, --vv, --vvv Show this help screen (default=false)
-V, --version Show the version of this app. (default=false)Type '-h' or '--help' to get command help screen.
```Usages:
```bash
# print section `server`, entry `port`
$ ini-op e get server port $HOME/abc.ini
$ ini-op e put server port 1313 $HOME/abc.ini
$ ini-op e rm server port $HOME/abc.ini
```## **TODO**
- [x] rewrite with new `cmdr`;
- [ ] add `yaml`, `json`, and `toml` supports;
- [ ] clean codes## Contrib
Feel free to issue.
## LICENSE
MIT