2021-04-23 21:31:42 +02:00
|
|
|
#include <iostream>
|
|
|
|
#include <fstream>
|
2021-04-26 10:11:08 +02:00
|
|
|
#include <boost/program_options.hpp>
|
|
|
|
|
|
|
|
namespace po = boost::program_options;
|
|
|
|
|
|
|
|
void parseargs(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
po::options_description desc("Allowed options");
|
|
|
|
desc.add_options()
|
|
|
|
("help", "Print this message")
|
|
|
|
("input,i", "Specify an input file")
|
|
|
|
("ih", "Input data is in hex")
|
|
|
|
("output,o", "Specify an output file")
|
|
|
|
("oh", "Output data in hex")
|
|
|
|
;
|
|
|
|
|
|
|
|
po::positional_options_description p;
|
|
|
|
p.add("input", -1);
|
|
|
|
|
|
|
|
po::variables_map vm;
|
|
|
|
po::store(po::parse_command_line(argc, argv, desc), vm);
|
|
|
|
po::notify(vm);
|
|
|
|
|
|
|
|
if (vm.count("help"))
|
|
|
|
{
|
|
|
|
std::cout << desc << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (vm.count("input"))
|
|
|
|
{
|
|
|
|
std::cout << "input works";
|
|
|
|
}
|
|
|
|
|
|
|
|
/*if (vm.count(""))
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (vm.count(""))
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (vm.count(""))
|
|
|
|
{
|
|
|
|
|
|
|
|
}*/
|
|
|
|
}
|
2021-04-23 21:31:42 +02:00
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
2021-04-26 10:11:08 +02:00
|
|
|
parseargs(argc, argv);
|
|
|
|
|
|
|
|
/*std::fstream fInput;
|
2021-04-23 21:31:42 +02:00
|
|
|
fInput.open(argv[1], std::ios::in);
|
|
|
|
if (!fInput)
|
|
|
|
{
|
|
|
|
std::cout << "File does not exist.";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char ch;
|
|
|
|
while (!fInput.eof())
|
|
|
|
{
|
|
|
|
fInput >> ch;
|
|
|
|
std::cout << ch;
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
fInput.close();
|
|
|
|
}
|
2021-04-26 10:11:08 +02:00
|
|
|
return 0;*/
|
2021-04-23 21:31:42 +02:00
|
|
|
}
|