Search results
Jan 26, 2016 · The --long-opt method is a GNUism that has been initiated around 1990.. Multics uses -long options with a single dash and the Multics project was initiated the 1960s.. UNOS is the first UNIX clone (initiated by a group of former AT&T employees in 1980) and UNOS introduced a generalized option parser (the first in the UNIX world) in April 1982.
Note that getopt() was first published in 1985, but UNOS (the oldest UNIX clone) published getargs() in 1982 already (it was written in 1980) and getargs() supports short options and single dash long options (Multics style). UNOS massively used single dash long options and UNOS was written by former AT&T employees.
Initially, Unix programs took single-letter options preceded by a single dash and optionally bundled: ls -laF. ls -l -a -F. The two commands above are equal. When an option takes a value, it overrides bundling: In gpg -aofoo.gpg, -a and -o are options and foo.gpg is the value given to -o. Most of them did, anyway. tar cvzf is a common sight.
Oct 16, 2014 · It seems that most (a lot of) commands implement option arguments like this: if a short option requires an option argument, the option is separated by a space from the option argument, e.g. $ head -n 10. if a long option requires an option argument, the option is separated by a = from the option argument, e.g. $ head --lines=10.
Dec 13, 2023 · A single hyphen can be followed by multiple single-character flags. A double hyphen prefixes a single, multicharacter option. Consider this example: tar -czf In this example, -czf specifies three single-character flags: c, z, and f. Now consider another example: tar --exclude In this case, --exclude specifies a single, multicharacter option ...
May 7, 2022 · A further complication to parsing the command line was that single-dash long options that took values couldn’t allow the value to be part of the same command line argument. Thus, -display :0 (two words) was correct, but it could not be written as -display:0 , because a simple C command line parser would have difficulty figuring out what was the option name and what was the option’s value.
People also ask
Which Unix clone has a single dash long option?
Does GNU have a double dash long option?
What is UNOS clone?
What does a solo dash mean in Unix?
Why do unixoid commands have short and long options?
Does UNOS have a single dash long option?
Aug 24, 2016 · GNU-style long options have the difficulty that arguments can be joined or not. With single-dash multi-character options, there isn't any parsing difficulty so you can easily do it by hand. Most programs with single-dash multi-character options take arguments in a separate command line argument. foo=. bar=default.