]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSCORE-534
authorBrian West <brian@freeswitch.org>
Sat, 23 Jan 2010 18:37:11 +0000 (18:37 +0000)
committerBrian West <brian@freeswitch.org>
Sat, 23 Jan 2010 18:37:11 +0000 (18:37 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16482 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch.c

index a07101e41b8278e1551940c45ed052481d85898b..55bafb76739565cacf17120bdeb778d4f5f6725b 100644 (file)
@@ -44,6 +44,7 @@
 #endif
 
 #include <switch.h>
+#include <switch_version.h>
 #include "private/switch_core_pvt.h"
 
 /* pid filename: Stores the process id of the freeswitch process */
@@ -321,6 +322,7 @@ int main(int argc, char *argv[])
                "\t-g [group]             -- specify group to switch to\n"
 #endif
                "\t-help                  -- this message\n"
+               "\t-version               -- print the version and exit\n"
 #ifdef HAVE_SETRLIMIT
                "\t-waste                 -- allow memory waste\n"
                "\t-core                  -- dump cores\n"
@@ -464,6 +466,13 @@ int main(int argc, char *argv[])
                        nf++;
                        known_opt++;
                }
+
+               if (local_argv[x] && !strcmp(local_argv[x], "-version")) {
+                       fprintf(stdout, "FreeSWITCH version: %s\n", SWITCH_VERSION_FULL);
+                       return 0;
+                       known_opt++;
+               }
+
 #endif
 #ifdef HAVE_SETRLIMIT
                if (local_argv[x] && !strcmp(local_argv[x], "-core")) {