I need to write a command line interface that can be invoked either directly from the shell (command sub-command arguments), or as a shell that can process sub-commands.
i want to use bash auto completion for both scenarios.
example: lets say my CLI module is called 'mycli' and there are 3 sub commands: add, list, delete.
for the first type of usage, one would write from the prompt:
ubuntu@ubuntu:/$mycli add -name myname
for the second type of usage, one would do the following:
i know how to create a bash autocomplete for the first example. but don't know how to create a shell-like prompt that will use bash auto complete for sub command processing.
unfortunately, although the readline library would probably work, it's license mandates that any software using it will be free. and the product i'm developing isn't, so i probably can't use it.