Interactive config shell (config DSL)

O

Oliver Schad

Hi,

I want to build an interactive config shell. Maybe somebody knows such
cli config environments on routers or switches with auto completion and
help for the context.

On a switch it's maybe like:

config> interface gigaethernet 0/23
config-if> no shutdown
config-if> switchport
config-if> exit
config>

As you see you can enter a context, what you don't see is, that you get
a context sensitive help whenever you type a questionmark and that you
have auto completion for every command on tab.

It's a DSL, of course.

So the basic problem is a good strategy for (automatic) mapping config
words to objects and methods. My first idea was to write an interface
command object and a common cli based on readline or rawline without
commands where I can plug-in as many commands as I want in as many
subcontextes as I want.

So I could reduce the problem to one context, which has a description
method, which knows his arguments types and possible values and has a
link to deeper contextes.

My only problem is that I've never worked with ruby introspection (if
you have a command object, you have to know it's name, methods and named
arguments, including types and maybe ranges of values).

I have to try it that way if you don't have a better idea or if you
don't know a library which supports generating such languages and a
comfortable mapping to objects and methods.

Any suggestions? Do you see a general problem with my approach?

Regards
Oli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top