Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does tar allow unhyphenated options?

When reading through man tar, you will see that nowhere is the tar command used without a hyphen. Why then does tar allow the following two commands to be valid:

tar c .
tar -c .
like image 924
Joseph Casey Avatar asked Mar 10 '23 15:03

Joseph Casey


1 Answers

3.3 The Three Option Styles

There are three styles for writing operations and options to the command line invoking tar. The different styles were developed at different times during the history of tar. These styles will be presented below, from the most recent to the oldest.

https://www.gnu.org/software/tar/manual/html_section/tar_21.html

like image 64
Ipor Sircer Avatar answered Mar 20 '23 19:03

Ipor Sircer