-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
52 lines (51 loc) · 1.22 KB
/
main.cpp
File metadata and controls
52 lines (51 loc) · 1.22 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <iostream>
#include "include/RadiPako.hpp"
#include <string>
#include <vector>
int main(int argc, char const *argv[])
{
std::cout << RadiPako::VersionString() << std::endl;
int skip = -1;
int it = 0;
std::string dest;
std::vector<std::string> paths;
if (argc > 2)
{
for (int i = 1; i < argc; i++)
{
if (argv[i][0] == '-')
{
switch (argv[i][1])
{
case 'o':
dest = argv[i + 1];
skip = i + 1;
break;
//TODO: NEW CASES.
default:
break;
}
}
else
{
if (i != skip)
{
paths.push_back(argv[i]);
}
}
}
if (RadiPako::CreateFile(RadiPako::JointFiles(paths.size(), paths), dest.c_str()))
{
std::cout << dest << " has been created!" << std::endl;
}
else
{
std::cout << "Can't create this file!" << std::endl;
}
}
else
{
std::cout << "No arguments typed." << std::endl;
}
return 0;
}