filecomplete/main.cpp

41 lines
860 B
C++
Raw Normal View History

#include "filecomplete.h"
#include <iostream>
#include <string>
#include <thread>
static int cnt = 500;
// 测试光标位置
void delay_auto_show()
{
while (--cnt) {
std::this_thread::sleep_for(std::chrono::seconds(1));
std::cout << "IMCOMMING..............." << std::endl;
}
}
int main(int argc, char** argv)
{
std::cout << "PreContent1 " << std::endl;
std::cout << "PreContent2 " << std::endl;
fc_append('|');
fc_set_header("测试$:");
// std::thread t(delay_auto_show);
while (1) {
char* content = fc_readline();
if (content) {
std::string cmd_input(content);
fc_free(content);
std::cout << "" << std::endl;
std::cout << cmd_input << std::endl;
}
else {
break;
}
}
// t.join();
return 0;
}