aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorAlex Williams <alex.williams@ni.com>2019-02-13 14:01:49 -0800
committermichael-west <michael.west@ettus.com>2019-02-18 10:53:53 -0800
commitb81b4aaeaf3187ffcc69513f83ef9651b8e27b18 (patch)
treed2f2591521bc8c1dc6ca97886516edb645484ec1 /host
parent97e772bdc1381b3ae01e9f07fa355b4f85a209e9 (diff)
downloaduhd-b81b4aaeaf3187ffcc69513f83ef9651b8e27b18.tar.gz
uhd-b81b4aaeaf3187ffcc69513f83ef9651b8e27b18.tar.bz2
uhd-b81b4aaeaf3187ffcc69513f83ef9651b8e27b18.zip
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.
Diffstat (limited to 'host')
-rw-r--r--host/utils/uhd_image_loader.cpp4
1 files changed, 3 insertions, 1 deletions
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