aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/aesxx/utils/helpers/cmd_parser_file.hpp
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-07-22 21:32:59 +0200
committerEgor Tensin <egor@tensin.name>2026-07-22 21:32:59 +0200
commitff93a0a580416f73bc86c7a12c5637819ca146e6 (patch)
tree071c758a6b7f883be32d57900395231781a8abb5 /aesxx/utils/helpers/cmd_parser_file.hpp
parentrewrite: the beginning (diff)
downloadaes-tools-ff93a0a580416f73bc86c7a12c5637819ca146e6.tar.gz
aes-tools-ff93a0a580416f73bc86c7a12c5637819ca146e6.zip
rewrite: sort out and modernize Boost.Program_Options usage
Diffstat (limited to 'aesxx/utils/helpers/cmd_parser_file.hpp')
-rw-r--r--aesxx/utils/helpers/cmd_parser_file.hpp30
1 files changed, 8 insertions, 22 deletions
diff --git a/aesxx/utils/helpers/cmd_parser_file.hpp b/aesxx/utils/helpers/cmd_parser_file.hpp
index 8adfb1d..d66c139 100644
--- a/aesxx/utils/helpers/cmd_parser_file.hpp
+++ b/aesxx/utils/helpers/cmd_parser_file.hpp
@@ -14,46 +14,32 @@
#include <boost/program_options.hpp>
#include <optional>
-#include <ostream>
#include <string>
#include <string_view>
-#include <utility>
class FileSettings : public SettingsParser {
public:
explicit FileSettings(std::string_view argv0) : SettingsParser{argv0} {
+ namespace po = boost::program_options;
+
visible.add_options()(
- "algorithm,a",
- boost::program_options::value<aes::Algorithm>(&algorithm)
- ->required()
- ->value_name("NAME"),
- "set algorithm"
+ "algorithm,a", po::value(&algorithm)->required()->value_name("NAME"), "set algorithm"
);
visible.add_options()(
- "mode,m",
- boost::program_options::value<aes::Mode>(&mode)->required()->value_name("MODE"),
- "set mode of operation"
+ "mode,m", po::value(&mode)->required()->value_name("MODE"), "set mode of operation"
);
visible.add_options()(
- "key,k",
- boost::program_options::value<std::string>(&key)->required()->value_name("KEY"),
- "set encryption key"
+ "key,k", po::value(&key)->required()->value_name("KEY"), "set encryption key"
);
visible.add_options()(
- "iv,v",
- boost::program_options::value(&iv)->value_name("BLOCK"),
- "set initialization vector"
+ "iv,v", po::value(&iv)->value_name("BLOCK"), "set initialization vector"
);
visible.add_options()(
- "input,i",
- boost::program_options::value<std::string>(&input_path)->required()->value_name("PATH"),
- "set input file path"
+ "input,i", po::value(&input_path)->required()->value_name("PATH"), "set input file path"
);
visible.add_options()(
"output,o",
- boost::program_options::value<std::string>(&output_path)
- ->required()
- ->value_name("PATH"),
+ po::value(&output_path)->required()->value_name("PATH"),
"set output file path"
);
}