Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: _apm (was Re: Functions moved)



> 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