src.elv.sh@v0.21.0-dev.0.20240515223629-06979efb9a2a/pkg/eval/builtin_fn_cmd.d.elv (about)

     1  #//skip-test
     2  
     3  # Construct a callable value for the external program `$program`. Example:
     4  #
     5  # ```elvish-transcript
     6  # ~> var x = (external man)
     7  # ~> $x ls # opens the manpage for ls
     8  # ```
     9  #
    10  # See also [`has-external`]() and [`search-external`]().
    11  fn external {|program| }
    12  
    13  # Test whether `$command` names a valid external command. Examples (your output
    14  # might differ):
    15  #
    16  # ```elvish-transcript
    17  # ~> has-external cat
    18  # ▶ $true
    19  # ~> has-external lalala
    20  # ▶ $false
    21  # ```
    22  #
    23  # See also [`external`]() and [`search-external`]().
    24  fn has-external {|command| }
    25  
    26  # Output the full path of the external `$command`. Throws an exception when not
    27  # found. Example (your output might vary):
    28  #
    29  # ```elvish-transcript
    30  # ~> search-external cat
    31  # ▶ /bin/cat
    32  # ```
    33  #
    34  # See also [`external`]() and [`has-external`]().
    35  fn search-external {|command| }
    36  
    37  # Replace the Elvish process with an external `$command`, defaulting to
    38  # `elvish`, passing the given arguments. This decrements `$E:SHLVL` before
    39  # starting the new process.
    40  #
    41  # This command always raises an exception on Windows with the message "not
    42  # supported on Windows".
    43  fn exec {|command? @args| }
    44  
    45  # Exit the Elvish process with `$status` (defaulting to 0).
    46  fn exit {|status?| }