Name as well as version for --version

This commit is contained in:
Keith Bowes 2020-03-08 12:47:58 -04:00
parent 555b78e9ec
commit 97d08498e9
2 changed files with 3 additions and 2 deletions

View file

@ -14,7 +14,8 @@ project(
add_project_arguments(
'-Wno-unused-parameter',
'-DWLR_USE_UNSTABLE',
'-DVERSION="' + meson.project_version() + '"',
'-DPACKAGE_NAME="' + meson.project_name() + '"',
'-DPACKAGE_VERSION="' + meson.project_version() + '"',
language: 'c')
cc = meson.get_compiler('c')

View file

@ -15,7 +15,7 @@ int main(int argc, char **argv) {
} else if ((!strcmp("--startup", argv[i]) || !strcmp("-s", argv[i])) && i < argc) {
startup_cmd = argv[i + 1];
} else if (!strcmp("--version", argv[i]) || !strcmp("-V", argv[i])) {
printf(VERSION "\n");
printf(PACKAGE_NAME " " PACKAGE_VERSION "\n");
return 0;
} else if (argv[i][0] == '-') {
printf("Usage: %s [--debug] [--exit] [--help] [--startup CMD] [--version]\n", argv[0]);