|
5 | 5 | #include "common/io/io.h" |
6 | 6 | #include "common/time.h" |
7 | 7 | #include "common/jsonconfig.h" |
| 8 | +#include "detection/version/version.h" |
8 | 9 | #include "util/stringUtils.h" |
9 | 10 | #include "logo/logo.h" |
10 | 11 | #include "fastfetch_datatext.h" |
@@ -795,37 +796,10 @@ static inline void optionCheckString(const char* key, const char* value, FFstrbu |
795 | 796 | } |
796 | 797 |
|
797 | 798 | static void printVersion() |
798 | | - { |
799 | | - #ifndef NDEBUG |
800 | | - #define FF_BUILD_TYPE "-debug" |
801 | | - #else |
802 | | - #define FF_BUILD_TYPE |
803 | | - #endif |
804 | | - |
805 | | - #if defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) || defined(__amd64) |
806 | | - #define FF_ARCHITECTURE "x86_64" |
807 | | - #elif defined(__i386__) || defined(__i386) || defined(__i486__) || defined(__i486) || defined(__i586__) || defined(__i586) || defined(__i686__) || defined(__i686) |
808 | | - #define FF_ARCHITECTURE "i386" |
809 | | - #elif defined(__aarch64__) |
810 | | - #define FF_ARCHITECTURE "aarch64" |
811 | | - #elif defined(__arm__) |
812 | | - #define FF_ARCHITECTURE "arm" |
813 | | - #elif defined(__mips__) |
814 | | - #define FF_ARCHITECTURE "mips" |
815 | | - #elif defined(__powerpc__) || defined(__powerpc) |
816 | | - #define FF_ARCHITECTURE "powerpc" |
817 | | - #elif defined(__riscv__) || defined(__riscv) |
818 | | - #define FF_ARCHITECTURE "riscv" |
819 | | - #elif defined(__s390x__) |
820 | | - #define FF_ARCHITECTURE "s390x" |
821 | | - #else |
822 | | - #define FF_ARCHITECTURE "unknown" |
823 | | - #endif |
824 | | - |
825 | | - puts("fastfetch " FASTFETCH_PROJECT_VERSION FASTFETCH_PROJECT_VERSION_TWEAK FF_BUILD_TYPE " (" FF_ARCHITECTURE ")"); |
826 | | - |
827 | | - #undef FF_ARCHITECTURE |
828 | | - #undef FF_BUILD_TYPE |
| 799 | +{ |
| 800 | + FFVersionResult result = {}; |
| 801 | + ffDetectVersion(&result); |
| 802 | + printf("%s %s%s%s (%s)\n", result.projectName, result.version, result.versionTweak, result.debugMode ? "-debug" : "", result.architecture); |
829 | 803 | } |
830 | 804 |
|
831 | 805 | static void parseOption(FFdata* data, const char* key, const char* value) |
|
0 commit comments