feat: add zoxide env command - #1287
Open
buiducnhat wants to merge 2 commits into
Open
buiducnhat wants to merge 2 commits into
buiducnhat wants to merge 2 commits into
Conversation
Adds a new subcommand to display the resolved values of zoxide's
environment variables after defaults have been applied.
$ zoxide env
_ZO_DATA_DIR=/home/user/.local/share/zoxide
_ZO_ECHO=
_ZO_EXCLUDE_DIRS=/home/user
_ZO_FZF_OPTS=
_ZO_MAXAGE=10000
_ZO_RESOLVE_SYMLINKS=
$ zoxide env _ZO_DATA_DIR
/home/user/.local/share/zoxide
Since defaults vary across platforms and require processing in Rust,
this provides a useful angle when debugging configuration issues.
Closes ajeetdsouza#803
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
zoxide envsubcommand that prints the resolved values of zoxide's environment variables after defaults have been applied, as proposed in #803.Since default environment variables vary across platforms and require processing in Rust, this provides a useful angle when debugging configuration issues.
Usage
Print all variables (
NAME=VALUE, one per line):Print a single variable (raw value, for scripting):
Notes
config.rs, so the printed output always matches runtime behavior (e.g._ZO_DATA_DIRfalls back to the platform data dir,_ZO_EXCLUDE_DIRSfalls back to the home directory glob,_ZO_MAXAGEdefaults to10000)._ZO_ECHO,_ZO_FZF_OPTS,_ZO_RESOLVE_SYMLINKS) are printed with an empty value.build.rs; azoxide-env(1)manpage is included and linked fromzoxide(1).Closes #803