vnetod/README.md

102 lines
2.1 KiB
Markdown
Raw Normal View History

2022-08-02 15:41:38 +03:00
# vnetod*
2022-07-29 16:42:05 +03:00
2022-08-02 15:41:38 +03:00
<small><strong>*</strong> inverted word "dotenv"</small>
2022-07-29 16:42:05 +03:00
2022-08-02 15:41:38 +03:00
Are you still switching sections in your dotenv file manually? Try this dotenv
section switcher!
You can create many sections in your `.env` and switch between them.
2022-07-29 16:42:05 +03:00
Rules:
- State name starts on a new line with `###` symbols (Ex. `### local`)
2022-08-01 00:03:07 +03:00
- State name can contain multiple comma-separated sections (Ex.
`### local,staging`)
- Each section may specify a namespace (Ex. `### debug:on,dev:on`). If a section
doesn't contain a namespace, it's a global namespace.
2022-07-29 16:42:05 +03:00
- State ends if line is empty or contains a new state name.
You can see the [full example].
[full example]: https://git.pleshevski.ru/pleshevskiy/vnetod/src/branch/main/.env.example
# Usage
Basic usage
2022-07-29 16:42:05 +03:00
```sh
cp .env.example .env
vnetod local # enable local section
vnetod staging # enable staging section
vnetod local debug # enable local and debug sections
vnetod # disable all sections
```
This tool uses `.env` from your current location, but you can change this
behavior with the `-f` (`--file`) flag.
```sh
cp .env.example .env.properties
2022-08-01 12:49:52 +03:00
vnetod -f .env.properties local
```
And you can also change the output file with the `-o` (`--output`) flag, if you
don't want to overwrite the input file.
```sh
vnetod -f .env.example -o .env local
```
You can also use variables from namespaces
```sh
vnetod db:staging debug:off
```
You can switch between states and overwrite from namespaces at the same time.
```sh
vnetod local db:staging debug:off
2022-07-29 16:42:05 +03:00
```
For more information, see the help.
```sh
vnetod --help
```
2022-07-31 23:55:35 +03:00
# Install
## Cargo
```sh
cargo install vnetod
```
## Docker
```sh
docker run --rm -it -v $PWD:/data pleshevskiy/vnetod --help
```
## Nix
```sh
nix run git+https://git.pleshevski.ru/pleshevskiy/vnetod -- --help
```
2022-08-02 15:13:50 +03:00
# Contact me
- [send feedback](https://github.com/pleshevskiy/vnetod/discussions)
- [make an issue](https://github.com/pleshevskiy/vnetod/issues)
- matrix: @pleshevskiy:matrix.org
2022-11-07 23:29:25 +03:00
- email: dmitriy@pleshevski.ru
2022-08-02 15:13:50 +03:00
2022-07-29 16:42:05 +03:00
# License
GNU General Public License v3.0 or later
2022-08-01 16:35:34 +03:00
See [COPYING] to see the full text.
2022-07-29 16:42:05 +03:00
[COPYING]: https://git.pleshevski.ru/pleshevskiy/vnetod/src/branch/main/COPYING