aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jason A. Donenfeld <Jason@zx2c4.com>2014-01-20 21:05:08 (JST)
committerGravatar Jason A. Donenfeld <Jason@zx2c4.com>2014-01-20 21:05:08 (JST)
commit6a1563343c48f9e38b85f39f4a95c89ea0f46a60 (patch)
tree1152bb50ffac1fc3283a3866b3986c6aeae2c660
parentd3581b58890389794de5d5222c91a0129873e95c (diff)
downloadcgit-6a1563343c48f9e38b85f39f4a95c89ea0f46a60.zip
cgit-6a1563343c48f9e38b85f39f4a95c89ea0f46a60.tar.gz
cgit: add --version argument for printing info
We need this to do runtime tests for make test. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--cgit.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 09fce0c..36251e7 100644
--- a/cgit.c
+++ b/cgit.c
@@ -921,6 +921,23 @@ static void cgit_parse_args(int argc, const char **argv)
921 int scan = 0; 921 int scan = 0;
922 922
923 for (i = 1; i < argc; i++) { 923 for (i = 1; i < argc; i++) {
924 if (!strcmp(argv[i], "--version")) {
925 printf("CGit %s | http://git.zx2c4.com/cgit/\n\nCompiled in features:\n", CGIT_VERSION);
926#ifdef NO_LUA
927 printf("[-] ");
928#else
929 printf("[+] ");
930#endif
931 printf("Lua scripting\n");
932#ifndef HAVE_LINUX_SENDFILE
933 printf("[-] ");
934#else
935 printf("[+] ");
936#endif
937 printf("Linux sendfile() usage\n");
938
939 exit(0);
940 }
924 if (!prefixcmp(argv[i], "--cache=")) { 941 if (!prefixcmp(argv[i], "--cache=")) {
925 ctx.cfg.cache_root = xstrdup(argv[i] + 8); 942 ctx.cfg.cache_root = xstrdup(argv[i] + 8);
926 } else if (!strcmp(argv[i], "--nocache")) { 943 } else if (!strcmp(argv[i], "--nocache")) {