Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

Arguments shared between dua aggregate and dua interactive are now marked as global, making them available across all subcommands.

Changes

  • src/options.rs: Added global = true to 8 shared arguments (threads, format, apparent_size, count_hard_links, stay_on_filesystem, ignore_dirs, input, log_file)
  • src/options.rs: Removed duplicate input fields from Interactive and Aggregate subcommands
  • src/main.rs: Updated to use global opt.input instead of subcommand-specific fields

Usage

Global arguments can now be specified before the subcommand, after the subcommand, or after input paths:

# All equivalent
dua --threads 4 --format bytes aggregate /path
dua aggregate --threads 4 --format bytes /path
dua aggregate /path --threads 4 --format bytes

Help output for subcommands now displays all available global options, improving discoverability.

Original prompt

Mark all arguments that are shared between dua aggregate and dua interactive as global in clap, which makes them available for all subcommands automatically.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@Byron Byron linked an issue Jan 5, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Mark shared arguments as global in clap Mark shared arguments as global in clap Jan 5, 2026
Copilot AI requested a review from Byron January 5, 2026 15:12
- Added `global = true` to all arguments shared between aggregate and interactive subcommands
- Removed duplicate `input` fields from Interactive and Aggregate subcommands
- Updated main.rs to use opt.input instead of subcommand-specific input
- Global arguments now work with both subcommands and can be specified before or after the subcommand
@Byron Byron force-pushed the copilot/mark-global-arguments-in-clap branch from 475c882 to 2f720cf Compare January 5, 2026 16:36
@Byron Byron marked this pull request as ready for review January 5, 2026 16:36
@Byron
Copy link
Owner

Byron commented Jan 5, 2026

Great, that's exactly it!

@Byron Byron merged commit a2973a6 into main Jan 5, 2026
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.

Changing binary/metric format in interactive mode?

2 participants