Returns false if not a short option. Otherwise, sets opt name and rest and returns true
| 1842 | |
| 1843 | // Returns false if not a short option. Otherwise, sets opt name and rest and returns true |
| 1844 | inline bool split_short(const std::string ¤t, std::string &name, std::string &rest) { |
| 1845 | if (current.size() > 1 && current[0] == '-' && valid_first_char(current[1])) { |
| 1846 | name = current.substr(1, 1); |
| 1847 | rest = current.substr(2); |
| 1848 | return true; |
| 1849 | } |
| 1850 | return false; |
| 1851 | } |
| 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) { |
no test coverage detected