clicon/clixon

clixon autocli view

Closed this issue · 8 comments

Hello Team,

After using autocli in Clixon, the keywords in all views are "set", "edit", "show", etc,
Can Clixon implement view mode?
eg:
"edit interface" is entered, the keywords for the current view become "ipv4", "IPv6", "route", and
"edit l2" is entered, the keywords for the current view become "vlan", "port", etc.

@olofhagsand could you look at my request if possible?

edit mode:
rain@rain-server /> edit table
rain@rain-server table> set parameter xx

view mode:
I hope to use other keywords to configure commands instead of always using 'set',ignore 'set'.
eg:
rain@rain-server table> parameter xx
rain@rain-server table> keyword xxx

Still not clear. I understand you want to skip the "verb" (set/show/delete) in a specialized mode.
Does it only apply to showing the configuration, or does it also apply for modifying?
Showing:

> view table
table> parameter xxx
<parameter>
  <name>xxx</name>
  ...
  

yes, i want to skip the "verb" (set). i want to apply for setting and modifying.

In my example above, the verb "show" is implicit. How would you do it for "set" or "delete"? How do you specify the implicit verb "set" instead of implicit verb "set"?
Is this view-mode present in other products BTW?

Just hide the verb 'set, and we can still use verb 'delete' to delete it.

I have discovered a method, which is to directly use "@datamodel, cli_ auto set ();" in example_cli.cli.
but I'm not sure if it will cause other issues.

container table{
	list parameter{
		key name;
		leaf name{
			type string;
		}
		leaf value{
			type string;
		}
		leaf index {
			type string;
		}
	}
}
For this container, I have to split it into two commands to configure value and index. 
> set  table parameter xxx value 50
> set  table parameter xxx index 50

How can I design it to be configured with one command? I have seen on other platforms that support configuring multiple leafs  with a single command.
> set  table parameter xxx value 50 index 50

@olofhagsand Is there a way to achieve it?