@@ -17,8 +17,9 @@ def main(command, target):
17
17
return (0 )
18
18
19
19
elif command == "search" :
20
- db .searchDb (target )
21
- return (0 )
20
+ for tar in target .split (',' ):
21
+ db .searchDb (tar )
22
+ return (0 )
22
23
23
24
elif command == "export" :
24
25
res = db .exportDb (target )
@@ -30,76 +31,81 @@ def main(command, target):
30
31
return (0 )
31
32
32
33
elif command == "save" :
33
- res = db .saveOne (target )
34
- if res == 1 :
35
- print ("[!] Could not find {} in local history" .format (target ))
36
- return (1 )
37
- if res == 2 :
38
- print ("[!] Error saving {} to local directory" .format (target ))
39
- return (1 )
40
- else :
41
- print ("[+] Successfully saved {} to local directory" .format (target ))
42
- return (0 )
34
+ for tar in target .split (',' ):
35
+ res = db .saveOne (tar )
36
+ if res == 1 :
37
+ print ("[!] Could not find {} in local history" .format (tar ))
38
+ return (1 )
39
+ if res == 2 :
40
+ print ("[!] Error saving {} to local directory" .format (tar ))
41
+ return (1 )
42
+ else :
43
+ print ("[+] Successfully saved {} to local directory" .format (tar ))
44
+ return (0 )
43
45
44
46
elif command == "import" :
45
- res = db .importDb (target )
46
- if res == 1 :
47
- print ("[!] Could not read {}" .format (target ))
48
- return (1 )
49
- elif res == 2 :
50
- print ("[!] Could not import {}" .format (target ))
51
- return (1 )
52
- elif res == 3 :
53
- print ("[!] No entries in {}" .format (target ))
54
- return (1 )
55
- else :
56
- print ("[+] Successfully imported {}" .format (target ))
57
- return (0 )
47
+ for tar in target .split (',' ):
48
+ res = db .importDb (tar )
49
+ if res == 1 :
50
+ print ("[!] Could not read {}" .format (tar ))
51
+ return (1 )
52
+ elif res == 2 :
53
+ print ("[!] Could not import {}" .format (tar ))
54
+ return (1 )
55
+ elif res == 3 :
56
+ print ("[!] No entries in {}" .format (tar ))
57
+ return (1 )
58
+ else :
59
+ print ("[+] Successfully imported {}" .format (tar ))
60
+ return (0 )
58
61
59
62
elif command == "delete" :
60
- res = db .deleteItem (target )
61
- if res == 1 :
62
- print ("[!] Could not find {} in history" .format (target ))
63
- return (1 )
64
- elif res == 2 :
65
- print ("[!] Could not delete {} from history" .format (target ))
66
- return (1 )
67
- else :
68
- print ("[+] Successfully deleted {} from history" .format (target ))
69
- return (0 )
63
+ for tar in target .split (',' ):
64
+ res = db .deleteItem (tar )
65
+ if res == 1 :
66
+ print ("[!] Could not find {} in history" .format (tar ))
67
+ return (1 )
68
+ elif res == 2 :
69
+ print ("[!] Could not delete {} from history" .format (tar ))
70
+ return (1 )
71
+ else :
72
+ print ("[+] Successfully deleted {} from history" .format (tar ))
73
+ return (0 )
70
74
71
75
elif command == "upload" :
72
- res = updown .uploadFile (target )
73
- if res == 1 :
74
- print ("[!] Could not find {}" .format (target ))
75
- return (1 )
76
- elif res == 2 :
77
- print ("[!] Could not encrypt {}" .format (target ))
78
- return (1 )
79
- elif res == 3 :
80
- print ("[!] Could not upload {}" .format (target ))
81
- return (1 )
82
- elif res == 4 :
83
- print ("[!] Could not add an entry for {}" .format (target ))
84
- return (1 )
85
- else :
86
- print ("[+] Successfully uploaded {}" .format (target ))
87
- return (0 )
76
+ for tar in target .split (',' ):
77
+ res = updown .uploadFile (tar )
78
+ if res == 1 :
79
+ print ("[!] Could not find {}" .format (tar ))
80
+ return (1 )
81
+ elif res == 2 :
82
+ print ("[!] Could not encrypt {}" .format (tar ))
83
+ return (1 )
84
+ elif res == 3 :
85
+ print ("[!] Could not upload {}" .format (tar ))
86
+ return (1 )
87
+ elif res == 4 :
88
+ print ("[!] Could not add an entry for {}" .format (tar ))
89
+ return (1 )
90
+ else :
91
+ print ("[+] Successfully uploaded {}" .format (tar ))
92
+ return (0 )
88
93
89
94
elif command == "download" :
90
- res = updown .downloadFile (target )
91
- if res == 1 :
92
- print ("[!] Could not retrieve {} from history" .format (target ))
93
- return (1 )
94
- elif res == 2 :
95
- print ("[!] Could not download {}" .format (target ))
96
- return (1 )
97
- elif res == 3 :
98
- print ("[!] Could not decrypt {}" .format (target ))
99
- return (1 )
100
- else :
101
- print ("[+] Downloaded {} successfully" .format (res ))
102
- return (0 )
95
+ for tar in target .split (',' ):
96
+ res = updown .downloadFile (tar )
97
+ if res == 1 :
98
+ print ("[!] Could not retrieve {} from history" .format (tar ))
99
+ return (1 )
100
+ elif res == 2 :
101
+ print ("[!] Could not download {}" .format (tar ))
102
+ return (1 )
103
+ elif res == 3 :
104
+ print ("[!] Could not decrypt {}" .format (tar ))
105
+ return (1 )
106
+ else :
107
+ print ("[+] Downloaded {} successfully" .format (res ))
108
+ return (0 )
103
109
else :
104
110
print (config .usage )
105
111
return (1 )
0 commit comments