command tree behaves differently if a dummy space is entered

22 views
Skip to first unread message

Roland Chang

unread,
Nov 18, 2020, 5:56:18 PM11/18/20
to klish
Hi Serj,
Thanks for been responsive always.
I face an issue here and trying to fix it but seems not locating root cause in klish context.
I searched around the group conversation  and did not see similar question either.
While inputing command line, with "?" key it lists all current command nodes that can be used with help message. With "space" key, it list all options as well.
However, when an extra (or more) spaces is entered, it is not listing command nodes as expected.
Taking show command as an example,
show [space]
   aaa acl bfd ......
show [space] [space]
    //nothing
Another example is:
configure terminal
   interface [?] // or [space]
       CPU ethernet loopback management vlan
   interface [space][space]
        ethernet vlan  // only two options are shown    

One thing I noticed is that. while constructing command tree under a view, 
if I have this case(1):
 <COMMAND name="xxx">
    <PARAM name="x1"/>
    <PARAM name="x2"/>
</COMMAND>
--------------versus---------
//case(2)
<COMMAND name="xxx x1"> </COMMAND>
<COMMAND name="xxx x2"> </COMMAND>

Case1 seems showing correctly even if I have dummy spaces are entered
but Case2 is not.

Is this the issue from the xmlparser itself that I should look into or is there additional handlings within klish context that I should dig into ?

Kindly advised
Thanks
Roland

Serj Kalichev

unread,
Nov 20, 2020, 5:53:47 AM11/20/20
to kl...@googlegroups.com
Hi
The "space" is not right button for your purpose.
Use "?" - for help
Use "Tab" - for possible completion.

Recent version of klish doesn't check all parameters before "enter" (as older versions do). It allows to user to enter anything he likes.
So I don't understand why klish prints completions on "space". I will find it out when I have a time for it. But it's not critical I think.

19.11.2020 01:56, Roland Chang пишет:
--
You received this message because you are subscribed to the Google Groups "klish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klish+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/klish/c336f54b-e158-425d-a72f-60ac03e8d133n%40googlegroups.com.


Ingo Albrecht

unread,
Nov 20, 2020, 7:12:48 AM11/20/20
to kl...@googlegroups.com
On 11/20/20 11:53 AM, Serj Kalichev wrote:
> Hi
> The "space" is not right button for your purpose.
> Use "?" - for help
> Use "Tab" - for possible completion.
>
> Recent version of klish doesn't check all parameters before "enter" (as
> older versions do). It allows to user to enter anything he likes.
> So I don't understand why klish prints completions on "space". I will
> find it out when I have a time for it. But it's not critical I think.

This sounds like the token completion is acting on an empty token after
encountering a space to separate tokens.

There seems to be something funny going on - some sort of bug.

When I enter [space] on an ambiguous token then completions are
displayed and the longest common prefix is inserted, but then clish also
emits a space. It should not do that.

I've tried this on a patched branch, but I don't think my changes are
causing this. But maybe my earlier fixes/patches did? I remember seeing
this working correctly, but I'm not sure on what shell exactly.

Greetings
prom
Reply all
Reply to author
Forward
0 new messages