Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _apm (was Re: Functions moved)
- X-seq: zsh-workers 13899
- From: Clint Adams <schizo@xxxxxxxxxx>
- To: Oliver Kiddle <opk@xxxxxxxxxxxxx>
- Subject: Re: _apm (was Re: Functions moved)
- Date: Tue, 3 Apr 2001 17:26:54 -0400
- Cc: Zsh workers <zsh-workers@xxxxxxxxxx>
- In-reply-to: <3ACA2CC7.69FF9B8D@xxxxxxxxxxxxx>; from opk@xxxxxxxxxxxxx on Tue, Apr 03, 2001 at 09:04:23PM +0100
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <200104021441.QAA12200@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20010402112428.A12039@xxxxxxxx> <3ACA2CC7.69FF9B8D@xxxxxxxxxxxxx>
> Hopefully nobody feels the need to write a completion for it just yet
> because we haven't decided on how to cope with that situation yet.
Presumably one could use a similar OS detection test.
> Wouldn't it make sense to use $OSTYPE like we do in other places such as
> _mount? It would allow the FreeBSD and OpenBSD parts to be actually
> usable and is probably sufficient intelligence for this. You could argue
> that we should call apm and try to work out what it is but $OSTYPE is
> going to be faster.
Fair enough.
Index: Completion/Unix/Command/_apm
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_apm,v
retrieving revision 1.1
diff -u -r1.1 _apm
--- Completion/Unix/Command/_apm 2001/04/02 19:21:18 1.1
+++ Completion/Unix/Command/_apm 2001/04/03 21:26:24
@@ -1,9 +1,6 @@
#compdef apm
-# this needs intelligence
-local kludge=linux
-
-if [[ $kludge == "linux" ]]
+if [[ $OSTYPE == linux* ]]
then
_arguments -C -s \
@@ -22,7 +19,7 @@
'(--ignore)-i[tell the system to ignore system-generated APM message]' \
'(-i)--ignore[tell the system to ignore system-generated APM message]'
-elif [[ $kludge == "freebsd4.1" ]]
+elif [[ $OSTYPE == freebsd* ]]
then
_arguments -C \
@@ -38,7 +35,7 @@
'-Z[transition system into standby mode]' \
'-z[suspend the system]'
-elif [[ $kludge == "openbsd2.7" ]]
+elif [[ $OSTYPE == openbsd* ]]
then
_arguments -C \
Messages sorted by:
Reverse Date,
Date,
Thread,
Author