Change options to resemble dd

This commit is contained in:
x00010 2021-04-26 20:33:45 +01:00
parent 4a3fd1c568
commit f3ec28e559
1 changed files with 8 additions and 8 deletions

View File

@ -16,14 +16,14 @@ void parseargs(int argc, char* argv[])
po::options_description desc("Allowed options"); po::options_description desc("Allowed options");
desc.add_options() desc.add_options()
("help", "Print this message") ("help", "Print this message")
("input,i", po::value<std::string>(), "Specify an input file") ("if", po::value<std::string>(), "Specify an input file")
("ih", "Input data is in hex") ("ih", "Input data is in hex")
("output,o", "Specify an output file") ("of", po::value<std::string>(), "Specify an output file")
("oh", "Output data in hex") ("oh", "Output data in hex")
; ;
po::positional_options_description p; /*po::positional_options_description p;
p.add("input", -1); p.add("input", -1);*/
po::variables_map vm; po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm); po::store(po::parse_command_line(argc, argv, desc), vm);
@ -34,9 +34,9 @@ void parseargs(int argc, char* argv[])
std::cout << desc << std::endl; std::cout << desc << std::endl;
} }
if (vm.count("input")) if (vm.count("if"))
{ {
std::string file = vm["input"].as<std::string>(); std::string file = vm["if"].as<std::string>();
std::string filecut = file.substr(1, file.length()); std::string filecut = file.substr(1, file.length());
std::cout << filecut; std::cout << filecut;
} }
@ -46,9 +46,9 @@ void parseargs(int argc, char* argv[])
bool bInputHex = true; bool bInputHex = true;
} }
if (vm.count("output")) if (vm.count("of"))
{ {
std::string file = vm["output"].as<std::string>(); std::string file = vm["of"].as<std::string>();
std::string filecut = file.substr(1, file.length()); std::string filecut = file.substr(1, file.length());
std::cout << filecut; std::cout << filecut;
} }