Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about cligen supporting command line scope/level #56

Open
mgimza opened this issue Nov 24, 2020 · 3 comments
Open

Question about cligen supporting command line scope/level #56

mgimza opened this issue Nov 24, 2020 · 3 comments
Labels

Comments

@mgimza
Copy link

mgimza commented Nov 24, 2020

When a user provides a valid incomplete command, is it possible for cligen to put the user into the scope/level of the syntax structure of that command rather than returning the "Unkown command" error message ?

For example, given the following syntax....
aa {
bb;
cc;
dd {
ee;
}
}

The user types the command : "aa\n" . Cligen would then not return "Unknown Command", but allows the user to perform the commands defined inside the "aa" block at the next prompt. The prompt could contain the current scope/level of the command.

cli>aa
cli(aa)>dd
cli(aa/dd)>ee

Thanks,
Marek Gimza

@olofhagsand
Copy link
Member

olofhagsand commented Nov 30, 2020

The building-blocks for this behavior exists, but is only partly made in cligen-only context. See "tree workpoints" in Section 2.7.2 in the cligen-tutorial.

See also the yang-based solution made in clixon, such as in https://clixon-docs.readthedocs.io/en/latest/cli.html#the-auto-cli
where the syntax is made on a YANG specification.

@olofhagsand
Copy link
Member

@mgimza
Copy link
Author

mgimza commented Dec 1, 2020

Thanks Olofhagsand ... my apologies for not replying sooner. I have taken a look and will give your proposal a try :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants