Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

Enables clap's env feature and adds environment variable mappings for all global CLI arguments.

Changes

  • Added env feature to clap dependency
  • Mapped global arguments to environment variables using DUA_ prefix:
    • DUA_THREADS--threads
    • DUA_FORMAT--format
    • DUA_APPARENT_SIZE--apparent-size
    • DUA_COUNT_HARD_LINKS--count-hard-links
    • DUA_STAY_ON_FILESYSTEM--stay-on-filesystem
    • DUA_IGNORE_DIRS--ignore-dirs
    • DUA_LOG_FILE--log-file

Usage

# Set default format
export DUA_FORMAT=metric
dua

# CLI args override env vars
DUA_FORMAT=bytes dua --format metric  # Uses metric

Environment variables are documented in --help output and work across all subcommands.

Original prompt

Add support for environment variables for all global arguments. This needs the env feature to be enabled in clap.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add support for environment variables for global arguments Add environment variable support for global arguments Jan 5, 2026
Copilot AI requested a review from Byron January 5, 2026 16:50
- `DUA_THREADS` → `--threads`
- `DUA_FORMAT` → `--format`
- `DUA_APPARENT_SIZE` → `--apparent-size`
- `DUA_COUNT_HARD_LINKS` → `--count-hard-links`
- `DUA_STAY_ON_FILESYSTEM` → `--stay-on-filesystem`
- `DUA_IGNORE_DIRS` → `--ignore-dirs`
- `DUA_LOG_FILE` → `--log-file`

Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
@Byron Byron force-pushed the copilot/add-env-support-global-arguments branch from 4bc5671 to 85c7c72 Compare January 5, 2026 17:39
@Byron Byron marked this pull request as ready for review January 5, 2026 17:40
@Byron
Copy link
Owner

Byron commented Jan 5, 2026

Perfect!

@Byron Byron merged commit 72f149c into main Jan 5, 2026
1 of 2 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