automanga: Don't use CWD by default if given no arguments.
authorFredrik Tolf <fredrik@dolda2000.com>
Sat, 13 Jun 2020 14:21:13 +0000 (16:21 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Sat, 13 Jun 2020 14:21:13 +0000 (16:21 +0200)
It's seldom an intended usage anyway, so the usage message is quite
arguably more helpful.

automanga

index bb6c4d5..39262a7 100755 (executable)
--- a/automanga
+++ b/automanga
@@ -139,10 +139,10 @@ def main():
     else:
         libname = "local"
         try:
-            if len(args) > 0:
-                mdir = args.pop(0)
-            else:
-                mdir = "."
+            if len(args) < 1:
+                usage(sys.stderr)
+                sys.exit(1)
+            mdir = args.pop(0)
             mng = manga.local.manga(mdir)
         except TypeError:
             sys.stderr.write("automanga: not a valid manga directory: %s\n" % mdir)