diff --git a/src/main.c b/src/main.c index 01ba228..f925093 100644 --- a/src/main.c +++ b/src/main.c @@ -66,6 +66,7 @@ static int usage() { printf("Use --unbind to rollback a deployment\n"); printf("Use --fomod to create a new mod using the result from the FOMod\n"); printf("Use --swap MODID B> to swap two mod in the loading order\n"); + printf("Use --version or -v to get the version number\n"); return EXIT_FAILURE; } @@ -635,6 +636,16 @@ int main(int argc, char ** argv) { else returnValue = swapMod(argc, argv); + } else if(strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-v") == 0) { + returnValue = EXIT_SUCCESS; + #ifdef __clang__ + printf("%s: Clang: %d.%d.%d\n", VERSION, __clang_major__, __clang_minor__, __clang_patchlevel__); + #elifdef __GNUC__ + printf("%s: GCC: %d.%d.%d\n", VERSION, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); + #else + printf("%s: unknown compiler\n", VERSION); + #endif + } else { usage(); returnValue = EXIT_FAILURE; diff --git a/src/main.h b/src/main.h index e63cd96..147d0ab 100644 --- a/src/main.h +++ b/src/main.h @@ -11,3 +11,5 @@ #define GAME_UPPER_DIR_NAME "UPPER_DIRS" //overlayfs temporary dir. #define GAME_WORK_DIR_NAME "WORK_DIRS" + +#define VERSION "0.1"