Jeff McClure
Jeff McClure

Reputation: 41

Does Picocli support tar style argument simplification? E.g. 'tar -tvf file' vs 'tar tvf file'

Does picocli support the tar-style option simplification, for example single character options do not required to prefix a group of options with a dash. For example the following are equivalent:

tar -t -v -f file

tar -tvf file

tar tvf file

Upvotes: 0

Views: 19

Answers (1)

Remko Popma
Remko Popma

Reputation: 36834

Yes, picocli supports POSIX short options out of the box. Specifically, option names consisting of a single "dash" - followed by a single character are considered POSIX short options and these may be clustered, so tar -t -v -f FILE is equivalent to tar -tvfFILE. I believe this follows the POSIX standard (Guideline 5).

However, picocli will not recognize the third pattern you describe: tar xvf FILE: the initial leading dash or hyphen - character is required.

Upvotes: 2

Related Questions