From: Philipp Gesang Date: Thu, 2 Mar 2017 13:36:43 +0000 (+0100) Subject: display backup.py usage if no action was specified X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=d3dd37a7a461ea2f0b6e8b62e8bdf482ddadaf4c;p=python-delta-tar display backup.py usage if no action was specified Getting no feedback if the invocation had no effect is rather unseemly. Print the help message instead. --- diff --git a/backup.py b/backup.py index 26c9de7..3566967 100644 --- a/backup.py +++ b/backup.py @@ -124,4 +124,10 @@ if __name__ == "__main__": else: deltatar.restore_backup(args.targetpath, backup_tar_path=args.sourcepath) elif args.equals: - check_equal_dirs(os.path.abspath(args.sourcepath), os.path.abspath(args.targetpath), deltatar) \ No newline at end of file + check_equal_dirs(os.path.abspath(args.sourcepath), os.path.abspath(args.targetpath), deltatar) + else: + import sys + print("Nothing to do.\nPlease specify one of --full, --diff, --list-files, " + "--restore, --equals.\n", file=sys.stderr) + parser.print_help(file=sys.stderr) +