5 ms·
I was surprised to read that long options were invented so recently, in only 1990.
by cecilpl2 6y ago
I was surprised to read that long options were invented so recently, in only 1990.
- tyingq 6y agoPretty sure some programs used them before 1990, just not with a convenient getopt_long(). I know it's not the best example, but 'dd' used things like "if=whatever skip=123" prior to 1990. The article also mentions find, but it used single dash long options.
- adrianmonk 6y agoI think the "find" command was around before then, and it has long options. For example: find dir -type f -name "*.h" -print
- tzs 6y agoThose aren't really options. The syntax of the find command is find <options> <paths> <expression> Those thing you list are part of the <expression> part of the command. The <options> part in BSD find, and I believe GNU find, only uses options of the form -X where X is a single character. It's a little confusing because the man pages for both BSD and GNU find do call some of the things that appear in the <expression> part of the command "options".
- macintux 6y agoFind is specifically called out in the article. > There were a few programs that ran on Unix systems and used long option names starting with either - or no prefix at all, such as find, but those syntaxes were not compatible with Unix getopt() and were parsed by ad-hoc code.
- tyingq 6y agoFound an example that's a bit closer, from Minix 1.0, 1987. The "pr" program: Usage: pr [+page] [-columns] [-h header] [-w with] [-l length] [-nt] [files] Mixed in this case, with -columns and +page, and all hand parsed. But long options nonetheless.
- adrianmonk 6y agoI think what's recent is the syntax for mixing short and long options together on the same command. Some commands had long options, some had short, but with "--" one command can have both.
- haolez 6y agoWell... at that time, paper terminals were still in use in some places. The gap between legacy and modern hardware that was in operation was huge.