Returns false if not a long option. Otherwise, sets opt name and other side of = and returns true
| 1852 | |
| 1853 | // Returns false if not a long option. Otherwise, sets opt name and other side of = and returns true |
| 1854 | inline bool split_long(const std::string ¤t, std::string &name, std::string &value) { |
| 1855 | if (current.size() > 2 && current.substr(0, 2) == "--" && valid_first_char(current[2])) { |
| 1856 | auto loc = current.find_first_of('='); |
| 1857 | if (loc != std::string::npos) { |
| 1858 | name = current.substr(2, loc - 2); |
| 1859 | value = current.substr(loc + 1); |
| 1860 | } else { |
| 1861 | name = current.substr(2); |
| 1862 | value = ""; |
| 1863 | } |
| 1864 | return true; |
| 1865 | } |
| 1866 | return false; |
| 1867 | } |
| 1868 | |
| 1869 | // Returns false if not a windows style option. Otherwise, sets opt name and value and returns true |
| 1870 | inline bool split_windows_style(const std::string ¤t, std::string &name, std::string &value) { |
no test coverage detected