forked from gcsjsd/fileStorageEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (33 loc) · 865 Bytes
/
Copy pathmain.cpp
File metadata and controls
36 lines (33 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <string>
#include "SFArchive.h"
int main(int argc, char *argv[]) {
SFArchive instance;
std::string command(argv[1]);
if(argc<=2){
instance.info();
}else if(command=="add"){
std::string type(argv[2]);
std::string file(argv[3]);
instance.add(type, file);
}else if(command=="del"){
std::string type(argv[2]);
std::string file(argv[3]);
instance.del(type, file);
}else if(command=="list"){
if(argc==3){
std::string content(argv[2]);
instance.l(content);
}else{
instance.l();
}
}else if(command=="search"){
std::string content(argv[2]);
instance.search(content);
}else if(command=="-v"){
instance.version();
}else{
instance.error();
}
return 0;
}