Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 9237c5f

Browse files
Merge branch 'main' of github.com:TanmayPatil105/procfetch into main
2 parents 902fcc3 + 9f873bf commit 9237c5f

File tree

3 files changed

+4
-33
lines changed

3 files changed

+4
-33
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
* Doxygen
3737
* Graphviz
3838

39+
## Documentation
40+
41+
See the [documentation](https://tanmaypatil105.github.io/procfetch/)
42+
3943
## Installation
4044

4145
```

src/fetch.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ void print();
6060

6161
string getColor(string);
6262

63-
string exec(string command);
64-
6563
void test_util();
6664

6765
/**

src/util.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,6 @@
44
#include "color.h"
55
#include "fetch.h"
66

7-
/**
8-
* @returns
9-
* @param command
10-
*/
11-
string exec(string command)
12-
{
13-
char buffer[128];
14-
string result = "";
15-
FILE *pipe = popen(command.c_str(), "r");
16-
if (!pipe)
17-
{
18-
throw runtime_error("popen failed: \"" + command + "\"");
19-
}
20-
while (!feof(pipe))
21-
{
22-
if (fgets(buffer, 128, pipe) != NULL)
23-
result += buffer;
24-
}
25-
26-
pclose(pipe);
27-
return result;
28-
}
29-
307
/**
318
* @returns
329
* @param line
@@ -106,12 +83,6 @@ string getColor(string line)
10683
return color;
10784
}
10885

109-
static void test_exec()
110-
{
111-
string result = exec("echo \"hello, world\""s);
112-
expect("hello, world\n"s, result, "exec() returns"s);
113-
}
114-
11586
static void test_Command()
11687
{
11788
Command c = Command::exec("ls Makefile"s);
@@ -154,13 +125,11 @@ static void test_Path()
154125

155126
/**
156127
* Tests belows.
157-
* * function exec()
158128
* * class Path
159129
* * class Command
160130
*/
161131
void test_util()
162132
{
163-
test_exec();
164133
test_Path();
165134
test_Command();
166135
}

0 commit comments

Comments
 (0)