26 #ifndef O2SCL_CLI_READLINE_H 27 #define O2SCL_CLI_READLINE_H 29 #include <readline/readline.h> 30 #include <readline/history.h> 32 #include <o2scl/cli.h> 34 #ifndef DOXYGEN_NO_O2NS 60 cli_readline(std::string fname=
"",
size_t max_size=100) {
65 if (histfile.size()>0) {
66 read_history(histfile.c_str());
71 if (histfile.size()>0) {
72 stifle_history(((
int)msize));
73 write_history(histfile.c_str());
81 if (histfile.size()>0) {
82 read_history(histfile.c_str());
100 line_read=readline(c);
104 if (line_read && *line_read && histfile.size()>0) {
105 add_history(line_read);
115 #ifndef DOXYGEN_NO_O2NS An extension to o2scl::cli which uses readline.
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
Configurable command-line interface.
std::string histfile
String containing filename.
char * line_read
Buffer for readline.
virtual char * cli_gets(const char *c)
Function to get a string from the user.
size_t msize
Maximum history file size.
void set_histfile(std::string fname)
Set history file.