MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / Parse

Method Parse

lib/mdflib/mdf2csv/src/programargument.cpp:56–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void ProgramArgument::Parse(int argc, char *argv[]) {
57 Clear();
58 // Parse the command line
59 try {
60 command_line_parser parser(argc, argv);
61 parser.options(desc_);
62 parser.positional(pos_);
63 const auto opt = parser.run();
64 variables_map vm;
65 store(opt, vm);
66 notify(vm);
67 if (vm.empty()) {
68 show_help_ = true;
69 return;
70 }
71 show_help_ = vm.contains("help");
72 show_version_ = vm.contains("version");
73 if (vm.contains("non-interactive")) {
74 non_interactive_ = true;
75 }
76 if (vm.contains("quiet")) {
77 non_interactive_ = true;
78 }
79 if (vm.contains("silent")) {
80 non_interactive_ = true;
81 }
82 delete_converted_ = vm.contains("delete-converted");
83 no_append_root_ = vm.contains("no-append-root");
84 force_overwrite_ = vm.contains("force");
85
86 strip_path(password_file_);
87 strip_path(output_directory_);
88 for (auto& input : input_list_) {
89 strip_path(input);
90 }
91 } catch (const std::exception& err) {
92 std::cerr << "Invalid input argument. Error: " << err.what();
93 show_help_ = true;
94 }
95}
96
97void ProgramArgument::ShowHelp() {
98 std::cout << std::endl;

Callers 2

TESTFunction · 0.45
mainFunction · 0.45

Calls 5

strip_pathFunction · 0.85
emptyMethod · 0.80
optionsMethod · 0.45
runMethod · 0.45
containsMethod · 0.45

Tested by 1

TESTFunction · 0.36