UWSGI_VERSION --version

This commit is contained in:
roberto@sirius
2010-03-11 10:04:21 +01:00
parent f2b72814a6
commit 41190a5336
2 changed files with 10 additions and 2 deletions
+6 -2
View File
@@ -606,6 +606,7 @@ int main (int argc, char *argv[], char *envp[]) {
{"proxy-node", required_argument, 0, LONG_ARGS_PROXY_NODE},
{"proxy-max-connections", required_argument, 0, LONG_ARGS_PROXY_MAX_CONNECTIONS},
{"wsgi-file", required_argument, 0, LONG_ARGS_WSGI_FILE},
{"version", no_argument, 0, LONG_ARGS_VERSION},
{0, 0, 0, 0}
};
#endif
@@ -684,12 +685,12 @@ int main (int argc, char *argv[], char *envp[]) {
if (uwsgi.shared->options[UWSGI_OPTION_CGI_MODE] == 0) {
#endif
if (uwsgi.test_module == NULL) {
fprintf (stderr, "*** Starting uWSGI (%dbit) on [%.*s] ***\n", (int) (sizeof (void *)) * 8, 24, ctime ((const time_t *) &uwsgi.start_tv.tv_sec));
fprintf (stderr, "*** Starting uWSGI %s (%dbit) on [%.*s] ***\n", UWSGI_VERSION, (int) (sizeof (void *)) * 8, 24, ctime ((const time_t *) &uwsgi.start_tv.tv_sec));
}
#ifndef UNBIT
}
else {
fprintf (stderr, "*** Starting uWSGI (CGI mode) (%dbit) on [%.*s] ***\n", (int) (sizeof (void *)) * 8, 24, ctime ((const time_t *) &uwsgi.start_tv.tv_sec));
fprintf (stderr, "*** Starting uWSGI %s (CGI mode) (%dbit) on [%.*s] ***\n", UWSGI_VERSION, (int) (sizeof (void *)) * 8, 24, ctime ((const time_t *) &uwsgi.start_tv.tv_sec));
}
#endif
@@ -2505,6 +2506,9 @@ void manage_opt(int i, char *optarg) {
switch (i) {
#ifndef UNBIT
case LONG_ARGS_VERSION:
fprintf(stdout,"uWSGI %s\n", UWSGI_VERSION);
exit(0);
case LONG_ARGS_PIDFILE:
uwsgi.pidfile = optarg;
break;
+4
View File
@@ -3,6 +3,7 @@
/* indent -i8 -br -brs -brf -l0 -npsl */
#define UWSGI_VERSION "0.9.5-dev"
#include <stdio.h>
#include <stdlib.h>
@@ -111,6 +112,7 @@ PyAPI_FUNC (PyObject *) PyMarshal_ReadObjectFromString (char *, Py_ssize_t);
#define LONG_ARGS_PROXY 17015
#define LONG_ARGS_PROXY_NODE 17016
#define LONG_ARGS_PROXY_MAX_CONNECTIONS 17017
#define LONG_ARGS_VERSION 17018
#define UWSGI_CLEAR_STATUS uwsgi.workers[uwsgi.mywid].status = 0
@@ -257,6 +259,8 @@ struct __attribute__ ((packed)) wsgi_request {
int status;
int response_size;
int headers_size;
int async_status ;
};