Last active
October 19, 2021 22:50
-
-
Save mostsignificant/a0fd6730724c196853c937bfd94410e3 to your computer and use it in GitHub Desktop.
blog-get-option
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| std::string_view get_option( | |
| const std::vector<std::string_view>& args, | |
| const std::string_view& option_name) { | |
| for (auto it = args.begin(), end = args.end(); it != end; ++it) { | |
| if (*it == option_name) | |
| if (it + 1 != end) | |
| return *(it + 1); | |
| } | |
| return ""; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment