Skip to content

Commit 16ea9fe

Browse files
omusgiordano
andauthored
Add docstrings for ExecutableProduct wrappers (#30)
* Add docstrings for ExecutableProduct wrappers * Update src/products/executable_generators.jl Co-authored-by: Mosè Giordano <[email protected]> Co-authored-by: Mosè Giordano <[email protected]>
1 parent 1631db3 commit 16ea9fe

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/products/executable_generators.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@ function declare_old_executable_product(product_name)
22
path_name = Symbol(string(product_name, "_path"))
33
return quote
44
# This is the old-style `withenv()`-based function
5+
"""
6+
$($product_name)(f::Function; adjust_PATH::Bool=true, adjust_LIBPATH::Bool=true)
7+
8+
An `ExecutableProduct` wrapper that supports the execution of $($product_name).
9+
10+
# Example
11+
```julia
12+
$($product_name)() do exe
13+
run(`\$exe \$arguments`)
14+
end
15+
```
16+
17+
!!! compat "Julia 1.3"
18+
"""
519
function $(product_name)(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
620
# We sub off to a shared function to avoid compiling the same thing over and over again
721
return Base.invokelatest(
@@ -30,6 +44,19 @@ function declare_new_executable_product(product_name)
3044
path_name = Symbol(string(product_name, "_path"))
3145
return quote
3246
# This is the new-style `addenv()`-based function
47+
@doc """
48+
$($product_name)(; adjust_PATH::Bool=true, adjust_LIBPATH::Bool=true) -> Cmd
49+
50+
An `ExecutableProduct` wrapper that supports the execution of $($product_name).
51+
This wrapper is thread-safe and should be preferred on Julia 1.6+.
52+
53+
# Example
54+
```julia
55+
run(`\$($($product_name)()) \$arguments`)
56+
```
57+
58+
!!! compat "Julia 1.6"
59+
"""
3360
function $(product_name)(; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
3461
env = Base.invokelatest(
3562
JLLWrappers.adjust_ENV!,

0 commit comments

Comments
 (0)