We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4de5a85 commit 91528beCopy full SHA for 91528be
1 file changed
cli/main.cpp
@@ -1,5 +1,6 @@
1
#include <cstring>
2
#include <iostream>
3
+#include <span>
4
#include <string_view>
5
#include <utility>
6
@@ -13,9 +14,12 @@ int main(int argc, char** argv)
13
14
{
15
// Simplified parsing of command-line arguments for demonstration purposes
16
// Later add a cli lib like CLI11 or cxxopts for more robust argument parsing
- for (int i = 1; i < argc; ++i)
17
+
18
+ std::span args{argv, static_cast<size_t>(argc)};
19
20
+ for (auto arg : args)
21
- if (std::strcmp(argv[i], "--version") == 0)
22
+ if (std::strcmp(arg, "--version") == 0)
23
24
std::cout << "cpu_scope version " << VERSION << '\n';
25
return 0;
0 commit comments