Skip to content

Add POSIX keystring parsing and argv pre-expansion#114

Merged
sylvestre merged 1 commit intouutils:mainfrom
kaladron:argfix
Mar 25, 2026
Merged

Add POSIX keystring parsing and argv pre-expansion#114
sylvestre merged 1 commit intouutils:mainfrom
kaladron:argfix

Conversation

@kaladron
Copy link
Collaborator

Support traditional key syntax (for example tar cvf archive.tar file) by rewriting a leading key operand into clap-compatible short options before argument parsing.

  • detect valid keystrings in argv[1]
  • expand key letters into -<opt> arguments
  • consume operands for f and b in key order
  • forward -b (currently unsupported) so key/dash forms fail consistently
  • update usage text to document key syntax
  • add unit tests for key detection/expansion
  • add integration tests for create/extract parity and -b failure parity

GNU relaxes the POSIX ordering rules for the key, so we do too.

Support traditional key syntax (for example `tar cvf archive.tar file`)
by rewriting a leading key operand into clap-compatible short options
before argument parsing.

- detect valid keystrings in argv[1]
- expand key letters into `-<opt>` arguments
- consume operands for `f` and `b` in key order
- forward `-b` (currently unsupported) so key/dash forms fail consistently
- update usage text to document key syntax
- add unit tests for key detection/expansion
- add integration tests for create/extract parity and `-b` failure parity
@kaladron
Copy link
Collaborator Author

Friendly nudge on this PR? =)

@sylvestre sylvestre merged commit 42a1c34 into uutils:main Mar 25, 2026
13 checks passed
@sylvestre
Copy link
Contributor

no comment, thanks :)

@codecov
Copy link

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (464f265) to head (96e957c).
⚠️ Report is 34 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #114   +/-   ##
===========================
===========================

☔ 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.

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.

3 participants