Skip to content

Commit 884c902

Browse files
committed
Doc: migrate some help texts to Github Wiki pages
1 parent 16c5625 commit 884c902

File tree

8 files changed

+88
-177
lines changed

8 files changed

+88
-177
lines changed

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,6 @@ endif()
325325

326326
fastfetch_encode_c_string("${DATATEXT_JSON_HELP}" DATATEXT_JSON_HELP)
327327
fastfetch_load_text(src/data/structure.txt DATATEXT_STRUCTURE)
328-
fastfetch_load_text(src/data/help_footer.txt DATATEXT_HELP_FOOTER)
329-
fastfetch_load_text(src/data/help_color.txt DATATEXT_HELP_COLOR)
330-
fastfetch_load_text(src/data/help_format.txt DATATEXT_HELP_FORMAT)
331328

332329
configure_file(src/fastfetch_config.h.in fastfetch_config.h @ONLY)
333330
configure_file(src/fastfetch_datatext.h.in fastfetch_datatext.h @ONLY)

doc/json_schema.json

Lines changed: 70 additions & 70 deletions
Large diffs are not rendered by default.

src/data/help.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,17 @@
457457
"optional": true
458458
}
459459
},
460+
{
461+
"long": "color",
462+
"desc": "Set the color of both keys and title",
463+
"remark": [
464+
"Shortcut for \"--color-keys <color>\" and \"--color-title <color>\"",
465+
"For color syntax, see <https://github.com/fastfetch-cli/fastfetch/wiki/Color-Format-Specification>"
466+
],
467+
"arg": {
468+
"type": "color"
469+
}
470+
},
460471
{
461472
"long": "color-keys",
462473
"desc": "Set the color of the keys",
@@ -489,14 +500,6 @@
489500
"type": "color"
490501
}
491502
},
492-
{
493-
"long": "color",
494-
"desc": "Set the color of both keys and title",
495-
"remark": "Shortcut for \"--color-keys <color>\" and \"--color-title <color>\"",
496-
"arg": {
497-
"type": "color"
498-
}
499-
},
500503
{
501504
"long": "key-width",
502505
"desc": "Align the width of keys to <num> characters",
@@ -1523,7 +1526,7 @@
15231526
"long": "<module>-format",
15241527
"desc": [
15251528
"Set the format string to use for a specific module",
1526-
"To see how a format string works, use \"fastfetch -h format\".",
1529+
"See <https://github.com/fastfetch-cli/fastfetch/wiki/Format-String-Guide>",
15271530
"For help about a specific format string, use \"fastfetch -h <module>-format\""
15281531
],
15291532
"arg": {

src/data/help_color.txt

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/data/help_footer.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/data/help_format.txt

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/fastfetch.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static void printCommandFormatHelpJson(void)
3636
yyjson_mut_val* obj = yyjson_mut_obj(doc);
3737
if (yyjson_mut_obj_add(root, yyjson_mut_strbuf(doc, &type), obj))
3838
{
39-
FF_STRBUF_AUTO_DESTROY content = ffStrbufCreateF("Output format of the module `%s`. See `-h format` for formatting syntax\n", baseInfo->name);
39+
FF_STRBUF_AUTO_DESTROY content = ffStrbufCreateF("Output format of the module `%s`. See Wiki for formatting syntax\n", baseInfo->name);
4040
for (unsigned i = 0; i < baseInfo->formatArgs.count; i++)
4141
{
4242
const FFModuleFormatArg* arg = &baseInfo->formatArgs.args[i];
@@ -180,7 +180,11 @@ static void printFullHelp()
180180
}
181181
yyjson_doc_free(doc);
182182

183-
puts("\n" FASTFETCH_DATATEXT_HELP_FOOTER);
183+
puts("\n\
184+
Parsing is not case sensitive. E.g. `--print-logos` is equal to `--Print-Logos`\n\
185+
If a value starts with a ?, it is optional. An optional boolean value defaults to true if not specified.\n\
186+
More detailed help messages for each options can be printed with `-h <option_without_dash_prefix>`\n\
187+
All options can be made permanent with command `fastfetch <options> --gen-config`");
184188
}
185189

186190
static bool printSpecificCommandHelp(const char* command)
@@ -298,10 +302,6 @@ static void printCommandHelp(const char* command)
298302
{
299303
if(command == NULL)
300304
printFullHelp();
301-
else if(ffStrEqualsIgnCase(command, "color"))
302-
puts(FASTFETCH_DATATEXT_HELP_COLOR);
303-
else if(ffStrEqualsIgnCase(command, "format"))
304-
puts(FASTFETCH_DATATEXT_HELP_FORMAT);
305305
else if(ffStrEqualsIgnCase(command, "format-json"))
306306
printCommandFormatHelpJson();
307307
else if(ffCharIsEnglishAlphabet(command[0]) && ffStrEndsWithIgnCase(command, "-format")) // <module>-format

src/fastfetch_datatext.h.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@
22

33
#define FASTFETCH_DATATEXT_JSON_HELP @DATATEXT_JSON_HELP@
44
#define FASTFETCH_DATATEXT_STRUCTURE @DATATEXT_STRUCTURE@
5-
#define FASTFETCH_DATATEXT_HELP_FOOTER @DATATEXT_HELP_FOOTER@
6-
#define FASTFETCH_DATATEXT_HELP_COLOR @DATATEXT_HELP_COLOR@
7-
#define FASTFETCH_DATATEXT_HELP_FORMAT @DATATEXT_HELP_FORMAT@
8-
#define FASTFETCH_DATATEXT_HELP_CONFIG @DATATEXT_HELP_CONFIG@

0 commit comments

Comments
 (0)