Skip to content

Commit 91528be

Browse files
Fix lint issue
1 parent 4de5a85 commit 91528be

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cli/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <cstring>
22
#include <iostream>
3+
#include <span>
34
#include <string_view>
45
#include <utility>
56

@@ -13,9 +14,12 @@ int main(int argc, char** argv)
1314
{
1415
// Simplified parsing of command-line arguments for demonstration purposes
1516
// Later add a cli lib like CLI11 or cxxopts for more robust argument parsing
16-
for (int i = 1; i < argc; ++i)
17+
18+
std::span args{argv, static_cast<size_t>(argc)};
19+
20+
for (auto arg : args)
1721
{
18-
if (std::strcmp(argv[i], "--version") == 0)
22+
if (std::strcmp(arg, "--version") == 0)
1923
{
2024
std::cout << "cpu_scope version " << VERSION << '\n';
2125
return 0;

0 commit comments

Comments
 (0)