由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - Questions about C++ Linux Command Line Parsing
相关主题
问个题外话,用visual studio编的程序, 移植到linux上郁闷
C++/Linux: make clean能够去除seg fault:什么原理?求教Code
python urlopen(), how to go back to the beginning after readlines()java 里可以插入linux command吗? (转载)
parsing file in node: js or python ?how to count the times a function is used
Questions about MAKEFILEc++ 中如何把str转换为float?
A question about Makefilehelp on string parse
什么是Linux 上最好的C programming environment?请教一个初级问题
Questions about arrow key in linux command promptC++怎样从文件读入分数?
相关话题的讨论汇总
话题: command话题: linux话题: line话题: parsing话题: arrow
进入Programming版参与讨论
1 (共1页)
l********s
发帖数: 358
1
有个Linux下的project,我正在写command line parser。project的名字叫exec,那我
运行./exec后进入interactive mode. 我就可以输入如下的命令来运行各个task.
exec0001> read a.in
exec0002> write a.out
exec0003> quit
Parsing command line比较简单,我只要split into token,在调用getopt来parse。
我遇到的问题是我不能想shell一样输入<-(left arrow), ->(righ arrow)在command
line里面左右移动,也不能按Up arrow, Down arrow在之前和之后的command history里查
找,也不能按Tab来实现auto-complete,如果按arrow显示的是^[[A之类的乱码。
我需要添加些什么才能实现这些功能,有什么source code可供我参考吗?或者有什么
现成的library我可以使用? 我也用一个Berkeley的Linux下类似的程序,但它可以实现
这些功能,我进到
t****t
发帖数: 6806
2
有个库叫readline

command
history里查

【在 l********s 的大作中提到】
: 有个Linux下的project,我正在写command line parser。project的名字叫exec,那我
: 运行./exec后进入interactive mode. 我就可以输入如下的命令来运行各个task.
: exec0001> read a.in
: exec0002> write a.out
: exec0003> quit
: Parsing command line比较简单,我只要split into token,在调用getopt来parse。
: 我遇到的问题是我不能想shell一样输入<-(left arrow), ->(righ arrow)在command
: line里面左右移动,也不能按Up arrow, Down arrow在之前和之后的command history里查
: 找,也不能按Tab来实现auto-complete,如果按arrow显示的是^[[A之类的乱码。
: 我需要添加些什么才能实现这些功能,有什么source code可供我参考吗?或者有什么

l********s
发帖数: 358
3
Thanks a lot. I'll go to check it.
h***i
发帖数: 1970
4
试试直接用ledit run你的程序

【在 l********s 的大作中提到】
: Thanks a lot. I'll go to check it.
l********s
发帖数: 358
5
For ppl who also want to use readline library, remember to include "readline
" and "ncurses" library in the Makefile.
1 (共1页)
进入Programming版参与讨论
相关主题
C++怎样从文件读入分数?Questions about MAKEFILE
C++多线程和硬件的关系A question about Makefile
问个html和c++编程的问题什么是Linux 上最好的C programming environment?
C++中parse string的问题Questions about arrow key in linux command prompt
问个题外话,用visual studio编的程序, 移植到linux上郁闷
C++/Linux: make clean能够去除seg fault:什么原理?求教Code
python urlopen(), how to go back to the beginning after readlines()java 里可以插入linux command吗? (转载)
parsing file in node: js or python ?how to count the times a function is used
相关话题的讨论汇总
话题: command话题: linux话题: line话题: parsing话题: arrow