Commit 21ee17de authored by Martin Kröning's avatar Martin Kröning

Fix program path in help

parent dc0043dc
......@@ -13,6 +13,6 @@ pi2_demo_src = files(
boost_po_dep = dependency('boost', modules : ['program_options'])
executable('pi2-demo', pi2_demo_src,
include_directories: pi2_demo_inc,
dependencies: [pi2_view_dep, boost_po_dep],
dependencies: [pi2_view_dep, boost_po_dep, microsoft_gsl_dep],
install: true
)
......@@ -2,6 +2,8 @@
#include <boost/program_options.hpp>
#include <chrono>
#include <fstream>
#include <gsl/span>
#include <gsl/string_span>
#include <iostream>
#include <ratio>
#include <string>
......@@ -9,6 +11,8 @@
namespace po = boost::program_options;
int main(int argc, char *argv[]) {
auto args = gsl::make_span(argv, argc);
try {
std::string durationString;
double timescale;
......@@ -45,10 +49,11 @@ int main(int argc, char *argv[]) {
po::notify(variablesMap);
if (variablesMap.count("help") > 0) {
std::cout
<< "Usage: ./pi2-demo/pi2-demo [OPTION]... [FILE]\n"
"Parses and simulates FILE according to the PI-2 of the RWTH.\n\n"
<< visibleOptions << std::endl;
std::cout << "Usage: " + std::string(args.at(0)) +
" [OPTION]... [FILE]\n"
"Parses and simulates FILE according to the PI-2 of the "
"RWTH.\n\n"
<< visibleOptions << std::endl;
return 1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment