Path: utzoo!mnetor!uunet!husc6!bu-cs!bzs From: bzs@bu-cs.BU.EDU (Barry Shein) Newsgroups: comp.unix.wizards Subject: Re: command line options Message-ID: <21473@bu-cs.BU.EDU> Date: 11 Apr 88 23:29:48 GMT References: <12908@brl-adm.ARPA> <10302@tut.cis.ohio-state.edu> Organization: Boston U. Comp. Sci. Lines: 67 In-reply-to: lvc@tut.cis.ohio-state.edu's message of 11 Apr 88 22:05:13 GMT >How about: > > usage command > >This is guaranteed to work no matter what the command usage is >and only requires the addition of a new command. If someone is >competent enough to type -usage then this should be just as easy. >It even takes fewer characters to type than command -usage. > >Seriously, the -= sounds like a good idea, I'm going to use it >until something better comes along. >-- >Larry Cipriani, AT&T Network Systems and Ohio State University Actually, that's not a bad idea at all, it could be a sort of mutant merger of "which" and "what", that is the function of "which" (or hell, could just use which, that's what it's there for) to track down the command path and a version of "what" to track down some pattern other than "@(#)", heck, how about an option to "what" which (no quotes) just specifies an alternate pattern, like "@(U)" or something, and call the whole mess "how", then it would just be equivalent to something like: how() { for i do what -p '@(U)' `which $i` done } Hmm, pretty similar to: how() { for i do strings `which $i` | grep '@(U)' done } For systems with "strings". I suppose one could substitute the path for the user by replacing a first %s with the command name: how() { for i do strings `which $i` | grep '@(U)' | sed "s/%s/$i/" done } As a matter of fact, I wonder how badly this would work without any changes: how() { for i do strings `which $i` | grep '[Uu]sage:' | sed "s/%s/$i/" done } or its moral equivalent, or similarly if 'what' took a prefix arg then "what -p 'Usage:'" might do the job, tho some programs seem to use "usage:". who's on first, how ever. -Barry Shein, Boston University