6 ms·
Pretty 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=what
by tyingq 6y ago
Pretty 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.