File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- kryptinfo : kryptinfo.c
2- clang -Wall -o kryptinfo kryptinfo.c
1+ CXX = clang++
2+ CXXFLAGS = -Wall -O2
3+
4+ kryptinfo : kryptinfo.cpp
5+ $(CXX ) $(CXXFLAGS ) -o $@ $^
6+
7+ clean :
8+ rm -f kryptinfo
9+
Original file line number Diff line number Diff line change 11# Maintainer: Itsuki Wada <175463719+Itsuki0222@users.noreply.github.com>
22
33pkgname=kryptinfo
4- pkgver=20240820
4+ pkgver=20250217
55pkgrel=1
66pkgdesc=' Easily Check System Information'
77arch=(' x86_64' )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #include < iostream>
2+ #include < string>
3+ #include < unordered_map>
4+ #include < cstdlib>
5+
6+ void executeCommand (const std::string& command) {
7+ int result = std::system (command.c_str ());
8+ if (result != 0 ) {
9+ std::cerr << " Failed to execute the command: " << command << std::endl;
10+ }
11+ }
12+
13+ void displayMenu () {
14+ std::cout << " \n\n\n\t ==== System info ====" << std::endl;
15+ std::cout << " \t 1: dmesg as superuser" << std::endl;
16+ std::cout << " \t 2: lsb_release -a" << std::endl;
17+ std::cout << " \t 3: lspci" << std::endl;
18+ std::cout << " \t 4: uname -a" << std::endl;
19+ std::cout << " \t 5: fastfetch" << std::endl;
20+ std::cout << " \t 0: exit" << std::endl;
21+ std::cout << " \t =====================" << std::endl;
22+ }
23+
24+ int main () {
25+ std::unordered_map<std::string, std::string> commands = {
26+ {" 1" , " sudo dmesg" },
27+ {" 2" , " lsb_release -a" },
28+ {" 3" , " lspci" },
29+ {" 4" , " uname -a" },
30+ {" 5" , " fastfetch" }
31+ };
32+
33+ std::string choice;
34+
35+ do {
36+ displayMenu ();
37+ std::cout << " > " ;
38+ std::cin >> choice;
39+
40+ if (choice == " 0" ) {
41+ std::cout << " \n exit the program." << std::endl;
42+ break ;
43+ }
44+
45+ if (commands.find (choice) != commands.end ()) {
46+ executeCommand (commands[choice]);
47+ } else {
48+ std::cout << " \n It is an invalid option. Please specify 1~5 or 0.\n " ;
49+ }
50+
51+ } while (true );
52+
53+ return 0 ;
54+ }
You can’t perform that action at this time.
0 commit comments