Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --unset option to remove environment variables #26

Merged
merged 1 commit into from
Oct 14, 2021

Conversation

k0kubun
Copy link
Contributor

@k0kubun k0kubun commented Oct 14, 2021

It seems like envchain currently doesn't provide a way to remove namespaces or environment variables. Sometimes you may be able to set "" as a workaround, but "" vs null matters in some applications.

So I added --unset option to remove environment variables. You can also clean up namespaces you no longer use from envchain --list if you remove all environment variables under a namespace using this feature.

Example

$ ./envchain --set test TEST1 TEST2
test.TEST1: test1
test.TEST2: test2
$ ./envchain --unset test TEST2
$ ./envchain test env | grep TEST
TEST1=test1

@sorah sorah merged commit e5cb16b into sorah:master Oct 14, 2021
@k0kubun k0kubun deleted the unset-env branch October 14, 2021 16:22
@gardar
Copy link
Contributor

gardar commented Feb 8, 2022

Might be a good idea to document this option in the readme?

Also perhaps a new release is due since this option only exists on master and not in any release @sorah

sorah added a commit that referenced this pull request Apr 23, 2024
- --help now includes `--list` command
- --unset option is introduced #26
- several bug fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants