summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--surf.110
-rw-r--r--surf.c20
2 files changed, 11 insertions, 19 deletions
diff --git a/surf.1 b/surf.1
index 98cb0ce..b6684cd 100644
--- a/surf.1
+++ b/surf.1
@@ -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
@@ -17,16 +16,9 @@ one can point surf to another URI by setting its XProperties.
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
index 192e26a..2a6d388 100644
--- a/surf.c
+++ b/surf.c
@@ -524,7 +524,7 @@ titlechange(WebKitWebView *v, WebKitWebFrame *f, const gchar *t, Client *c) {
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
@@ -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 LICENSE for details\n");
break;
default:
usage();
}
- if(optind != argc)
+ if(optind + 1 == argc) {
+ c = newclient();
+ if(strchr("./", argv[optind][0]) || strcmp("-", argv[optind]) == 0)
+ loadfile(c, argv[optind]);
+ else
+ loaduri(c, argv[optind]);
+
+ }
+ else if(optind != argc)
usage();
if(!clients)
newclient();
ertions'>+1 2011-09-20tweak matchGravatar Connor Lane Smith 1-2/+2 2011-09-20update manpageGravatar Connor Lane Smith 1-9/+6 2011-09-19detect active monitor using input focusGravatar Connor Lane Smith 1-7/+12 2011-09-19add token matchingGravatar Connor Lane Smith 1-23/+34 2011-09-19change version to 'hg'Gravatar Connor Lane Smith 1-1/+1 2011-07-24dmenu_run: sh -cGravatar Connor Lane Smith 1-1/+1 2011-07-22fix loadfontGravatar Connor Lane Smith 1-12/+13 2011-07-19Added tag 4.4 for changeset 2b105eaae831Gravatar Connor Lane Smith 1-0/+1 2011-07-19add lsx.1 to distGravatar Connor Lane Smith 1-1/+1 2011-07-17tweaksGravatar Connor Lane Smith 2-2/+2 2011-07-14efficiency tweaksGravatar Connor Lane Smith 2-60/+44 2011-07-14fix extra warningGravatar Connor Lane Smith 1-1/+1 2011-07-06simpler vlineGravatar Connor Lane Smith 1-4/+2 2011-07-04rebind ^N ^PGravatar Connor Lane Smith 2-3/+3 2011-06-25include limits.hGravatar Connor Lane Smith 1-0/+1 2011-06-23make clean lsxGravatar Connor Lane Smith 1-1/+1 2011-06-23lsx: check snprintfGravatar Connor Lane Smith 1-4/+3 2011-06-18update draw.cGravatar Connor Lane Smith 2-14/+14 2011-06-18simpler lsxGravatar Connor Lane Smith 3-11/+6 2011-06-13new dmenu_runGravatar Connor Lane Smith 5-26/+15