diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-08-26 22:38:16 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-08-26 22:38:16 +0000 |
commit | edc4d8b221b9c056e153af9309ffd3647d3b1fab (patch) | |
tree | 9b4e5b4a4f3ae16966178603e48319bb95bc003a | |
parent | 886dba8a2915252a008c4218627297d54eb1221a (diff) | |
download | rdiff-backup-edc4d8b221b9c056e153af9309ffd3647d3b1fab.tar.gz |
Updated argument parsing (test-server, better error messages)
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@404 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r-- | rdiff-backup/rdiff_backup/Main.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py index f9cb252..b476124 100644 --- a/rdiff-backup/rdiff_backup/Main.py +++ b/rdiff-backup/rdiff_backup/Main.py @@ -156,11 +156,15 @@ def check_action(): 'list-changed-since', 'check-destination-dir'], 2: ['backup', 'restore', 'restore-as-of']} l = len(args) - if not action: assert l == 2, args # cannot tell backup or restore yet - elif action == 'calculate-average': - if l == 0: commandline_error("No arguments given") + if l == 0 and action not in arg_action_dict[l]: + commandline_error("No arguments given") + elif not action: + if l == 2: pass # Will determine restore or backup later + else: + commandline_error("Switches missing or wrong number of arguments") + elif action == 'test-server': pass # test-server takes any number of args elif l > 2 or action not in arg_action_dict[l]: - commandline_error("Wrong number of arguments given. See man page.") + commandline_error("Wrong number of arguments given.") def final_set_action(rps): """If no action set, decide between backup and restore at this point""" |