summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-05-11 20:56:23 -0700
committerJosh Blum <josh@joshknows.com>2012-05-11 20:56:23 -0700
commit141c8ebae4072f65ad929b568cee1cf7247c4751 (patch)
treeac828f9985901ed3aed72d10e2c6ce9d84fd1aef /host
parent4f19f3f4ece412cb3e3162ef5ebced4f99da0dd7 (diff)
downloaduhd-141c8ebae4072f65ad929b568cee1cf7247c4751.tar.gz
uhd-141c8ebae4072f65ad929b568cee1cf7247c4751.tar.bz2
uhd-141c8ebae4072f65ad929b568cee1cf7247c4751.zip
usrp2: burner print, escapes and quotes for cross-platform
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/usrp2/usrp2_iface.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp
index 50808208f..01890ba91 100644
--- a/host/lib/usrp/usrp2/usrp2_iface.cpp
+++ b/host/lib/usrp/usrp2/usrp2_iface.cpp
@@ -391,15 +391,22 @@ public:
sudo = "sudo";
#endif
+ //escape char for multi-line cmd + newline + indent?
+ #ifdef UHD_PLATFORM_WIN32
+ const std::string ml = "^\n ";
+ #else
+ const std::string ml = "\\\n ";
+ #endif
+
//create the burner command
if (this->get_rev() == USRP2_REV3 or this->get_rev() == USRP2_REV4){
const std::string card_burner = (fs::path(fw_image_path).branch_path().branch_path() / "utils" / "usrp2_card_burner_gui.py").string();
- return str(boost::format("Please run: %s %s \\\n\t--fpga=%s \\\n\t--fw=%s") % sudo % card_burner % fpga_image_path % fw_image_path);
+ return str(boost::format("Please run:\n%s \"%s\" %s--fpga=\"%s\" %s--fw=\"%s\"") % sudo % card_burner % ml % fpga_image_path % ml % fw_image_path);
}
else{
const std::string addr = _ctrl_transport->get_recv_addr();
const std::string net_burner = (fs::path(fw_image_path).branch_path().branch_path() / "utils" / "usrp_n2xx_net_burner_gui.py").string();
- return str(boost::format("Please run: %s \\\n\t--fpga=%s \\\n\t--fw=%s \\\n\t--addr=%s") % net_burner % fpga_image_path % fw_image_path % addr);
+ return str(boost::format("Please run:\n\"%s\" %s--fpga=\"%s\" %s--fw=\"%s\" %s--addr=\"%s\"") % net_burner % ml % fpga_image_path % ml % fw_image_path % ml % addr);
}
}