You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
428 B
25 lines
428 B
9 years ago
|
#include <iostream>
|
||
|
#include "linenoise.hpp"
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main(void)
|
||
|
{
|
||
|
while (true) {
|
||
|
// テキスト入力
|
||
|
auto line = linenoise::Readline("> ");
|
||
|
|
||
|
// 空行ならスキップ
|
||
|
if (line.empty()) {
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
// 入力テキストをそのまま出力
|
||
|
cout << "echo: '" << line << "'" << endl;
|
||
|
|
||
|
// 履歴に追加
|
||
|
linenoise::AddHistory(line.c_str());
|
||
|
}
|
||
|
return 0;
|
||
|
}
|