11"""
2- execute_diagham_script(execute; kwargs...)
3-
4- Run a DiagHam executable. Kwargs are converted to CLI flags (`_` → `-`).
5- Single-char keys use `-k`, multi-char use `--key`. Boolean `true` adds flag, `false` omits.
6-
7- The kwargs of `Cmd()` are supported.
2+ diagham_command(execute; kwargs...)
3+ Construct a command string for running a DiagHam executable with specified kwargs as CLI flags.
84"""
9- function execute_diagham_script (execute:: AbstractString ; kwargs... )
10- return execute_diagham_script ([execute]; kwargs... )
5+ function diagham_command (execute:: AbstractString ; kwargs... )
6+ return diagham_command ([execute]; kwargs... )
117end
12-
13- function execute_diagham_script (
8+ function diagham_command (
149 execute:: AbstractVector{<:AbstractString} ;
1510 diagham_path:: AbstractString = get_diagham_path (),
16- ignorestatus:: Bool = false ,
17- detach:: Bool = false ,
18- windows_verbatim:: Bool = false ,
19- windows_hide:: Bool = false ,
20- env = nothing ,
21- dir = " " ,
2211 kwargs...
2312 )
2413 warn_about_diagham_path ()
25-
2614 ex_file = first (execute)
2715 execute[1 ] = joinpath (diagham_path, ex_file)
2816 execute = prod (execute)
@@ -31,10 +19,7 @@ function execute_diagham_script(
3119 for (k, v) in kwargs
3220 execute *= diagham_kwarg (k, v)
3321 end
34-
35- execute = Cmd (split (execute, " " ))
36- cmd = Cmd (execute; ignorestatus = ignorestatus, detach = detach, windows_verbatim = windows_verbatim, windows_hide = windows_hide, env = env, dir = dir)
37- return run (cmd)
22+ return execute
3823end
3924
4025function diagham_kwarg (key, value)
@@ -49,3 +34,33 @@ function diagham_kwarg(key, value)
4934 end
5035 return " "
5136end
37+
38+ """
39+ execute_diagham_script(execute; kwargs...)
40+
41+ Run a DiagHam executable. Kwargs are converted to CLI flags (`_` → `-`).
42+ Single-char keys use `-k`, multi-char use `--key`. Boolean `true` adds flag, `false` omits.
43+
44+ The kwargs of `Cmd()` and `run()` are supported.
45+ """
46+ function execute_diagham_script (execute:: AbstractString ; kwargs... )
47+ return execute_diagham_script ([execute]; kwargs... )
48+ end
49+ function execute_diagham_script (
50+ execute:: AbstractVector{<:AbstractString} ;
51+ diagham_path:: AbstractString = get_diagham_path (),
52+ ignorestatus:: Bool = false ,
53+ detach:: Bool = false ,
54+ windows_verbatim:: Bool = false ,
55+ windows_hide:: Bool = false ,
56+ env = nothing ,
57+ dir = " " ,
58+ wait:: Bool = true ,
59+ cleanup:: Bool = false ,
60+ kwargs...
61+ )
62+ execute = diagham_command (execute; diagham_path, kwargs... )
63+ execute = Cmd (split (execute, " " ))
64+ cmd = Cmd (execute; ignorestatus = ignorestatus, detach = detach, windows_verbatim = windows_verbatim, windows_hide = windows_hide, env = env, dir = dir)
65+ return run (cmd; wait = wait)
66+ end
0 commit comments