2022-11-21 05:52:11 +08:00
|
|
|
# Construct a callable value for the external program `$program`. Example:
|
|
|
|
#
|
|
|
|
# ```elvish-transcript
|
|
|
|
# ~> var x = (external man)
|
|
|
|
# ~> $x ls # opens the manpage for ls
|
|
|
|
# ```
|
|
|
|
#
|
|
|
|
# @cf has-external search-external
|
2022-11-22 22:13:25 +08:00
|
|
|
fn external {|program| }
|
2022-11-21 05:52:11 +08:00
|
|
|
|
|
|
|
# Test whether `$command` names a valid external command. Examples (your output
|
|
|
|
# might differ):
|
|
|
|
#
|
|
|
|
# ```elvish-transcript
|
|
|
|
# ~> has-external cat
|
|
|
|
# ▶ $true
|
|
|
|
# ~> has-external lalala
|
|
|
|
# ▶ $false
|
|
|
|
# ```
|
|
|
|
#
|
|
|
|
# @cf external search-external
|
2022-11-22 22:13:25 +08:00
|
|
|
fn has-external {|command| }
|
2022-11-21 05:52:11 +08:00
|
|
|
|
|
|
|
# Output the full path of the external `$command`. Throws an exception when not
|
|
|
|
# found. Example (your output might vary):
|
|
|
|
#
|
|
|
|
# ```elvish-transcript
|
|
|
|
# ~> search-external cat
|
|
|
|
# ▶ /bin/cat
|
|
|
|
# ```
|
|
|
|
#
|
|
|
|
# @cf external has-external
|
2022-11-22 22:13:25 +08:00
|
|
|
fn search-external {|command| }
|
2022-11-21 05:52:11 +08:00
|
|
|
|
|
|
|
# Exit the Elvish process with `$status` (defaulting to 0).
|
2022-11-22 22:13:25 +08:00
|
|
|
fn exit {|status?| }
|