.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
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
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
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();