From 8053d89f7b3d26d4c113261dc9e3f58e7dd57eb9 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 6 Apr 1998 14:45:26 +0000 Subject: [PATCH] Add usage message when no arguments. --- Lib/tabnanny.py | 4 ++++ Tools/idle/tabnanny.py | 4 ++++ Tools/scripts/tabnanny.py | 4 ++++ Tools/scripts/tabpolice.py | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/Lib/tabnanny.py b/Lib/tabnanny.py index 9af8ecb847d..b290fb62cd4 100755 --- a/Lib/tabnanny.py +++ b/Lib/tabnanny.py @@ -19,9 +19,13 @@ def main(): opts, args = getopt.getopt(sys.argv[1:], "v") except getopt.error, msg: print msg + return for o, a in opts: if o == '-v': verbose = verbose + 1 + if not args: + print "Usage:", sys.argv[0], "file_or_directory ..." + return for arg in args: check(arg) diff --git a/Tools/idle/tabnanny.py b/Tools/idle/tabnanny.py index 9af8ecb847d..b290fb62cd4 100755 --- a/Tools/idle/tabnanny.py +++ b/Tools/idle/tabnanny.py @@ -19,9 +19,13 @@ def main(): opts, args = getopt.getopt(sys.argv[1:], "v") except getopt.error, msg: print msg + return for o, a in opts: if o == '-v': verbose = verbose + 1 + if not args: + print "Usage:", sys.argv[0], "file_or_directory ..." + return for arg in args: check(arg) diff --git a/Tools/scripts/tabnanny.py b/Tools/scripts/tabnanny.py index 9af8ecb847d..b290fb62cd4 100755 --- a/Tools/scripts/tabnanny.py +++ b/Tools/scripts/tabnanny.py @@ -19,9 +19,13 @@ def main(): opts, args = getopt.getopt(sys.argv[1:], "v") except getopt.error, msg: print msg + return for o, a in opts: if o == '-v': verbose = verbose + 1 + if not args: + print "Usage:", sys.argv[0], "file_or_directory ..." + return for arg in args: check(arg) diff --git a/Tools/scripts/tabpolice.py b/Tools/scripts/tabpolice.py index 22005e119e6..ae97581fd86 100755 --- a/Tools/scripts/tabpolice.py +++ b/Tools/scripts/tabpolice.py @@ -16,6 +16,7 @@ def main(): opts, args = getopt.getopt(sys.argv[1:], "qv") except getopt.error, msg: print msg + return for o, a in opts: if o == '-v': verbose = verbose + 1 @@ -23,6 +24,9 @@ def main(): if o == '-q': quiet = 1 verbose = 0 + if not args: + print "Usage:", sys.argv[0], "file_or_directory ..." + return for arg in args: check(arg)