[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

var, whatis



Hi,
	Does anyone think the current behaviour for var and whatis is
correct?

;; whatis x rm
x not found
;; whatis rm x
/usr/bin/rm
x not found
;; var x TERM
x not found
;; var TERM x
TERM = sun
x not found

Compared with rc's behaviour:

; whatis x rm
x not found
/usr/bin/rm

	Should whatis and vars terminate after an error is detected or
should it be like rc's behaviour and give you (more usefully) the
vars/functions for the whole of command line, and report not found for those
it can't find?
	I got caught by this and did'nt realize why es was doing it until I
looked at the source code.  So here's my proposition for var and whatis:

fn var {
	for (i = $*)
		catch @ e msg { echo $msg } { echo <>{%var $i} }
}

fn whatis {
	for (i = $*)
		catch @ e msg { echo $msg } { echo <>{%whatis $i} }
}

-- Pete