Introduction
Introduction Statistics Contact Development Disclaimer Help
tDropping -f/-u arguments as suggested by Kai Hendry - surf - customized build …
git clone git://src.adamsgaard.dk/surf
Log
Files
Refs
README
LICENSE
---
commit 2448c967f6fed9cc8f570ec2df3f1d59b714e33e
parent 844d414525290893da44d09f5dcad00e956eb1c6
Author: Enno Boland (tox) <[email protected]>
Date: Sun, 6 Sep 2009 13:27:28 +0200
Dropping -f/-u arguments as suggested by Kai Hendry
Diffstat:
M surf.1 | 10 +---------
M surf.c | 20 ++++++++++----------
2 files changed, 11 insertions(+), 19 deletions(-)
---
diff --git a/surf.1 b/surf.1
t@@ -4,8 +4,7 @@ surf \- simple webkit-based browser
.SH SYNOPSIS
.B surf
.RB [ \-ehvx ]
-.RB [ \-f " FILE"]
-.RB [ \-u " URI"]
+.RB "URI"
.SH DESCRIPTION
surf is a simple Web browser based on WebKit/GTK+. It is able
to display websites and follow links. It supports the XEmbed protocol
t@@ -17,16 +16,9 @@ one can point surf to another URI by setting its XPropertie…
Prints xid to standard output and waits until an application reparents the
window.
.TP
-.B \-f FILE
-Sets the browser's URI to FILE. It is also possible to read from standard
-input.
-.TP
.B \-h
Prints usage information to standard output, then exits.
.TP
-.B \-u URI
-Sets the browser's URI.
-.TP
.B \-v
Prints version information to standard output, then exits.
.TP
diff --git a/surf.c b/surf.c
t@@ -524,7 +524,7 @@ titlechange(WebKitWebView *v, WebKitWebFrame *f, const gch…
void
usage() {
fputs("surf - simple browser\n", stderr);
- die("usage: surf [-e] [-x] [-u uri] [-f file]\n");
+ die("usage: surf [-e] [-x] [uri]\n");
}
void
t@@ -564,21 +564,21 @@ int main(int argc, char *argv[]) {
showxid = TRUE;
embed = TRUE;
break;
- case 'u':
- c = newclient();
- loaduri(c, optarg);
- break;
- case 'f':
- c = newclient();
- loadfile(c, optarg);
- break;
case 'v':
die("surf-"VERSION", © 2009 surf engineers, see LICEN…
break;
default:
usage();
}
- if(optind != argc)
+ if(optind + 1 == argc) {
+ c = newclient();
+ if(strchr("./", argv[optind][0]) || strcmp("-", argv[optind]) …
+ loadfile(c, argv[optind]);
+ else
+ loaduri(c, argv[optind]);
+
+ }
+ else if(optind != argc)
usage();
if(!clients)
newclient();
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.