Functions | |
| std::string | commandFailure (int status) |
| Describe how a command run through system() ended. | |
| void | runOrThrow (const std::string &command) |
| Run a shell command, throwing when it does not succeed. | |
| std::string | shellQuote (const std::string &text) |
| Wrap a path for the shell system() hands the command to, so spaces in it survive. | |
| std::string | shebangInterpreter (const std::filesystem::path &path) |
| Return the interpreter name from a #! line, or empty. | |
| bool | isPythonInterpreterName (std::string name) |
True when name is python, python3, python3.12, python.exe, ... | |
| std::string | wrapResolvedProgram (const std::string &command, const std::string &python) |
| Quote a resolved program path, and on Windows prefix a script so cmd.exe can start it. | |
|
inlinenodiscard |
Describe how a command run through system() ended.
| status | The value system() returned. |
Definition at line 29 of file ExternalCommand.h.
|
inline |
True when name is python, python3, python3.12, python.exe, ...
Definition at line 96 of file ExtPotCommand.h.
|
inline |
Run a shell command, throwing when it does not succeed.
External potentials feed whatever the command leaves behind straight into the optimizer, so a failed command has to stop the run rather than let the caller parse a stale or partial result file.
Definition at line 56 of file ExternalCommand.h.
|
inline |
Return the interpreter name from a #! line, or empty.
#!/usr/bin/env python3 and #!/usr/bin/python3 both yield python3. env flags (-S) are skipped. A file with no shebang yields empty.
Definition at line 48 of file ExtPotCommand.h.
|
inline |
Wrap a path for the shell system() hands the command to, so spaces in it survive.
Definition at line 25 of file ExtPotCommand.h.
|
inline |
Quote a resolved program path, and on Windows prefix a script so cmd.exe can start it.
cmd.exe will not execute an extensionless file, quoted or not. A Python shebang or a .py suffix becomes python "path". A native .exe / .bat / .cmd is quoted only. A command line that is not a single existing file is returned unchanged.
Definition at line 115 of file ExtPotCommand.h.