LWN.net Logo

Advertisement

E-Commerce & credit card processing - the Open Source way!

Advertise here

Metaphors make the operating system (NewsForge)

Metaphors make the operating system (NewsForge)

Posted Apr 30, 2003 14:09 UTC (Wed) by iabervon (subscriber, #722)
In reply to: Metaphors make the operating system (NewsForge) by amikins
Parent article: Metaphors make the operating system (NewsForge)

The tricky thing with completions is things like "cvs c[tab]"; the shell needs to know that the completions are "checkout" and "commit", and then it needs to know what the options are after the command, and it needs to know that "cvs diff -D yes[tab]" is "yesterday", and "cvs diff -u" is an rcsdiff option, not CVS's responsibility at all, but still valid.

Beyond that, the information really ought to come out of the program itself, so that it stays in sync with what will actually happen if you type it and hit return (even if you've changed your $PATH or put in something that the package manager doesn't know about, or are doing "./a.out -[tab]"). That's why I think it should start with GNU binutils and bash; it would then work for a lot of the simple stuff where it's most convenient and expected, and the same group is responsible for both sides. Probably cvs should be initially supported, too, so the solution is not too simplistic. I think a section or a symbol in the binary would be good, easy to support, and would stay out of the way of anything that didn't support it. For that matter, you could have an extension of getopt that would parse the command line inside the program based on the same information that the shell used to guide the user in creating the command line.


(Log in to post comments)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds