aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.posix/execlp.ccm
blob: ba805042863cbdab6bc7d82d9e888d95b4b48f75 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// This source code is released into the public domain.
export module nihil.posix:execlp;

import nihil.std;
import nihil.util;
import :argv;
import :execvp;

namespace nihil {

// execlp: equivalent to execvp, except the arguments are passed as a
// variadic pack of string-like objects.

export [[nodiscard]] auto
execlp(std::filesystem::path const &file, auto &&...args) -> std::expected<execv, error>
{
	return execvp(file, argv({std::string_view(args)...}));
}

} // namespace nihil