tools.which: enable use from command-line.

db4
John Benediktsson 2015-04-01 14:22:11 -07:00
parent 44bfc19e3b
commit be1a8d085d
1 changed files with 8 additions and 3 deletions

View File

@ -1,9 +1,9 @@
! Copyright (C) 2012 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: arrays assocs combinators combinators.short-circuit
environment io.backend io.files io.files.info io.pathnames
kernel sequences sets splitting system unicode.case ;
USING: arrays assocs combinators.short-circuit command-line
environment io io.backend io.files io.files.info io.pathnames
kernel namespaces sequences sets splitting system unicode.case ;
IN: tools.which
@ -40,3 +40,8 @@ PRIVATE>
: which ( command -- file/f )
"PATH" os-env (which) ;
: run-which ( -- )
command-line get [ which [ print ] when* ] each ;
MAIN: run-which