[X-Unix] Hiding apps from the command line

Kirk McElhearn kirklists at wanadoo.fr
Fri Mar 26 05:49:29 PST 2004


On 3/26/04 2:37 PM, "Eugene Lee" <list-themacintoshguy at fsck.net> wrote:

> 
> Well, from a Unix perspective, I'd rather see the options prefixed with
> traditional hyphens.  Also, there's the issue of whether hiding Finder
> as well is desired or not.  For me, I envisioned it to work like so:
> 
> $ hide -o appname
> $ hide -o -f appname
> $ hide -a
> $ hide -a -f
> $ hide -f
> $ hide appname

It's true that adding hyphens is more traditional; it just seemed like an
extra keystroke. But you're right.
> 
> Another problem altogether is the fact that the logic is backwards
> between the "hide -o appname" and the normal "hide appname".  In the
> normal latter case, the logic is simple: hide the app named "appname".
> However, in the former case, the logic is reversed: hide all other apps
> *excluding* the app named "appname".  A part of me wants to fix this by
> introducing another command option (-x) to represent this logic, which
> changes the former case to "hide -o -x appname".  However, there's a
> part of me that thinks this is overkill and is complicating an otherwise
> simple shell script.

IMO, it's best to have only single options - otherwise you might tend to
think you could combine them, which you can't. If the script has to parse
multiple options it'll get way more complex.

But I'll agree with the -x option - that's better than -o.

So I have this:

# hide [appname]   - hides specified app
# hide -x [appname] - hides all other apps
# hide -a           - hides all apps but Finder
# hide -f           - hides Finder
# hide -v [appname] - brings specified app to the front, whether it is
hidden or visible already
# hide -t           - shows all apps
> 
> Thoughts?  What do other Unix folks think?
> 
> BTW, Kirk, contact me off-list if you're interested in a more complex,
> fully-featured version for inclusion into the book.

Will do.
 
 
Kirk
 
        My latest book: How to Do Everything with Mac OS X Panther
                  http://www.mcelhearn.com/htde.html
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 . . . . . . .  kirk at mcelhearn.com | http://www.mcelhearn.com  . . . . . .
 . .  Kirk McElhearn | Chemin de la Lauze | 05600 Guillestre | France  . .



More information about the X-Unix mailing list