about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-01-20 13:05:08 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2014-01-20 13:05:08 +0100
commit6a1563343c48f9e38b85f39f4a95c89ea0f46a60 (patch)
tree1152bb50ffac1fc3283a3866b3986c6aeae2c660
parentcache: use sendfile() instead of a pair of read() + write() (diff)
downloadcgit-pink-6a1563343c48f9e38b85f39f4a95c89ea0f46a60.tar.gz
cgit-pink-6a1563343c48f9e38b85f39f4a95c89ea0f46a60.zip
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)
 	int scan = 0;
 
 	for (i = 1; i < argc; i++) {
+		if (!strcmp(argv[i], "--version")) {
+			printf("CGit %s | http://git.zx2c4.com/cgit/\n\nCompiled in features:\n", CGIT_VERSION);
+#ifdef NO_LUA
+			printf("[-] ");
+#else
+			printf("[+] ");
+#endif
+			printf("Lua scripting\n");
+#ifndef HAVE_LINUX_SENDFILE
+			printf("[-] ");
+#else
+			printf("[+] ");
+#endif
+			printf("Linux sendfile() usage\n");
+
+			exit(0);
+		}
 		if (!prefixcmp(argv[i], "--cache=")) {
 			ctx.cfg.cache_root = xstrdup(argv[i] + 8);
 		} else if (!strcmp(argv[i], "--nocache")) {
href='/exman/commit/OpenBSD/Makefile?h=2064.25&id=9058456156086388fc737852e6f7ae4c0e04a72e&follow=1'>openbsd: Include man pages from baseXX.tgzKeith Whitney A number of OpenBSD man pages are currently missing in exman, since they reside in OpenBSD's baseXX.tgz [1]: - help(1) - man(1) - pkg_add(1) - OpenBSD::BaseState(3p) - packages(7) - adduser(8) - afterboot(8) - user(8) - useradd(8) - userdel(8) - userinfo(8) - usermod(8) This patch adds baseXX.tgz to the OpenBSD distfiles, which begrudgingly adds ~330 MiB to the install. I figure this might acceptable since base.txz is similarly fetched for FreeBSD. Since this isn't ideal, I'll look into whether these man pages are intended to be in baseXX.tgz or not. If not, I'll see about changing this upstream, and this patch can be reverted. [1] Lines 2876-2931: https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/distrib/sets/lists/base/mi?annotate=1.1065 2022-05-08Update to OpenBSD 7.1 2062.73June McEnroe 2021-10-15Update to OpenBSD 7.0 2062.63June McEnroe 2021-08-29Update to Linux man-pages 5.13 2062.53Štěpán Němec 2021-08-26Update to NetBSD 9.2 2062.52June McEnroe 2021-08-26Support DESTDIR in install/uninstallJune McEnroe 2021-08-26Add version number generatorJune McEnroe 2021-08-22Add ISC license headerJune McEnroe 2021-08-22Update to Linux man-pages 5.12Štěpán Němec 2021-06-21Add manuals for macOS 11.3June McEnroe 2021-05-08Update to OpenBSD 6.9June McEnroe 2021-04-26Update to Linux man-pages 5.11June McEnroe 2021-04-26Update to FreeBSD 13.0June McEnroe 2021-01-27Completely rewrite how manuals are fetched and installedJune McEnroe Also add section 6 manuals from NetBSD and OpenBSD! 2020-12-14Update to man-pages-posix 2017-aJune McEnroe 2020-12-14Update to OpenBSD 6.8June McEnroe 2020-12-14Update to NetBSD 9.1June McEnroe 2020-12-14Update to man-pages 5.09June McEnroe 2020-12-14Update to FreeBSD 12.2June McEnroe 2020-06-08Update to OpenBSD 6.7June McEnroe 2020-05-04Add hack for macOS to search extra man sectionsJune McEnroe 2020-05-04Don't clear MANSECTJune McEnroe