Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Found 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.


Isn't that expecting say pr +4 -172

to format for printing starting at page 4, on a wide 172 colunn paper?


Ah, yes, you're right...


I think the "find" command was around before then, and it has long options. For example:

    find dir -type f -name "*.h" -print


Those 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".


Find 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: