Adding a common way to enable and disable features.

This commit is contained in:
Christoph Lohmann 2013-05-21 21:30:00 +02:00
parent 4f45ae9307
commit c234737bea
2 changed files with 44 additions and 1 deletions

23
surf.1
View file

@ -3,7 +3,7 @@
surf \- simple webkit-based browser surf \- simple webkit-based browser
.SH SYNOPSIS .SH SYNOPSIS
.B surf .B surf
.RB [-bgiknpsvx] .RB [-bBgGiIkKnNpPsSvx]
.RB [-c\ cookiefile] .RB [-c\ cookiefile]
.RB [-e\ xid] .RB [-e\ xid]
.RB [-r\ scriptfile] .RB [-r\ scriptfile]
@ -20,6 +20,9 @@ one can point surf to another URI by setting its XProperties.
.B \-b .B \-b
Disable Scrollbars Disable Scrollbars
.TP .TP
.B \-B
Enable Scrollbars
.TP
.B \-c cookiefile .B \-c cookiefile
Specify the Specify the
.I cookiefile .I cookiefile
@ -32,18 +35,33 @@ Reparents to window specified by
.B \-g .B \-g
Disable giving the geolocation to websites. Disable giving the geolocation to websites.
.TP .TP
.B \-G
Enable giving the geolocation to websites.
.TP
.B \-i .B \-i
Disable Images Disable Images
.TP .TP
.B \-I
Enable Images
.TP
.B \-k .B \-k
Disable kiosk mode (disable key strokes and right click)
.TP
.B \-K
Enable kiosk mode (disable key strokes and right click) Enable kiosk mode (disable key strokes and right click)
.TP .TP
.B \-n .B \-n
Disable the Web Inspector (Developer Tools). Disable the Web Inspector (Developer Tools).
.TP .TP
.B \-N
Enable the Web Inspector (Developer Tools).
.TP
.B \-p .B \-p
Disable Plugins Disable Plugins
.TP .TP
.B \-P
Enable Plugins
.TP
.B \-r scriptfile .B \-r scriptfile
Specify the user Specify the user
.I scriptfile. .I scriptfile.
@ -51,6 +69,9 @@ Specify the user
.B \-s .B \-s
Disable Javascript Disable Javascript
.TP .TP
.B \-S
Enable Javascript
.TP
.B \-t stylefile .B \-t stylefile
Specify the user Specify the user
.I stylefile. .I stylefile.

22
surf.c
View file

@ -2,6 +2,7 @@
* *
* To understand surf, start reading main(). * To understand surf, start reading main().
*/ */
#include <signal.h> #include <signal.h>
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
@ -1289,6 +1290,9 @@ main(int argc, char *argv[]) {
case 'b': case 'b':
enablescrollbars = 0; enablescrollbars = 0;
break; break;
case 'B':
enablescrollbars = 1;
break;
case 'c': case 'c':
cookiefile = EARGF(usage()); cookiefile = EARGF(usage());
break; break;
@ -1298,24 +1302,42 @@ main(int argc, char *argv[]) {
case 'g': case 'g':
allowgeolocation = 0; allowgeolocation = 0;
break; break;
case 'G':
allowgeolocation = 1;
break;
case 'i': case 'i':
loadimages = 0; loadimages = 0;
break; break;
case 'I':
loadimages = 1;
break;
case 'k': case 'k':
kioskmode = 0;
break;
case 'K':
kioskmode = 1; kioskmode = 1;
break; break;
case 'n': case 'n':
enableinspector = 0; enableinspector = 0;
break; break;
case 'N':
enableinspector = 1;
break;
case 'p': case 'p':
enableplugins = 0; enableplugins = 0;
break; break;
case 'P':
enableplugins = 1;
break;
case 'r': case 'r':
scriptfile = EARGF(usage()); scriptfile = EARGF(usage());
break; break;
case 's': case 's':
enablescripts = 0; enablescripts = 0;
break; break;
case 'S':
enablescripts = 1;
break;
case 't': case 't':
stylefile = EARGF(usage()); stylefile = EARGF(usage());
break; break;