Skip to content

Add XDG_CONFIG_DIRS and XDG_DATA_DIRS to split environment variables#78

Merged
oalders merged 2 commits intomainfrom
split-env
Nov 19, 2025
Merged

Add XDG_CONFIG_DIRS and XDG_DATA_DIRS to split environment variables#78
oalders merged 2 commits intomainfrom
split-env

Conversation

@oalders
Copy link
Owner

@oalders oalders commented Nov 19, 2025

Summary

  • Added XDG_CONFIG_DIRS and XDG_DATA_DIRS to the list of environment variables that are split on : delimiter
  • These XDG variables now display each path on a separate line in table output, similar to PATH and MANPATH

Changes

  • Added constants for xdgConfigDirs and xdgDataDirs
  • Updated envSummary() to split these variables when displaying in tabular format
  • Updated getEnv() to split these variables when outputting as JSON

Test Plan

  • Built project successfully
  • Tested is known summary var - XDG variables now split properly
  • Tested is known var XDG_DATA_DIRS --json - JSON output returns array
  • All existing Go tests pass

Example Output

Before

┃ XDG_DATA_DIRS    ┃ /usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop ┃

After

┃ XDG_DATA_DIRS                         ┃ /usr/share/ubuntu                    ┃
┃                                       ┃ /usr/share/gnome                     ┃
┃                                       ┃ /usr/local/share/                    ┃
┃                                       ┃ /usr/share/                          ┃
┃                                       ┃ /var/lib/snapd/desktop               ┃

🤖 Generated with Claude Code

@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.96%. Comparing base (98e46ba) to head (c49492b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
+ Coverage   77.92%   77.96%   +0.03%     
==========================================
  Files          22       22              
  Lines        1128     1130       +2     
==========================================
+ Hits          879      881       +2     
  Misses        202      202              
  Partials       47       47              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

These XDG variables contain colon-separated paths similar to PATH and
MANPATH. Split them on ':' and display each path on a separate line
for better readability in table output.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@oalders oalders merged commit 0a097b3 into main Nov 19, 2025
3 checks passed
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.

2 participants