From f96c44f931a48ab7fd07d6624920b5984fdcfe1d Mon Sep 17 00:00:00 2001 From: x-00010 Date: Mon, 26 Apr 2021 09:11:08 +0100 Subject: [PATCH] Commented out own options control and added boost options control --- cxor.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/cxor.cpp b/cxor.cpp index 7bd0838..14c42d0 100755 --- a/cxor.cpp +++ b/cxor.cpp @@ -1,9 +1,58 @@ #include #include +#include + +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("")) + { + + }*/ +} int main(int argc, char* argv[]) { - std::fstream fInput; + parseargs(argc, argv); + + /*std::fstream fInput; fInput.open(argv[1], std::ios::in); if (!fInput) { @@ -20,5 +69,5 @@ int main(int argc, char* argv[]) std::cout << std::endl; fInput.close(); } - return 0; + return 0;*/ } \ No newline at end of file