TerminalShell: remove --terminal-version and --shell-version

This commit is contained in:
李通洲 2023-06-12 14:52:46 +08:00 committed by 李通洲
parent 6a71e0fa75
commit 40a1f75895
9 changed files with 9 additions and 61 deletions

View File

@ -4,6 +4,7 @@ This release introduces a new configuration file format: JSON config
Changes:
* Drop the dependency of cJSON. We now use [yyjson](https://ibireme.github.io/yyjson/doc/doxygen/html/index.html) to parse JSON documents.
* Remove `--shell-version` and `--terminal-version`. They are always enabled
Features:
* Support KDE / LXQT / MATE / Cinnamon wallpaper detection (Wallpaper, Linux)

View File

@ -193,8 +193,6 @@ __fastfetch_completion()
"--pipe"
"--title-fqdn"
"--escape-bedrock"
"--shell-version"
"--terminal-version"
"--disk-folders"
"--disk-show-removable"
"--disk-show-hidden"

View File

@ -226,18 +226,6 @@
# Default is false.
#--gpu-force-vulkan
# Shell option
# Sets if shell version should be detected and printed
# Must be either true or false
# Default is true.
#--shell-version true
# Terminal option
# Sets if terminal version should be detected and printed
# Must be either true or false
# Default is true.
#--terminal-version true
# Disk show options
# Sets if certain types of disk should be printed
# Must be either true or false

View File

@ -104,8 +104,6 @@ Module specific options:
--title-fqdn <?value>: Set if the title should use fully qualified domain name. Default is false
--separator-string <str>: Set the string printed by the separator module
--os-file <path>: Set the path to the file containing OS information
--shell-version <?value>: Set if shell version should be detected and printed
--terminal-version <?value>: Set if terminal version should be detected and printed
--disk-folders <folders>: A colon (semicolon on Windows) separated list of folder paths for the disk output. Default is "/:/home" ("C:\\;D:\\ ..." on Windows)
--disk-show-regular <?value>: Set if regular volume should be printed. Default is true
--disk-show-removable <?value>: Set if removable volume should be printed. Default is true

View File

@ -353,15 +353,12 @@ const FFTerminalShellResult* ffDetectTerminalShell(const FFinstance* instance)
getUserShellFromEnv(instance, &result);
ffStrbufClear(&result.shellVersion);
if(instance->config.shell.version)
{
getShellVersion(&result.shellExe, result.shellExeName, &result.shellVersion);
getShellVersion(&result.shellExe, result.shellExeName, &result.shellVersion);
if(strcasecmp(result.shellExeName, result.userShellExeName) != 0)
getShellVersion(&result.userShellExe, result.userShellExeName, &result.userShellVersion);
else
ffStrbufSet(&result.userShellVersion, &result.shellVersion);
}
if(strcasecmp(result.shellExeName, result.userShellExeName) != 0)
getShellVersion(&result.userShellExe, result.userShellExeName, &result.userShellVersion);
else
ffStrbufSet(&result.userShellVersion, &result.shellVersion);
if(ffStrbufEqualS(&result.shellProcessName, "pwsh"))
ffStrbufInitS(&result.shellPrettyName, "PowerShell");
@ -389,9 +386,7 @@ const FFTerminalShellResult* ffDetectTerminalShell(const FFinstance* instance)
ffStrbufInitCopy(&result.terminalPrettyName, &result.terminalProcessName);
ffStrbufInit(&result.terminalVersion);
if(instance->config.terminal.version)
fftsGetTerminalVersion(&result.terminalProcessName, &result.terminalExe, &result.terminalVersion);
fftsGetTerminalVersion(&result.terminalProcessName, &result.terminalExe, &result.terminalVersion);
ffThreadMutexUnlock(&mutex);
return &result;

View File

@ -152,8 +152,7 @@ static uint32_t getShellInfo(const FFinstance* instance, FFTerminalShellResult*
}
ffStrbufClear(&result->shellVersion);
if(instance->config.shell.version)
fftsGetShellVersion(&result->shellExe, result->shellPrettyName.chars, &result->shellVersion);
fftsGetShellVersion(&result->shellExe, result->shellPrettyName.chars, &result->shellVersion);
result->shellPid = pid;
if(ffStrbufIgnCaseEqualS(&result->shellPrettyName, "pwsh"))
@ -351,8 +350,7 @@ const FFTerminalShellResult* ffDetectTerminalShell(const FFinstance* instance)
getTerminalFromEnv(&result);
ffStrbufInit(&result.terminalVersion);
if(instance->config.terminal.version)
fftsGetTerminalVersion(&result.terminalProcessName, &result.terminalExe, &result.terminalVersion);
fftsGetTerminalVersion(&result.terminalProcessName, &result.terminalExe, &result.terminalVersion);
exit:
ffThreadMutexUnlock(&mutex);

View File

@ -46,8 +46,6 @@ void ffInitShellOptions(FFShellOptions* options)
{
options->moduleName = FF_SHELL_MODULE_NAME;
ffOptionInitModuleArg(&options->moduleArgs);
options->version = true;
}
bool ffParseShellCommandOptions(FFShellOptions* options, const char* key, const char* value)
@ -57,12 +55,6 @@ bool ffParseShellCommandOptions(FFShellOptions* options, const char* key, const
if (ffOptionParseModuleArgs(key, subKey, value, &options->moduleArgs))
return true;
if (strcasecmp(subKey, "version") == 0)
{
options->version = ffOptionParseBoolean(value);
return true;
}
return false;
}
@ -89,12 +81,6 @@ void ffParseShellJsonObject(FFinstance* instance, yyjson_val* module)
if (ffJsonConfigParseModuleArgs(key, val, &options.moduleArgs))
continue;
if (strcasecmp(key, "version") == 0)
{
options.version = yyjson_get_bool(val);
continue;
}
ffPrintError(instance, FF_SHELL_MODULE_NAME, 0, &options.moduleArgs, "Unknown JSON key %s", key);
}
}

View File

@ -8,6 +8,4 @@ typedef struct FFTerminalOptions
{
const char* moduleName;
FFModuleArgs moduleArgs;
bool version;
} FFTerminalOptions;

View File

@ -47,8 +47,6 @@ void ffInitTerminalOptions(FFTerminalOptions* options)
{
options->moduleName = FF_TERMINAL_MODULE_NAME;
ffOptionInitModuleArg(&options->moduleArgs);
options->version = true;
}
bool ffParseTerminalCommandOptions(FFTerminalOptions* options, const char* key, const char* value)
@ -58,12 +56,6 @@ bool ffParseTerminalCommandOptions(FFTerminalOptions* options, const char* key,
if (ffOptionParseModuleArgs(key, subKey, value, &options->moduleArgs))
return true;
if (strcasecmp(subKey, "version") == 0)
{
options->version = ffOptionParseBoolean(value);
return true;
}
return false;
}
@ -90,12 +82,6 @@ void ffParseTerminalJsonObject(FFinstance* instance, yyjson_val* module)
if (ffJsonConfigParseModuleArgs(key, val, &options.moduleArgs))
continue;
if (strcasecmp(key, "version") == 0)
{
options.version = yyjson_get_bool(val);
continue;
}
ffPrintError(instance, FF_TERMINAL_MODULE_NAME, 0, &options.moduleArgs, "Unknown JSON key %s", key);
}
}