clicon / clixon

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

cl:autocli-op hide has no effect in yang submodule #282

Closed nowaits closed 3 years ago

nowaits commented 3 years ago

Hi olof, I'm using cl:autocli-op hide in yang submodule, and find has no effect. my main yang is: example.yang

module example {
    yang-version 1.1;
    namespace "example.com";
    prefix ex;

    include demo;

    uses demo;
}

submodule is demo.yang

submodule demo {
    belongs-to "example" {
        prefix "demo";
    }

    import clixon-lib { prefix cl; }

    grouping demo {
        container a {
            cl:autocli-op hide;

            leaf b {
                type string;
            }
        }
    }
}

config.cli:

CLICON_MODE="config";
CLICON_PLUGIN="mgmt-cli";

# Autocli syntax tree operations
config @datamodel, cli_auto_edit("datamodel");
up, cli_auto_up("datamodel");
top, cli_auto_top("datamodel");
set @datamodel, cli_auto_set();
create @datamodel, cli_auto_create();
delete("Delete a configuration item") {
      @datamodel, cli_auto_del(); 
}

When enter , option a still exist in cli:

root@localhost (config) > set <TAB>
 a                    
olofhagsand commented 3 years ago

confirmed. Temporary work-around: add import clixon-lib { prefix cl; } in main module

olofhagsand commented 3 years ago

It is actually worse, not only grouping/uses from submodules but the same issue exists for imported modules.

olofhagsand commented 3 years ago

Fixed by patch ^. Please verify.