Skip to content

Add POSIX keystring parsing and argv pre-expansion#114

Open
kaladron wants to merge 1 commit intouutils:mainfrom
kaladron:argfix
Open

Add POSIX keystring parsing and argv pre-expansion#114
kaladron wants to merge 1 commit intouutils:mainfrom
kaladron:argfix

Conversation

@kaladron
Copy link
Contributor

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