klish command completion on pressing tab button

前端 未结 1 1817
庸人自扰
庸人自扰 2021-01-24 05:03

Hi I have small doubt in klish xml file. I implemented a small xml file for klish



        
相关标签:
1条回答
  • 2021-01-24 05:40

    We can not use space in the < COMMAND > tag like in my case I used.

    <COMMAND name="show core">
    

    This is not the proper way to use space in the < COMMAND > tag

    But if you want that your command should be like this only i.e. show core then there are two ways to achieve it.

    First way:-

    <COMMAND name="show"
             help="Put what help you want to give"/>
    <COMMAND name="show core"
             help="Put what help you want to give">
          <DETAIL>   
          </DETAIL>
     <ACTION>echo "core status"</ACTION>
    </COMMAND>
    

    Second way:- Use VAR tag and completion attribute in PARAM tag

    <COMMAND name="show"
             help="Put what help you want to give">
       <PARAM name="pname"
              help="Put what help you want to give"
              ptype="STRING"
              completion="${vartagvariable}"/>
        <DETAIL> 
        </DETAIL>
       <ACTION>echo "core status"</ACTION>
      <VAR name="vartagvariable" help="Something...." value="core" />
     </COMMAND>
    
    0 讨论(0)
提交回复
热议问题