We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 88c9683 commit 4de5a85Copy full SHA for 4de5a85
1 file changed
cli/main.cpp
@@ -1,12 +1,27 @@
1
+#include <cstring>
2
#include <iostream>
3
+#include <string_view>
4
#include <utility>
5
6
#include "perf_event.hpp"
7
8
using namespace cpuscope;
9
-int main(int /*argc*/, char** /*argv[]*/)
10
+static constexpr std::string_view VERSION = "0.1.0";
11
+
12
+int main(int argc, char** argv)
13
{
14
+ // Simplified parsing of command-line arguments for demonstration purposes
15
+ // Later add a cli lib like CLI11 or cxxopts for more robust argument parsing
16
+ for (int i = 1; i < argc; ++i)
17
+ {
18
+ if (std::strcmp(argv[i], "--version") == 0)
19
20
+ std::cout << "cpu_scope version " << VERSION << '\n';
21
+ return 0;
22
+ }
23
24
25
PerfEvent::LinuxSysCalls sysCalls;
26
PerfEvent::Config config;
27
config.scope = PerfEvent::Scope::CPU;
0 commit comments