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

WIP: Enhance Klish parser #72

Closed
wants to merge 3 commits into from

Conversation

kwangsuk
Copy link
Contributor

@kwangsuk kwangsuk commented Nov 5, 2020

NOTE: this PR has build dependency -
sonic-net/sonic-buildimage#5920.

Klish enhancements for sonic-mgmt-framework to improve usability

  1. New PTYPE attribute support - ext_pattern and ext_help with regexp_select method
    Similar to the pattern attribute with select method in Opensource Klish, the ext_pattern with regexp_select can be used for auto completion.
    e.g.
<PTYPE
name="PHY_INTERFACE"
method="regexp_select"
ext_pattern="Ethernet(port)"
pattern="&ETH_ALL_INTF;"
help="" />

An interface name can be specified as “interface Ethernet 1” or “interface Eth1”.

sonic-cli(config)# interface Eth1
sonic-cli(conf-if-Ethernet1)#

Another usacase is that, if multiple options in the same PTYPE are defined to support all possible interface options, the ext_help can be used along with ext_help attributes to provide multiple help string for corresponding options.
e.g.

<PTYPE
name="ALL_INTERFACE"
method="regexp_select"
ext_pattern="Ethernet(Port) PortChannel(1-128) Vlan(1-4093) Loopback(0..16383)"
ext_help="(Ethernet interface type) (PortChannel interface type) (Vlan interface type) (Loopback interface type)"
pattern="&ETH_ALL_INTF;|&VLAN_ALL_INTF;|&PO_ALL_INTF;|&LOOPB_INTF;"
help="Interface Type - Ranges"
/>
  1. idle session timeout - CLI session timeout set to 10 minute (600s) to close the session once expired
  2. Interrupt handler to abort the execution of current command
  3. Allow param value with special characters, e.g. “#?\sonic&”
  4. Quoted sting support , e.g. sonic-cli(conf-if-Ethernet1)# description “Azure leaf-Updating the rules file permissions that appears to be stripped #1 NY-datacenter”
  5. hidden command support in klish parser
  6. Patching hook log syslog message to audit command execution through CLI
  7. Add Pylint support
  8. Fix pipe command
  9. Miscellaneous bug fixes - subcommands or param while pressing tab etc.

@kwangsuk kwangsuk closed this Dec 4, 2020
@kwangsuk kwangsuk deleted the klish_enhancement branch December 8, 2020 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant