about summary refs log tree commit diff
path: root/surf.c
diff options
context:
space:
mode:
authorEnno Boland (tox) <tox@s01.de>2009-09-06 13:27:28 +0200
committerEnno Boland (tox) <tox@s01.de>2009-09-06 13:27:28 +0200
commit2448c967f6fed9cc8f570ec2df3f1d59b714e33e (patch)
tree8bd095ce617ea077416bd86032081b291cbb3d93 /surf.c
parentminimal cookie implementation. still using also old one. (diff)
downloadsurf-2448c967f6fed9cc8f570ec2df3f1d59b714e33e.tar.gz
surf-2448c967f6fed9cc8f570ec2df3f1d59b714e33e.tar.bz2
surf-2448c967f6fed9cc8f570ec2df3f1d59b714e33e.zip
Dropping -f/-u arguments as suggested by Kai Hendry
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c20
1 files changed, 10 insertions, 10 deletions
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();