Dotenv section switcher
Go to file
Dmitriy Pleshevskiy be61316444
nix: fix overlays
2022-11-14 14:12:45 +03:00
docker doc: update docker readme 2022-11-12 17:06:19 +03:00
src cli: polish help output 2022-11-12 16:53:32 +03:00
test_data add support of comments 2022-08-02 00:07:44 +03:00
.env.example implement Display and Error traits for our error objects 2022-07-31 00:54:38 +03:00
.gitignore add colors 2022-11-10 00:29:28 +03:00
COPYING . 2022-07-29 16:42:05 +03:00
Cargo.lock bump vnetod version 2022-11-12 16:56:08 +03:00
Cargo.toml bump vnetod version 2022-11-12 16:56:08 +03:00
README.md doc: update rules in readme 2022-11-12 17:06:43 +03:00
default.nix add support of nix 2022-07-31 23:24:46 +03:00
flake.lock nix: use overlays instead of deprecated overlay 2022-11-07 23:38:51 +03:00
flake.nix nix: fix overlays 2022-11-14 14:12:45 +03:00
shell.nix add support of nix 2022-07-31 23:24:46 +03:00

README.md

vnetod*

* inverted word "dotenv"

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.

Rules:

  • Section name starts on a new line with ### symbols (Ex. ### local)
  • Section can contain multiple comma-separated names (Ex. ### local,staging)
  • Each section name may specify a namespace (Ex. ### debug:on,dev:on). If a section doesn't contain a namespace, it's a global namespace.
  • Section ends if line is empty or contains a new section name.

You can see the full example.

Usage

Basic usage

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.

cp .env.example .env.properties
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.

vnetod -f .env.example -o .env local

You can also use variables from namespaces

vnetod db:staging debug:off

You can switch between states and overwrite from namespaces at the same time.

vnetod local db:staging debug:off

For more information, see the help.

vnetod --help

Install

Cargo

cargo install vnetod

Docker

docker run --rm -it -v $PWD:/data pleshevskiy/vnetod --help

Nix

nix run git+https://git.pleshevski.ru/pleshevskiy/vnetod -- --help

Contact me

License

GNU General Public License v3.0 or later

See COPYING to see the full text.