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