From d3dd37a7a461ea2f0b6e8b62e8bdf482ddadaf4c Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 2 Mar 2017 14:36:43 +0100 Subject: [PATCH] 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. --- backup.py | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) 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) + -- 1.7.1