~ft/nvi

b7306bef352fc0796d84a5ef0bd5a301629adfe9 — Sigrid Solveig Haflínudóttir 2 years ago 976b2c3
print a usage error if no options were specified
1 files changed, 4 insertions(+), 0 deletions(-)

M nvi.c
M nvi.c => nvi.c +4 -0
@@ 76,6 76,10 @@ threadmain(int argc, char **argv)

	if(argc != 1)
		usage();
	if(cmd != Cinfo && ov == nil && oa == nil){
		fprint(2, "at least one option (-i, -a, -v) has be specified\n");
		threadexitsall("usage");
	}
	vid = argv[0];
	if(strncmp(argv[0], "http", 4) == 0){
		if(strstr(argv[0], "youtu") != nil && (vid = strrpbrk(argv[0], "/=")) != nil)