shellwords-cpp is a library designed to manipulate strings according to the word parsing rules of the UNIX Bourne shell.
See IEEE Std 1003.1-2008, 2016 Edition, the Shell & Utilities volume for more details.
It is a port of the Shellwords Ruby module.
// std::vector<std::string> shellsplit(const std::string& command);
shellsplit("ps -p 1234"); // ["ps", "-p", "1234"]
// std::string shelljoin(const std::vector<std::string>& values);
shelljoin({"ps", "-p", "1234"}); // "ps -p 1234"
This tool is released under the terms of the MIT License. See the LICENSE.txt file for more details.