| 681 | } |
| 682 | |
| 683 | static std::string create_command(const string_map& args) |
| 684 | { |
| 685 | std::stringstream ss; |
| 686 | ss << args.at("__exe__").front(); |
| 687 | if(args.count("") > 0) |
| 688 | { |
| 689 | for(auto&& arg : args.at("")) |
| 690 | ss << " \"" << arg << "\""; |
| 691 | } |
| 692 | for(auto&& p : args) |
| 693 | { |
| 694 | if(p.first == "__exe__") |
| 695 | continue; |
| 696 | if(p.first.empty()) |
| 697 | continue; |
| 698 | ss << " " << p.first; |
| 699 | for(auto&& arg : p.second) |
| 700 | ss << " \"" << arg << "\""; |
| 701 | } |
| 702 | return ss.str(); |
| 703 | } |
| 704 | |
| 705 | static std::string fork(const std::string& name, string_map args) |
| 706 | { |