I am creating a simple logging program. When a user enters log some_file
into the console, the program currently simply receives some basic input from cin
, and records it into some_file
.
However, instead of implementing my own editor with cin
, I'd like to open the Nano editor and let the user edit his message there.
Then, when the message is complete, I'd like my C++ logger to receive it as a string and carry on.
This is exactly what git does on commits.
How can I achieve this?
(Preferably without using tools such as expect, just raw C++ code.)