Skip to content

Commit 5ebbc8f

Browse files
authored
Merge pull request #3 from rabits/fix-issue-2
Updated Common version and logger about argument errors
2 parents 0efb216 + fd05d5d commit 5ebbc8f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lib/Common

Submodule Common updated 1 file

vk-backup.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22
# -*- coding: UTF-8 -*-
3-
'''VK-Backup 0.8.0
3+
'''VK-Backup 0.8.1
44
55
Author: Rabit <[email protected]>
66
License: GPL v3
@@ -15,6 +15,7 @@
1515
from lib import vk_auth
1616

1717
import getpass, os
18+
from sys import exit
1819

1920
c.init_begin(__doc__)
2021
c.option('-u', '--user', type='string', dest='user', metavar='EMAIL', default=None, help='vk.com account user email (<user>@<host>) (required)')
@@ -24,13 +25,15 @@
2425
c.init_end()
2526

2627
if c.cfg('user') == None:
27-
parser.error('Unable to get email from the user option')
28+
c.log('error', 'Unable to get email from the user option')
29+
exit(1)
2830

2931
if c.cfg('password') == None:
3032
c.cfg('password', getpass.getpass())
3133

3234
if c.cfg('download-threads') < 0:
33-
parser.error('Number of download threads can\'t be lower then zero')
35+
c.log('error', 'Number of download threads can\'t be lower then zero')
36+
exit(1)
3437

3538
class Backup:
3639
def __init__(self):

0 commit comments

Comments
 (0)