aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/uhd_image_loader.cpp
diff options
context:
space:
mode:
authorAlex Williams <alex.williams@ni.com>2019-02-13 14:01:49 -0800
committerBrent Stapleton <brent.stapleton@ettus.com>2019-02-13 15:57:38 -0800
commit93e7a22ae6743d7ddc0531045da4faef0350eb8f (patch)
treed2f2591521bc8c1dc6ca97886516edb645484ec1 /host/utils/uhd_image_loader.cpp
parent97e772bdc1381b3ae01e9f07fa355b4f85a209e9 (diff)
downloaduhd-93e7a22ae6743d7ddc0531045da4faef0350eb8f.tar.gz
uhd-93e7a22ae6743d7ddc0531045da4faef0350eb8f.tar.bz2
uhd-93e7a22ae6743d7ddc0531045da4faef0350eb8f.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/utils/uhd_image_loader.cpp')
-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