This repository was archived by the owner on Sep 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +4
-33
lines changed
Expand file tree Collapse file tree 3 files changed +4
-33
lines changed Original file line number Diff line number Diff line change 3636* Doxygen
3737* Graphviz
3838
39+ ## Documentation
40+
41+ See the [ documentation] ( https://tanmaypatil105.github.io/procfetch/ )
42+
3943## Installation
4044
4145```
Original file line number Diff line number Diff line change @@ -60,8 +60,6 @@ void print();
6060
6161string getColor (string);
6262
63- string exec (string command);
64-
6563void test_util ();
6664
6765/* *
Original file line number Diff line number Diff line change 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-
11586static 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 */
161131void test_util ()
162132{
163- test_exec ();
164133 test_Path ();
165134 test_Command ();
166135}
You can’t perform that action at this time.
0 commit comments