Skip to content

feat: add --print-path flag to display path in output#63

Open
kimjune01 wants to merge 1 commit into
sharkdp:masterfrom
kimjune01:add-print-path-flag
Open

feat: add --print-path flag to display path in output#63
kimjune01 wants to merge 1 commit into
sharkdp:masterfrom
kimjune01:add-print-path-flag

Conversation

@kimjune01
Copy link
Copy Markdown

Summary

  • Add --print-path / -P flag that includes the measured directory path alongside the size in the output
  • Useful when diskus is used in scripts or when measuring multiple paths to correlate sizes with directories

Fixes #41

Test plan

  • Flag compiles and produces output with path prepended
  • Without flag, output remains unchanged (backward compatible)

Addresses issue sharkdp#41 by adding an optional --print-path flag that
appends the path to the output, matching the desired behavior:

  diskus --print-path /tmp
  57872384	/tmp

Implementation details:
- Uses tab separator for machine-parseable output
- Rejects multiple paths with --print-path to avoid ambiguity
- Preserves existing output format when flag is not used
- Works correctly with paths containing spaces

The flag is restricted to single-path usage. For multiple paths,
users should call diskus separately for each path.
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.

Provide path in output

1 participant