clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
208 stars 70 forks source link

Does clixon cli support autocompletion for leafrefs pointed to another module? #455

Closed EvgeniiVR closed 10 months ago

EvgeniiVR commented 11 months ago

Hello team,

Let's say we have the following simple modules:

module ex-module1 {
  yang-version 1.1;
  namespace "urn:example:module1";
  prefix m1;

  list M1LIST1 {
    key name; 
    leaf name {
      type string;
    }
  }

  leaf M1LEAF2 {
    type string;
  }
}
module ex-module2 {
  yang-version 1.1;
  namespace "urn:example:module2";
  prefix m2;

  import ex-module1 {
    prefix m1;
  }

  leaf M2L1 {
    type leafref {
      path "/m1:M1LIST1/m1:name";
      require-instance true;
    } 
  }
}

From the validation side it works and leafrefs are checked properly. But cli autocomplete fails with error:

Get configuration: application bad-attribute No namespace found for prefix: m1 <bad-attribute>select</bad-attribute> However for intramodule desc paths autocompletion works fine. Is it expected behaviour?

olofhagsand commented 11 months ago

Confirm that this is a bug. Note that CLICON_CLI_EXPAND_LEAFREF=true is a required setting for this functionality

olofhagsand commented 11 months ago

Should be fixed. Please verify that it works now.