TerminalShell (macOS): detect full exe path

This commit is contained in:
李通洲
2024-01-19 10:50:02 +08:00
parent 06af39835a
commit 7d78d92a92
4 changed files with 25 additions and 13 deletions
+6 -3
View File
@@ -38,6 +38,7 @@ void ffPrintShell(FFShellOptions* options)
{FF_FORMAT_ARG_TYPE_STRBUF, &result->version},
{FF_FORMAT_ARG_TYPE_UINT, &result->pid},
{FF_FORMAT_ARG_TYPE_STRBUF, &result->prettyName},
{FF_FORMAT_ARG_TYPE_STRBUF, &result->exePath},
});
}
}
@@ -90,6 +91,7 @@ void ffGenerateShellJsonResult(FF_MAYBE_UNUSED FFShellOptions* options, yyjson_m
yyjson_mut_val* obj = yyjson_mut_obj_add_obj(doc, module, "result");
yyjson_mut_obj_add_strbuf(doc, obj, "exe", &result->exe);
yyjson_mut_obj_add_strcpy(doc, obj, "exeName", result->exeName);
yyjson_mut_obj_add_strbuf(doc, obj, "exePath", &result->exePath);
yyjson_mut_obj_add_uint(doc, obj, "pid", result->pid);
yyjson_mut_obj_add_uint(doc, obj, "ppid", result->ppid);
yyjson_mut_obj_add_strbuf(doc, obj, "processName", &result->processName);
@@ -101,11 +103,12 @@ void ffPrintShellHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_SHELL_MODULE_NAME, "{3} {4}", FF_SHELL_NUM_FORMAT_ARGS, (const char* []) {
"Shell process name",
"Shell path with exe name",
"Shell exe name",
"The first argument of the command line when running the shell",
"Shell base name of arg0",
"Shell version",
"Shell pid",
"Shell pretty name"
"Shell pretty name",
"Shell full exe path",
});
}