Closed eolivi-fy closed 1 week ago
Hi first of all, thank you for this good library!
I'd like to be able to print the command run:
> ./MyBinary --input file.txt --num 4 --log debug Command run was: "./MyBinary --input file.txt --num 4 --log debug" ...
Of course I could simply call:
for (int i = 0; i < argc; i++) std::cout << argv[i] << " "; // just before app.parse(argc, argv);
But I feel there could be a way using a callback ?
This does it almost:
app.parse_complete_callback([&app](){ std::cout << "Command run:\n" << app.config_to_str()) << std::endl; }
Command run: log="debug" input="file.txt" num=4
maybe there is another way ?
I don't think a way was built to regenerate the command line directly inside CLI11.
Thanks, good enough then with app.config_to_str()
app.config_to_str()
Feel free to close
Hi first of all, thank you for this good library!
I'd like to be able to print the command run:
Of course I could simply call:
But I feel there could be a way using a callback ?
This does it almost:
maybe there is another way ?