From c8e3c6882ae25a6f0789f0efc30930bea29011fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 13 May 2024 16:41:00 +0800 Subject: [PATCH] Kernel: print kernel name in default format --- CHANGELOG.md | 1 + src/modules/kernel/kernel.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e68b4b2d..b19f38ec7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Changes: * The long deprecated options `--set` and `--set-keyless` are removed. +* `Kernel` module now prints kernel name by default Features: * Support `st` terminal font detection for font configuration compiled in `st` binary (TerminalFont, Linux) diff --git a/src/modules/kernel/kernel.c b/src/modules/kernel/kernel.c index 2839af7a0..43cdf766f 100644 --- a/src/modules/kernel/kernel.c +++ b/src/modules/kernel/kernel.c @@ -11,7 +11,7 @@ void ffPrintKernel(FFKernelOptions* options) if(options->moduleArgs.outputFormat.length == 0) { ffPrintLogoAndKey(FF_KERNEL_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT); - ffStrbufWriteTo(&platform->systemRelease, stdout); + printf("%s %s", platform->systemName.chars, platform->systemRelease.chars); if(platform->systemDisplayVersion.length > 0) printf(" (%s)\n", platform->systemDisplayVersion.chars); @@ -77,7 +77,7 @@ void ffGenerateKernelJsonResult(FF_MAYBE_UNUSED FFKernelOptions* options, yyjson void ffPrintKernelHelpFormat(void) { - FF_PRINT_MODULE_FORMAT_HELP_CHECKED(FF_KERNEL_MODULE_NAME, "{2}", FF_KERNEL_NUM_FORMAT_ARGS, ((const char* []) { + FF_PRINT_MODULE_FORMAT_HELP_CHECKED(FF_KERNEL_MODULE_NAME, "{1} {2}", FF_KERNEL_NUM_FORMAT_ARGS, ((const char* []) { "Sysname", "Release", "Version",