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

20 Views Asked by At

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

1

There are 1 best solutions below

1
Remko Popma On

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.