-2

I'm developing a little utility on c++ in Linux which analyzing big scope of data and return some information about it. You can write some command to interactive command line an it return appropriate data.

First I had only few simple one-word commands. But over time list of commands had grown and some commands acquired params so now I have to look for exactly command spelling in documentation.

So I want to write some advanced command line processor like bash, with auto completing and showing list of possibilities by tab.

Is there any c++ library which can help me in this task?

  • Gnu [getopt](http://www.gnu.org/software/libc/manual/html_node/Getopt.html) might be the way to go. If you can use boost `program_options` is another option. – Paul Rooney Apr 08 '15 at 07:10
  • You can extend the `bash` autocomplete with your own autocompletion. http://ifacethoughts.net/2009/04/06/extending-bash-auto-completion/ – Mats Petersson Apr 08 '15 at 07:42
  • Thanks for you answers, but in isn't that I need. I want to implement my own command line like sql clients does. The utility hold in memory large amount of data and return some reports by command that enter inside it. I want command line inside my program. – user2783280 Apr 08 '15 at 07:49

1 Answers1

0

Consider using Readline Library.

You can start from this simple example - How to use C programming language creating a shell that can implement history capture up arrow?

Then read this post at byexamples.com

Community
  • 1
  • 1
VolAnd
  • 6,367
  • 3
  • 25
  • 43