Build the command line used to spawn the supervised child.
The child receives --watch-child and inherits most argv tokens, with
supervisor-only flags removed to avoid recursion.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | exe0 |
function build_child_command(exe0) result(cmd) character(len=*), intent(in) :: exe0 character(len=:), allocatable :: cmd character(len=:), allocatable :: exe, a integer :: narg, i logical :: skip_next exe = choose_self_exe(exe0) cmd = quote_arg(exe) // " --watch-child" narg = command_argument_count() skip_next = .false. do i = 1, narg a = get_arg(i) if (skip_next) then skip_next = .false. cycle end if if (a == "--watch-auto-restart") cycle if (a == "--watch-child") cycle if (a == "--watch-restart-delay") then skip_next = .true. cycle end if if (a == "--watch-restart-max") then skip_next = .true. cycle end if if (a == "--watch-self") then skip_next = .true. cycle end if if (starts_with(a, "--watch-restart-delay=")) cycle if (starts_with(a, "--watch-restart-max=")) cycle if (starts_with(a, "--watch-self=")) cycle cmd = cmd // " " // quote_arg(a) end do end function build_child_command