From 31193ae219dbc8295f8340dacc71be263b35cb8c Mon Sep 17 00:00:00 2001 From: Spencer Williams Date: Thu, 27 Jul 2023 18:57:43 -0400 Subject: Add version flag --- mpc-bar.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mpc-bar.m b/mpc-bar.m index 42e26ae..f319441 100644 --- a/mpc-bar.m +++ b/mpc-bar.m @@ -8,6 +8,7 @@ #include #include +#define VERSION "0.1" #define TITLE_MAX_LENGTH 96 #define SLEEP_INTERVAL 0.2 @@ -450,8 +451,14 @@ cleanup: @end int main(int argc, char *argv[]) { + if (argc > 1 && strcmp(argv[1], "-v") == 0) { + puts("MPC Bar "VERSION); + return 0; + } + [NSApplication sharedApplication]; [MPDController new]; [NSApp run]; + return 0; } -- cgit v1.2.3