uwu_name(): Used macros set the name depending on the distribution
I think this is a more readable way of doing the same thing, and will make it easier to add other distributions later down the line.
This commit is contained in:
parent
c53e374e15
commit
575d729cdc
1 changed files with 17 additions and 15 deletions
32
uwufetch.c
32
uwufetch.c
|
@ -346,21 +346,23 @@ void usage(char* arg) {
|
||||||
|
|
||||||
void uwu_name() { // changes distro name to uwufied(?) name
|
void uwu_name() { // changes distro name to uwufied(?) name
|
||||||
|
|
||||||
|
#define VERSION_TO_UWU(original, uwufied) if (strcmp(version_name, original) == 0) sprintf(version_name, "%s", uwufied)
|
||||||
|
VERSION_TO_UWU("arch", "Nyarch Linuwu");
|
||||||
// linux
|
// linux
|
||||||
if (strcmp(version_name, "arch") == 0) sprintf(version_name, "%s", "Nyarch Linuwu");
|
VERSION_TO_UWU("artix", "Nyartix Linuwu");
|
||||||
else if (strcmp(version_name, "artix") == 0) sprintf(version_name, "%s", "Nyartix Linuwu");
|
VERSION_TO_UWU("debian", "Debinyan");
|
||||||
else if (strcmp(version_name, "debian") == 0) sprintf(version_name, "%s", "Debinyan");
|
VERSION_TO_UWU("fedora", "Fedowa");
|
||||||
else if (strcmp(version_name, "fedora") == 0) sprintf(version_name, "%s", "Fedowa");
|
VERSION_TO_UWU("gentoo", "GentOwO");
|
||||||
else if (strcmp(version_name, "gentoo") == 0) sprintf(version_name, "%s", "GentOwO");
|
VERSION_TO_UWU("linuxmint", "LinUWU Miwint");
|
||||||
else if (strcmp(version_name, "linuxmint") == 0) sprintf(version_name, "%s", "LinUWU Miwint");
|
VERSION_TO_UWU("manjaro", "Myanjawo");
|
||||||
else if (strcmp(version_name, "manjaro") == 0) sprintf(version_name, "%s", "Myanjawo");
|
VERSION_TO_UWU("manjaro-arm", "Myanjawo AWM");
|
||||||
else if (strcmp(version_name, "\"manjaro-arm\"") == 0) sprintf(version_name, "%s", "Myanjawo AWM");
|
VERSION_TO_UWU("popos", "PopOwOS");
|
||||||
else if (strcmp(version_name, "popos") == 0) sprintf(version_name, "%s", "PopOwOS");
|
VERSION_TO_UWU("ubuntu", "Uwuntu");
|
||||||
else if (strcmp(version_name, "ubuntu") == 0) sprintf(version_name, "%s", "Uwuntu");
|
VERSION_TO_UWU("void", "OwOid");
|
||||||
else if (strcmp(version_name, "void") == 0) sprintf(version_name, "%s", "OwOid");
|
VERSION_TO_UWU("android", "Nyandroid"); // android at the end because it could be not considered as an actual distribution of gnu/linux
|
||||||
else if (strcmp(version_name, "android") == 0) sprintf(version_name, "%s", "Nyandroid"); // android at the end because it could be not considered as an actual distribution of gnu/linux
|
|
||||||
|
|
||||||
// BSD
|
// BSD
|
||||||
else if (strcmp(version_name, "freebsd") == 0) sprintf(version_name, "%s", "FweeBSD");
|
VERSION_TO_UWU("freebsd", "FweeBSD");
|
||||||
else if (strcmp(version_name, "openbsd") == 0) sprintf(version_name, "%s", "OwOpenBSD");
|
VERSION_TO_UWU("openbsd", "OwOpenBSD");
|
||||||
}
|
#undef VERSION_TO_UWU
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue