From 93e7a22ae6743d7ddc0531045da4faef0350eb8f Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Wed, 13 Feb 2019 14:01:49 -0800 Subject: utils: Deny positional options in uhd_image_loader This change prevents invalid positional options from being accepted into uhd_image_loader. Previously, if a user forgot to specify the option type, uhd_image_loader would proceed and look like it succeeded, but the intended image may not have been loaded. --- host/utils/uhd_image_loader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'host/utils/uhd_image_loader.cpp') diff --git a/host/utils/uhd_image_loader.cpp b/host/utils/uhd_image_loader.cpp index 57ad57958..87dc22b5c 100644 --- a/host/utils/uhd_image_loader.cpp +++ b/host/utils/uhd_image_loader.cpp @@ -63,7 +63,9 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) // clang-format on po::variables_map vm; - po::store(po::parse_command_line(argc, argv, desc), vm); + po::positional_options_description pos_desc; + po::store( + po::command_line_parser(argc, argv).options(desc).positional(pos_desc).run(), vm); po::notify(vm); // Help message -- cgit v1.2.3