builtin_fn_cmd.d.elv 991 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #elvdoc:fn external
  2. #
  3. # ```elvish
  4. # external $program
  5. # ```
  6. #
  7. # Construct a callable value for the external program `$program`. Example:
  8. #
  9. # ```elvish-transcript
  10. # ~> var x = (external man)
  11. # ~> $x ls # opens the manpage for ls
  12. # ```
  13. #
  14. # @cf has-external search-external
  15. #elvdoc:fn has-external
  16. #
  17. # ```elvish
  18. # has-external $command
  19. # ```
  20. #
  21. # Test whether `$command` names a valid external command. Examples (your output
  22. # might differ):
  23. #
  24. # ```elvish-transcript
  25. # ~> has-external cat
  26. # ▶ $true
  27. # ~> has-external lalala
  28. # ▶ $false
  29. # ```
  30. #
  31. # @cf external search-external
  32. #elvdoc:fn search-external
  33. #
  34. # ```elvish
  35. # search-external $command
  36. # ```
  37. #
  38. # Output the full path of the external `$command`. Throws an exception when not
  39. # found. Example (your output might vary):
  40. #
  41. # ```elvish-transcript
  42. # ~> search-external cat
  43. # ▶ /bin/cat
  44. # ```
  45. #
  46. # @cf external has-external
  47. #elvdoc:fn exit
  48. #
  49. # ```elvish
  50. # exit $status?
  51. # ```
  52. #
  53. # Exit the Elvish process with `$status` (defaulting to 0).