readme minor missing content #22

This commit is contained in:
Arun M 2019-01-03 22:06:20 +05:30
parent d74481c564
commit e6cb89cb6e
2 changed files with 12 additions and 1 deletions

View File

@ -48,7 +48,7 @@ std::cout << "Data len: " << obuf.length << std::endl;
More detailed way:
```cpp
auto p = Popen({"ls", "-l"});
auto p = Popen({"ls", "-l"}, output{PIPE});
auto obuf = p.communicate().first;
std::cout << "Data : " << obuf.buf.data() << std::endl;
std::cout << "Data len: " << obuf.length << std::endl;

View File

@ -64,7 +64,16 @@ void test_read_all()
std::cout<<"read_all() succeeded"<<std::endl;
}
void test_simple_cmd()
{
auto p = Popen({"ls", "-l"}, output{PIPE});
auto obuf = p.communicate().first;
std::cout << "Data : " << obuf.buf.data() << std::endl;
std::cout << "Data len: " << obuf.length << std::endl;
}
int main() {
/*
test_exename();
test_input();
test_piping();
@ -72,5 +81,7 @@ int main() {
test_shell();
test_sleep();
test_read_all();
*/
test_simple_cmd();
return 0;
}